Re: [PATCH v3] ARM: ls1021a: add gating clocks to IP blocks.

From: Shawn Guo
Date: Thu Sep 25 2014 - 21:57:49 EST


On Thu, Sep 25, 2014 at 05:22:29PM +0800, Xiubo Li-B47053 wrote:
...
> > > + clks[LS1021A_CLK_FLEXTIMER1_EN] = ls1021a_clk_gate("flextimer1_en",
> > > + "dummy", DCFG_CCSR_DEVDISR5,
> > > + ls1021a_clk_shift(31));
> >
> > So "dummy" and ls1021a_clk_shift() are two common things for every
> > single call of ls1021a_clk_gate(). Can we handle them in
> > ls1021a_clk_gate() wrapper, so that we can make these calls a bit
> > shorter?
> >
>
> There one gate has one parent.

Ah, yes. I missed that.

> If the 'big-endian' will as default, I think ls1021a_clk_gate() could be handled
> In ls1021a_clk_gate() wrapper to simplify the code.

Yes, that's what I meant.

...

> > > +static inline struct clk *ls1021a_clk_gate(const char *name, const char
> > *parent,
> > > + void __iomem *reg, u8 shift)
> > > +{
> > > + return clk_register_gate(NULL, name, parent, CLK_SET_RATE_PARENT |
> >
> > As the parent of the clocks registered by this function is "dummy" from
> > what I see, what is the point of setting flag CLK_SET_RATE_PARENT then?
> >
> > > + CLK_IGNORE_UNUSED, reg, shift,
> >
> > Why flag CLK_IGNORE_UNUSED?
> >
>
> As the SoC reference manual all the IP blocks will be enabled when powered up.
> But the Linux OS will disable all the IP blocks' clocks as default without this.
>
> For now, this gate driver will only used for PM support of some IP blocks. For the
> Others needed to be enabled as default.

Ok, got it. I'm fine with the flag then, and we can remove it after all
those client devices manage their clocks well.

Shawn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/