Re: [PATCH v2 4/4] iio: adc: ad7124: add clock output support
From: David Lechner
Date: Tue Aug 26 2025 - 11:15:27 EST
On 8/26/25 3:13 AM, Andy Shevchenko wrote:
> On Tue, Aug 26, 2025 at 1:55 AM David Lechner <dlechner@xxxxxxxxxxxx> wrote:
>>
>> Add support for the AD7124's internal clock output. If the #clock-cells
>> property is present, turn on the internal clock output during probe.
>>
>> If both the clocks and #clock-names properties are present (not allowed
>> by devicetree bindings), assume that an external clock is being used so
>> that we don't accidentally have two outputs fighting each other.
>
> ...
>
>> static const int ad7124_master_clk_freq_hz[3] = {
>> - [AD7124_LOW_POWER] = 76800,
>> - [AD7124_MID_POWER] = 153600,
>> - [AD7124_FULL_POWER] = 614400,
>> + [AD7124_LOW_POWER] = AD7124_INT_CLK_HZ / 8,
>> + [AD7124_MID_POWER] = AD7124_INT_CLK_HZ / 4,
>> + [AD7124_FULL_POWER] = AD7124_INT_CLK_HZ,
>
> Perhaps / 1 ?
Seems redundant.
>
>> };
>
> ...
>
>> + const char *name __free(kfree) = kasprintf(GFP_KERNEL, "%s-clk",
>> + fwnode_get_name(dev_fwnode(dev)));
>
> What's wrong with the %pfwP specifier?
I didn't know about it.
>
>> + if (!name)
>> + return -ENOMEM;
>