Re: [PATCH v3 3/9] iio: adc: ti-ads1262: support per-channel sampling frequency

From: Kurt Borja

Date: Sun Aug 09 2026 - 04:27:58 EST


On Sat Aug 8, 2026 at 1:39 PM -05, David Lechner wrote:
> On 8/7/26 10:58 PM, Kurt Borja wrote:
>> Add per-channel sampling frequency support. The "available" attribute is
>> assigned per-channel too, in order to eventually support per-filter
>> availability.
>>
>> Signed-off-by: Kurt Borja <kuurtb@xxxxxxxxx>
>> ---
>> drivers/iio/adc/ti-ads1262.c | 159 ++++++++++++++++++++++++++++++++++++++++++-
>> 1 file changed, 158 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/iio/adc/ti-ads1262.c b/drivers/iio/adc/ti-ads1262.c
>> index d78e5e3ae13e..b3b7b1249102 100644
>> --- a/drivers/iio/adc/ti-ads1262.c
>> +++ b/drivers/iio/adc/ti-ads1262.c

[...]

>> @@ -148,6 +149,7 @@ enum {
>> ADS1262_DR_14400_SPS,
>> ADS1262_DR_19200_SPS,
>> ADS1262_DR_38400_SPS,
>> + ADS1262_DR_COUNT,
>> };
>>
>
> /* FIR filter has limited data rate range. */
> #define ADS1262_DR_COUNT_FIR_FILTER (ADS1262_DR_20_SPS + 1)
>
> So we can properly restrict the rate when the FIR filter
> is selected.

There's also a hole in between. The 16.6 SPS data rate doesn't support
the FIR filter. Maybe I'll need one array specifically for the FIR
filter.

[...]

>> +static void ads1262_populate_samp_freqs(struct ads1262 *st,
>> + struct ads1262_channel *chan)
>> +{
>> + int freq_Hz, freq_rem;
>
> Shouldn't these be u64 and u32?

I would have to cast them to int either way. Also I think it shouldn't
be a problem within the recommended clock rate.

[...]

--
Thanks,
~ Kurt