From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932293AbcFNW7h (ORCPT ); Tue, 14 Jun 2016 18:59:37 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35357 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932163AbcFNW7g (ORCPT ); Tue, 14 Jun 2016 18:59:36 -0400 MIME-Version: 1.0 In-Reply-To: <20160614173910.GB28218@codeaurora.org> References: <1465381201-11537-1-git-send-email-ricardo.ribalda@gmail.com> <20160614173910.GB28218@codeaurora.org> From: Ricardo Ribalda Delgado Date: Wed, 15 Jun 2016 00:59:15 +0200 Message-ID: Subject: Re: [PATCH 0/3] Convert clk-fixed into module platform driver To: Stephen Boyd Cc: Michael Turquette , Sascha Hauer , jeremy.kerr@canonical.com, linux-clk@vger.kernel.org, LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephen Assume this device tree overlay: &bus0{ axi_clk: axi_clk { compatible = "fixed-clock"; #clock-cells = <0x0>; clock-frequency = <125000000>; }; iic_0: iic { #address-cells = <1>; #size-cells = <1>; compatible = "xlnx,xps-iic-2.00.a"; reg = < 0x00030000 0x10000 >; interrupt-parent = <&xps_intc_0>; interrupts = < 2 2 >; clocks = <&axi_clk>; } ; } Which is basically a new i2c master and a fixed clock definition. The fixed clock driver will only be probed to the driver at arch initialization, when of_clk_init is called. The device overlay can be added at any point, usually after arch init. Which will result in ii_0 failing to probe, because it is missing its clock. This changeset allows fixed clocks to be added after of_clk_init is called, by converting the driver into a platform driver. Thanks!b On Tue, Jun 14, 2016 at 7:39 PM, Stephen Boyd wrote: > On 06/08, Ricardo Ribalda Delgado wrote: >> When clock providers are added to the device tree after of_clk_init is called >> they are not added to the clock provider list. This makes that drivers such >> as i2c-xiic.c fail to init, as they may depend on the unadded clock provider. > > Who's the provider here? It isn't clear to me why we're > populating fixed factor and fixed rate clks from DT for i2c > devices? Presumably there's an i2c device driver that should be > populating clks from C code instead? > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, > a Linux Foundation Collaborative Project -- Ricardo Ribalda