Re: [PATCH v10 4/8] platform/x86: int3472: tps68470: add static clock consumer support
From: Sakari Ailus
Date: Fri Sep 04 2026 - 03:14:29 EST
On Tue, Sep 01, 2026 at 02:12:22PM +0300, Andy Shevchenko wrote:
> On Mon, Aug 31, 2026 at 06:07:50PM +0200, Thierry Chatard wrote:
> > On some platforms a sensor's ACPI _DEP does not list the INT3472 device,
> > so for_each_acpi_consumer_dev() misses that sensor and never registers its
> > tps68470-clk consumer entry, leaving the sensor without its MCLK.
> >
> > Add optional n_clk_consumers/clk_consumers fields to the board data. When
> > set, probe builds the tps68470-clk platform data from that static list
> > instead of walking the ACPI consumers. Boards that leave the fields unset
> > keep using the existing ACPI traversal.
>
> ...
>
> > - n_consumers = skl_int3472_fill_clk_pdata(dev, &clk_pdata);
> > - if (n_consumers < 0)
> > - return n_consumers;
> > + if (board_data->n_clk_consumers) {
> > + clk_pdata = devm_kzalloc(dev,
> > + struct_size(clk_pdata, consumers,
> > + board_data->n_clk_consumers),
> > + GFP_KERNEL);
> > + if (!clk_pdata)
> > + return -ENOMEM;
> > + clk_pdata->n_consumers = board_data->n_clk_consumers;
> > + for (i = 0; i < board_data->n_clk_consumers; i++)
> > + clk_pdata->consumers[i] = board_data->clk_consumers[i];
> > + n_consumers = board_data->n_clk_consumers;
> > + } else {
> > + n_consumers = skl_int3472_fill_clk_pdata(dev, &clk_pdata);
> > + if (n_consumers < 0)
> > + return n_consumers;
> > + }
>
> Can it be done in a helper, so we will have here something like this:
Please don't; it's better as-is.
>
> if (board_data->n_clk_consumers)
> n_consumers = skl_int3472_fill_static_clk_pdata(dev, &clk_pdata);
> else
> n_consumers = skl_int3472_fill_clk_pdata(dev, &clk_pdata);
> if (n_consumers < 0)
> return n_consumers;
>
> ?
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
--
Sakari Ailus