Re: [PATCH V5] clk: bcm: Add driver for BCM53573 ILP clock

From: Stephen Boyd
Date: Thu Aug 25 2016 - 15:57:19 EST


On 08/25, RafaÅ MiÅecki wrote:
> On 24 August 2016 at 10:47, Stephen Boyd <sboyd@xxxxxxxxxxxxxx> wrote:
> > On 08/23, RafaÅ MiÅecki wrote:
> >> + }
> >> +
> >> + /* Disable measurement to save power */
> >> + writel(0x0, pmu + PMU_XTAL_FREQ_RATIO);
> >> +
> >> + avg = sum / num;
> >> +
> >> + return parent_rate * 4 / avg;
> >> +}
> >> +
> >> +static const struct clk_ops bcm53573_ilp_clk_ops = {
> >> + .enable = bcm53573_ilp_enable,
> >
> > No disable? Or .is_enabled?
>
> The beauty of working without datasheets... I'll compare initial reg
> state with one after enabling and see if there is sth obvious.
>
>

Ok.

> >
> > Can this be a platform driver instead?
>
> I guess it can. Should it? It's not clear to me when CLK_OF_DECLARE is
> preferred and when it's not.

We've been taking an approach of using CLK_OF_DECLARE() for clks
that must be registered for timers and interrupt controllers (as
these things are done before the device model is initialized),
and struct drivers otherwise. If the DT node has a mix of
timer/interrupt controller clks and other clks then
CLK_OF_DECLARE_DRIVER() can be used and then we can still have a
builtin driver.

--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project