Re: [PATCH v3 3/9] iio: adc: ti-ads1262: support per-channel sampling frequency
"Kurt Borja" <[email protected]>
| Newsgroups | org.kernel.vger.linux-gpio,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> >> --- >> 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