Re: [PATCH v2 3/3] clk: qcom: lcc-ipq806x: convert to parent data

From: Dmitry Baryshkov
Date: Wed Jul 06 2022 - 03:34:23 EST


On Tue, 5 Jul 2022 at 23:48, Christian Marangi <ansuelsmth@xxxxxxxxx> wrote:
>
> On Tue, Jun 21, 2022 at 11:43:10PM +0300, Dmitry Baryshkov wrote:
> > On Tue, 21 Jun 2022 at 23:23, Christian Marangi <ansuelsmth@xxxxxxxxx> wrote:
> > >
> > > On Tue, Jun 21, 2022 at 08:15:57PM +0300, Dmitry Baryshkov wrote:
> > > > On Tue, 21 Jun 2022 at 19:33, Christian Marangi <ansuelsmth@xxxxxxxxx> wrote:
> > > > >
> > > > > Convert lcc-ipq806x driver to parent_data API.
> > > > >
> > > > > Signed-off-by: Christian Marangi <ansuelsmth@xxxxxxxxx>
> > > > > ---
> > > > > v2:
> > > > > - Fix Sob tag
> > > > >
> > > > > drivers/clk/qcom/lcc-ipq806x.c | 79 +++++++++++++++++++---------------
> > > > > 1 file changed, 44 insertions(+), 35 deletions(-)
> > > > >
> > > > > diff --git a/drivers/clk/qcom/lcc-ipq806x.c b/drivers/clk/qcom/lcc-ipq806x.c
> > > > > index ba90bebba597..c07ca8dc6e3a 100644
> > > > > --- a/drivers/clk/qcom/lcc-ipq806x.c
> > > > > +++ b/drivers/clk/qcom/lcc-ipq806x.c
> > > > > @@ -24,6 +24,10 @@
> > > > > #include "clk-regmap-mux.h"
> > > > > #include "reset.h"
> > > > >
> > > > > +static const struct clk_parent_data gcc_pxo[] = {
> > > > > + { .fw_name = "pxo", .name = "pxo" },
> > > >
> > > > I think you'd use .name = "pxo_board" here. You don't need to use the
> > > > interim clock.
> > > >
> > >
> > > In gcc and in the rest of this driver we use pxo. Wonder what is right?
> >
> > I'd use .fw_name = "pxo", .name = "pxo_board", like the rest of drivers do.
> >
>
> Will do the change, but I need an explaination... Is the use of
> pxo_board correct?
>
> I'm sending a patch that sets the pxo_board fixed clock in dts to output
> "pxo". The only clock that still use pxo_board is rpm, everything else
> at least for ipq806x use pxo and i'm sending a patch to use pxo for rpm.
>
> Considering pxo is always present and pxo_board should be dropped
> because every ipq806x driver use "pxo".
>
> What is correct naming pxo or pxo_board? I assume pxo right?

This might be not the case for the ipq806x, but here is the story for
all other (old) platforms:
- gcc driver manually registered pxo/cxo/xo fixed factor clocks.
- Then we started adding *xo_board clocks to the DT, as they represent
the external oscillators
- PXO clock consumers receive a clocks entry with clock-names = "pxo"
which points to the pxo_board
- All clock drivers are now being switched to use .fw_name = "pxo",
.name = "pxo_board" to use the DT-defined pxo_board clock.

Hopefully at some point we can then drop the manually registered pxo
clock and always use the DT-based one.

--
With best wishes
Dmitry