From: t-kristo@ti•com (Tero Kristo)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCHv12 07/49] clk: divider: add support for low level ops
Date: Fri, 3 Jan 2014 11:17:03 +0200 [thread overview]
Message-ID: <52C6800F.3090303@ti.com> (raw)
In-Reply-To: <20131222175235.GC8064@book.gsilab.sittig.org>
On 12/22/2013 07:52 PM, Gerhard Sittig wrote:
> [ dropped devicetree, we're clock specific here ]
>
> On Fri, Dec 20, 2013 at 18:34 +0200, Tero Kristo wrote:
>>
>> Divider clock can now be registered to use low level register access ops.
>> Preferred initialization method is via clock description.
>>
>> Signed-off-by: Tero Kristo <t-kristo@ti•com>
>> ---
>> drivers/clk/clk-divider.c | 22 +++++++++++++++++++---
>> include/linux/clk-provider.h | 4 ++++
>> 2 files changed, 23 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
>> index 8cfed5c..887e2d8 100644
>> --- a/drivers/clk/clk-divider.c
>> +++ b/drivers/clk/clk-divider.c
>> @@ -108,7 +108,12 @@ static unsigned long clk_divider_recalc_rate(struct clk_hw *hw,
>> struct clk_divider *divider = to_clk_divider(hw);
>> unsigned int div, val;
>>
>> - val = clk_readl(divider->reg) >> divider->shift;
>> + if (divider->ll_ops)
>> + val = divider->ll_ops->clk_readl(divider->reg);
>> + else
>> + val = clk_readl(divider->reg);
>
> Should this not better always use an ll_ops structure, which
> either is individual to the clock item, or is "global" for a
> platform, yet can get re-registered at runtime (see the comment
> on 06/49)? And why are you referencing clk_readl() instead of
> clk_readl_default() which you specifically have introduced in the
> previous patch? Adding a copy of the routine and using both the
> copy and the original doesn't look right.
In some cases, the clock data is defined statically during compile time
and here, ll_ops can be (and for OMAP cases at least is) NULL. I had
kind of a global ll_ops definition in some of the earlier versions of
this series, but it was frowned upon by some of the maintainers thus I
dropped it.
-Tero
next prev parent reply other threads:[~2014-01-03 9:17 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 16:34 [PATCHv12 00/49] ARM: TI SoC clock DT conversion Tero Kristo
2013-12-20 16:34 ` [PATCHv12 01/49] clk: add support for registering clocks from description Tero Kristo
2013-12-20 16:34 ` [PATCHv12 03/49] clk: divider: add support for registering divider clock from descriptor Tero Kristo
2013-12-20 16:34 ` [PATCHv12 04/49] clk: mux: add support for registering mux " Tero Kristo
2013-12-20 16:34 ` [PATCHv12 05/49] clk: gate: add support for registering gate " Tero Kristo
2013-12-20 16:34 ` [PATCHv12 06/49] clk: add support for low level register ops Tero Kristo
2013-12-22 17:39 ` Gerhard Sittig
2014-01-03 9:13 ` Tero Kristo
2014-01-03 19:48 ` Stephen Boyd
2014-01-07 7:44 ` Tero Kristo
2013-12-20 16:34 ` [PATCHv12 07/49] clk: divider: add support for low level ops Tero Kristo
2013-12-22 17:52 ` Gerhard Sittig
2014-01-03 9:17 ` Tero Kristo [this message]
2014-01-04 16:48 ` Gerhard Sittig
2013-12-20 16:34 ` [PATCHv12 08/49] clk: gate: " Tero Kristo
2013-12-20 16:34 ` [PATCHv12 09/49] clk: mux: " Tero Kristo
2013-12-20 16:34 ` [PATCHv12 11/49] CLK: ti: add init support for clock IP blocks Tero Kristo
2013-12-20 16:34 ` [PATCHv12 12/49] CLK: TI: Add DPLL clock support Tero Kristo
2013-12-20 16:34 ` [PATCHv12 14/49] clk: ti: add composite " Tero Kristo
2013-12-20 16:34 ` [PATCHv12 17/49] CLK: TI: add support for gate clock Tero Kristo
2013-12-20 16:34 ` [PATCHv12 18/49] CLK: TI: add support for clockdomain binding Tero Kristo
2013-12-20 16:34 ` [PATCHv12 23/49] CLK: TI: DRA7: Add APLL support Tero Kristo
2013-12-20 16:34 ` [PATCHv12 43/49] ARM: OMAP2+: PRM: add support for initializing PRCM clock modules from DT Tero Kristo
2013-12-20 18:37 ` [PATCHv12 00/49] ARM: TI SoC clock DT conversion Tony Lindgren
2013-12-20 20:06 ` Felipe Balbi
2013-12-20 20:10 ` Sebastian Reichel
2014-01-07 3:21 ` Nishanth Menon
2014-01-07 16:36 ` Nishanth Menon
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=52C6800F.3090303@ti.com \
--to=t-kristo@ti$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox