From: Tero Kristo <t-kristo@ti.com>
To: Matt Sealey <neko@bakuhatsu.net>
Cc: nm@ti.com,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
paul@pwsan.com, Mike Turquette <mturquette@linaro.org>,
Tony Lindgren <tony@atomide.com>,
rnayak@ti.com, bcousson@baylibre.com, linux-omap@vger.kernel.org,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCHv9 05/43] CLK: TI: add DT alias clock registration mechanism
Date: Wed, 30 Oct 2013 10:29:28 +0200 [thread overview]
Message-ID: <5270C368.9000701@ti.com> (raw)
In-Reply-To: <CAHCPf3uPhkVhdn3Db06YZfrwQuA7khdZEXiZ+pqJ06J9YdBoLg@mail.gmail.com>
On 10/29/2013 07:50 PM, Matt Sealey wrote:
> On Fri, Oct 25, 2013 at 10:56 AM, Tero Kristo <t-kristo@ti.com> wrote:
>> Some devices require their clocks to be available with a specific
>> dev-id con-id mapping. With DT, the clocks can be found by default
>> only with their name, or alternatively through the device node of
>> the consumer. With drivers, that don't support DT fully yet, add
>> mechanism to register specific clock names.
>>
>> Signed-off-by: Tero Kristo <t-kristo@ti.com>
>> Tested-by: Nishanth Menon <nm@ti.com>
>> Acked-by: Tony Lindgren <tony@atomide.com>
>
> You guys are wonderful, by the way ;)
>
>> +void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])
>> +{
>> + struct ti_dt_clk *c;
>> + struct device_node *node;
>> + struct clk *clk;
>> + struct of_phandle_args clkspec;
>> +
>> + for (c = oclks; c->node_name != NULL; c++) {
>> + node = of_find_node_by_name(NULL, c->node_name);
>> + clkspec.np = node;
>> + clk = of_clk_get_from_provider(&clkspec);
>> +
>> + if (!IS_ERR(clk)) {
>> + c->lk.clk = clk;
>> + clkdev_add(&c->lk);
>> + } else {
>> + pr_warn("%s: failed to lookup clock node %s\n",
>> + __func__, c->node_name);
>> + }
>> + }
>> +}
>
> I have one question here, what makes this part of the patch
> TI-specific at all except the definition of the structure ti_dt_clk?
> Mapping DT clocks to generic clkdev legacy namings seems like it would
> be a necessary evil across *all* SoC platforms.
>
> I would say there is a good case for this being generic and used by
> all platforms waiting for con->id/dev->id to be moved to DT-awareness,
> the structure itself is very generic within clkdev as long as the
> drivers conformed anyway (and if they didn't, none of this helps) and
> I don't think it really needs to be a TI-only thing. The next thing
> that's going to happen when another platform arrives that wants to do
> the same thing is duplication or consolidation - so it would probably
> be a good idea to make this generic to start.
>
> While there the names could be a bit more descriptive -
> dt_clk_name_lookup_map_register(), struct dt_clk_name_lookup_map,
> DT_CLK_LOOKUP_MAP() ..? The current namespace makes it look like this
> is the absolute correct thing to do under all circumstances, but in
> fact this is purely for mapping the old way to the new, better way..
> in the event a brand new platform arrives, with all new drivers (or
> only compliant drivers), none of this code should be implemented for
> it and it should be presented this way.
An earlier implementation of this patch (or at least a patch that tries
to accomplish the same as this does, add support for legacy devices) did
try to add generic solution. There was some discussion on it and I
decided to drop it due to bad feedback.
See: http://www.spinics.net/lists/linux-omap/msg95147.html
-Tero
WARNING: multiple messages have this Message-ID (diff)
From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv9 05/43] CLK: TI: add DT alias clock registration mechanism
Date: Wed, 30 Oct 2013 10:29:28 +0200 [thread overview]
Message-ID: <5270C368.9000701@ti.com> (raw)
In-Reply-To: <CAHCPf3uPhkVhdn3Db06YZfrwQuA7khdZEXiZ+pqJ06J9YdBoLg@mail.gmail.com>
On 10/29/2013 07:50 PM, Matt Sealey wrote:
> On Fri, Oct 25, 2013 at 10:56 AM, Tero Kristo <t-kristo@ti.com> wrote:
>> Some devices require their clocks to be available with a specific
>> dev-id con-id mapping. With DT, the clocks can be found by default
>> only with their name, or alternatively through the device node of
>> the consumer. With drivers, that don't support DT fully yet, add
>> mechanism to register specific clock names.
>>
>> Signed-off-by: Tero Kristo <t-kristo@ti.com>
>> Tested-by: Nishanth Menon <nm@ti.com>
>> Acked-by: Tony Lindgren <tony@atomide.com>
>
> You guys are wonderful, by the way ;)
>
>> +void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])
>> +{
>> + struct ti_dt_clk *c;
>> + struct device_node *node;
>> + struct clk *clk;
>> + struct of_phandle_args clkspec;
>> +
>> + for (c = oclks; c->node_name != NULL; c++) {
>> + node = of_find_node_by_name(NULL, c->node_name);
>> + clkspec.np = node;
>> + clk = of_clk_get_from_provider(&clkspec);
>> +
>> + if (!IS_ERR(clk)) {
>> + c->lk.clk = clk;
>> + clkdev_add(&c->lk);
>> + } else {
>> + pr_warn("%s: failed to lookup clock node %s\n",
>> + __func__, c->node_name);
>> + }
>> + }
>> +}
>
> I have one question here, what makes this part of the patch
> TI-specific at all except the definition of the structure ti_dt_clk?
> Mapping DT clocks to generic clkdev legacy namings seems like it would
> be a necessary evil across *all* SoC platforms.
>
> I would say there is a good case for this being generic and used by
> all platforms waiting for con->id/dev->id to be moved to DT-awareness,
> the structure itself is very generic within clkdev as long as the
> drivers conformed anyway (and if they didn't, none of this helps) and
> I don't think it really needs to be a TI-only thing. The next thing
> that's going to happen when another platform arrives that wants to do
> the same thing is duplication or consolidation - so it would probably
> be a good idea to make this generic to start.
>
> While there the names could be a bit more descriptive -
> dt_clk_name_lookup_map_register(), struct dt_clk_name_lookup_map,
> DT_CLK_LOOKUP_MAP() ..? The current namespace makes it look like this
> is the absolute correct thing to do under all circumstances, but in
> fact this is purely for mapping the old way to the new, better way..
> in the event a brand new platform arrives, with all new drivers (or
> only compliant drivers), none of this code should be implemented for
> it and it should be presented this way.
An earlier implementation of this patch (or at least a patch that tries
to accomplish the same as this does, add support for legacy devices) did
try to add generic solution. There was some discussion on it and I
decided to drop it due to bad feedback.
See: http://www.spinics.net/lists/linux-omap/msg95147.html
-Tero
next prev parent reply other threads:[~2013-10-30 8:29 UTC|newest]
Thread overview: 212+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-25 15:56 [PATCHv9 00/43] ARM: TI SoC clock DT conversion Tero Kristo
2013-10-25 15:56 ` Tero Kristo
2013-10-25 15:56 ` [PATCHv9 01/43] clk: Add support for regmap register read/write Tero Kristo
2013-10-25 15:56 ` Tero Kristo
2013-10-31 14:03 ` Nishanth Menon
2013-10-31 14:03 ` Nishanth Menon
2013-10-31 14:40 ` Tero Kristo
2013-10-31 14:40 ` Tero Kristo
2013-10-31 15:46 ` Nishanth Menon
2013-10-31 15:46 ` Nishanth Menon
2013-11-01 8:57 ` Tero Kristo
2013-11-01 8:57 ` Tero Kristo
2013-11-05 21:43 ` Gerhard Sittig
2013-11-05 21:43 ` Gerhard Sittig
2013-11-06 10:54 ` Tero Kristo
2013-11-06 10:54 ` Tero Kristo
2013-11-02 13:26 ` Tomasz Figa
2013-11-02 13:26 ` Tomasz Figa
2013-10-25 15:56 ` [PATCHv9 02/43] clk: divider: add init call which supports regmap Tero Kristo
2013-10-25 15:56 ` Tero Kristo
2013-10-25 15:56 ` [PATCHv9 03/43] clk: mux: " Tero Kristo
2013-10-25 15:56 ` Tero Kristo
2013-10-25 15:56 ` [PATCHv9 04/43] CLK: TI: Add DPLL clock support Tero Kristo
2013-10-25 15:56 ` Tero Kristo
2013-10-31 14:19 ` Nishanth Menon
2013-10-31 14:19 ` Nishanth Menon
2013-10-31 14:56 ` Tero Kristo
2013-10-31 14:56 ` Tero Kristo
2013-10-31 15:25 ` Nishanth Menon
2013-10-31 15:25 ` Nishanth Menon
2013-10-25 15:56 ` [PATCHv9 05/43] CLK: TI: add DT alias clock registration mechanism Tero Kristo
2013-10-25 15:56 ` Tero Kristo
2013-10-29 17:50 ` Matt Sealey
2013-10-29 17:50 ` Matt Sealey
2013-10-30 8:29 ` Tero Kristo [this message]
2013-10-30 8:29 ` Tero Kristo
2013-10-30 17:38 ` Matt Sealey
2013-10-30 17:38 ` Matt Sealey
2013-10-31 9:18 ` Tero Kristo
2013-10-31 9:18 ` Tero Kristo
2013-11-02 13:49 ` Tomasz Figa
2013-11-02 13:49 ` Tomasz Figa
2013-11-04 22:45 ` Matt Sealey
2013-11-04 22:45 ` Matt Sealey
2013-10-25 15:57 ` [PATCHv9 06/43] CLK: ti: add init support for clock IP blocks Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-31 15:42 ` Nishanth Menon
2013-10-31 15:42 ` Nishanth Menon
2013-11-01 9:12 ` Tero Kristo
2013-11-01 9:12 ` Tero Kristo
2013-11-01 19:13 ` Nishanth Menon
2013-11-01 19:13 ` Nishanth Menon
2013-11-04 7:23 ` Tero Kristo
2013-11-04 7:23 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 07/43] CLK: TI: add autoidle support Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-31 16:05 ` Nishanth Menon
2013-10-31 16:05 ` Nishanth Menon
2013-11-01 9:18 ` Tero Kristo
2013-11-01 9:18 ` Tero Kristo
2013-11-01 19:16 ` Nishanth Menon
2013-11-01 19:16 ` Nishanth Menon
2013-11-04 10:00 ` Tero Kristo
2013-11-04 10:00 ` Tero Kristo
2013-11-04 14:59 ` Nishanth Menon
2013-11-04 14:59 ` Nishanth Menon
2013-11-05 8:10 ` Tero Kristo
2013-11-05 8:10 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 08/43] clk: ti: add composite clock support Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-31 16:27 ` Nishanth Menon
2013-10-31 16:27 ` Nishanth Menon
2013-10-31 16:32 ` Nishanth Menon
2013-10-31 16:32 ` Nishanth Menon
2013-11-01 9:40 ` Tero Kristo
2013-11-01 9:40 ` Tero Kristo
2013-11-01 9:35 ` Tero Kristo
2013-11-01 9:35 ` Tero Kristo
2013-11-01 19:24 ` Nishanth Menon
2013-11-01 19:24 ` Nishanth Menon
2013-10-25 15:57 ` [PATCHv9 09/43] CLK: ti: add support for ti divider-clock Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-31 18:02 ` Nishanth Menon
2013-10-31 18:02 ` Nishanth Menon
2013-11-01 9:48 ` Tero Kristo
2013-11-01 9:48 ` Tero Kristo
2013-11-01 9:54 ` Tero Kristo
2013-11-01 9:54 ` Tero Kristo
2013-11-01 19:35 ` Nishanth Menon
2013-11-01 19:35 ` Nishanth Menon
2013-11-04 10:54 ` Tero Kristo
2013-11-04 10:54 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 10/43] clk: ti: add support for TI fixed factor clock Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-31 18:12 ` Nishanth Menon
2013-10-31 18:12 ` Nishanth Menon
2013-11-01 9:52 ` Tero Kristo
2013-11-01 9:52 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 11/43] CLK: TI: add support for gate clock Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-11-01 20:11 ` Nishanth Menon
2013-11-01 20:11 ` Nishanth Menon
2013-11-04 12:23 ` Tero Kristo
2013-11-04 12:23 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 12/43] CLK: TI: add support for clockdomain binding Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-11-01 20:22 ` Nishanth Menon
2013-11-01 20:22 ` Nishanth Menon
[not found] ` <52740D79.3090107-l0cyMroinI0@public.gmane.org>
2013-11-04 14:30 ` Tero Kristo
2013-11-04 14:30 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 13/43] clk: ti: add support for basic mux clock Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-11-01 21:01 ` Nishanth Menon
2013-11-01 21:01 ` Nishanth Menon
2013-11-05 8:09 ` Tero Kristo
2013-11-05 8:09 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 14/43] CLK: TI: add omap4 clock init file Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 15/43] CLK: TI: add omap5 " Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 16/43] CLK: TI: omap5: Initialize USB_DPLL at boot Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 17/43] CLK: TI: DRA7: Add APLL support Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 18/43] CLK: TI: add dra7 clock init file Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 19/43] CLK: TI: add am33xx " Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 21/43] CLK: TI: add omap3 " Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 22/43] CLK: TI: add am43xx " Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 23/43] ARM: dts: omap4 clock data Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 24/43] ARM: dts: omap5 " Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 26/43] ARM: dts: clk: Add apll related clocks Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 27/43] ARM: dts: DRA7: Change apll_pcie_m2_ck to fixed factor clock Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 28/43] ARM: dts: DRA7: Add PCIe related clock nodes Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 29/43] ARM: dts: DRA7: link in clock DT data Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 30/43] ARM: dts: am33xx clock data Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-26 0:36 ` Jan Lübbe
2013-10-26 0:36 ` Jan Lübbe
2013-10-26 12:46 ` Tero Kristo
2013-10-26 12:46 ` Tero Kristo
2013-10-28 9:59 ` Jan Lübbe
2013-10-28 9:59 ` Jan Lübbe
2013-10-28 10:12 ` Tero Kristo
2013-10-28 10:12 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 31/43] ARM: dts: omap3 " Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 32/43] ARM: dts: AM35xx: use DT " Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-11-01 21:18 ` Nishanth Menon
2013-11-01 21:18 ` Nishanth Menon
2013-11-05 8:12 ` Tero Kristo
2013-11-05 8:12 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 33/43] ARM: dts: am43xx " Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-11-01 21:16 ` Nishanth Menon
2013-11-01 21:16 ` Nishanth Menon
2013-11-04 14:15 ` Tero Kristo
2013-11-04 14:15 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 34/43] ARM: OMAP2+: clock: add support for regmap Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 35/43] ARM: OMAP2+: clock: use driver API instead of direct memory read/write Tero Kristo
2013-10-25 15:57 ` Tero Kristo
[not found] ` <1382716658-6964-1-git-send-email-t-kristo-l0cyMroinI0@public.gmane.org>
2013-10-25 15:57 ` [PATCHv9 20/43] CLK: TI: add interface clock support for OMAP3 Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 25/43] ARM: dts: dra7 clock data Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 36/43] ARM: OMAP: hwmod: fix an incorrect clk type cast with _get_clkdm Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 40/43] ARM: OMAP4: remove old clock data and link in new clock init code Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 37/43] ARM: OMAP3: hwmod: initialize clkdm from clkdm_name Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 38/43] ARM: OMAP2+: PRM: add support for initializing PRCM clock modules from DT Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-11-01 21:07 ` Nishanth Menon
2013-11-01 21:07 ` Nishanth Menon
2013-11-05 8:22 ` Tero Kristo
2013-11-05 8:22 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 39/43] ARM: OMAP2+: io: use new clock init API Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 41/43] ARM: OMAP: DRA7: Enable clock init Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 42/43] ARM: AM33xx: remove old clock data and link in new clock init code Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-25 15:57 ` [PATCHv9 43/43] ARM: OMAP3: use DT clock init if DT data is available Tero Kristo
2013-10-25 15:57 ` Tero Kristo
2013-10-29 16:19 ` [PATCHv9 00/43] ARM: TI SoC clock DT conversion Nishanth Menon
2013-10-29 16:19 ` Nishanth Menon
2013-10-30 8:23 ` Tero Kristo
2013-10-30 8:23 ` Tero Kristo
2013-10-30 15:00 ` Nishanth Menon
2013-10-30 15:00 ` Nishanth Menon
2013-10-30 20:10 ` Nishanth Menon
2013-10-30 20:10 ` Nishanth Menon
2013-10-31 9:10 ` Tero Kristo
2013-10-31 9:10 ` Tero Kristo
2013-10-31 13:55 ` Nishanth Menon
2013-10-31 13:55 ` Nishanth Menon
2013-11-01 21:25 ` Nishanth Menon
2013-11-01 21:25 ` Nishanth Menon
2013-11-04 7:15 ` Tero Kristo
2013-11-04 7:15 ` Tero Kristo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5270C368.9000701@ti.com \
--to=t-kristo@ti.com \
--cc=bcousson@baylibre.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=neko@bakuhatsu.net \
--cc=nm@ti.com \
--cc=paul@pwsan.com \
--cc=rnayak@ti.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.