Re: [PATCH v3 4/5] clk: twl: add clock driver for TWL6032

From: Andreas Kemnade
Date: Sat Oct 07 2023 - 11:03:47 EST


On Tue, 12 Sep 2023 19:15:54 +0200
Christophe JAILLET <christophe.jaillet@xxxxxxxxxx> wrote:

> Le 12/09/2023 à 00:13, Andreas Kemnade a écrit :
> > The TWL6032 has some clock outputs which are controlled like
> > fixed-voltage regulators, in some drivers for these chips
> > found in the wild, just the regulator api is abused for controlling
> > them, so simply use something similar to the regulator functions.
> > Due to a lack of hardware available for testing, leave out the
> > TWL6030-specific part of those functions.
> >
> > Signed-off-by: Andreas Kemnade <andreas@xxxxxxxxxxxx>
> > ---
> > drivers/clk/Kconfig | 9 ++
> > drivers/clk/Makefile | 1 +
> > drivers/clk/clk-twl.c | 197 ++++++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 207 insertions(+)
> > create mode 100644 drivers/clk/clk-twl.c
> >
>
> ...
>
> > +static int twl_clks_probe(struct platform_device *pdev)
> > +{
> > + struct clk_hw_onecell_data *clk_data;
> > + const struct twl_clks_data *hw_data;
> > +
> > + struct twl_clock_info *cinfo;
> > + int ret;
> > + int i;
> > + int count;
> > +
> > + hw_data = twl6032_clks;
> > + for (count = 0; hw_data[count].init.name; count++)
> > + ;
>
> Nit: does removing the /* sentinel */ and using
> ARRAY_SIZE(twl_clks_data) would make sense and be simpler?
>
well, I would like to have it prepared for different arrays
passed in some device data in the future, so I am choosing that
approach.

Regards,
Andreas