Re: [PATCH 2/2] iio: adc: ad7124: Fix 3dB filter frequency reading

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 14, 2025 at 08:01:13AM +0000, Nuno Sá wrote:
> On Wed, 2025-03-12 at 19:38 +0100, Uwe Kleine-König wrote:
> > The sinc4 filter has a factor 0.23 between Output Data Rate and f_{3dB}
> > and for sinc3 the factor is 0.272 according to the data sheets for
> > ad7124-4 (Rev. E.) and ad7124-8 (Rev. F).
> > 
> > Fixes: cef2760954cf ("iio: adc: ad7124: add 3db filter")
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>
> > ---
> >  drivers/iio/adc/ad7124.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c
> > index 67d49e6184f7..a3cb47ca3901 100644
> > --- a/drivers/iio/adc/ad7124.c
> > +++ b/drivers/iio/adc/ad7124.c
> > @@ -291,9 +291,9 @@ static int ad7124_get_3db_filter_freq(struct ad7124_state *st,
> >  
> >  	switch (st->channels[channel].cfg.filter_type) {
> >  	case AD7124_FILTER_FILTER_SINC3:
> > -		return DIV_ROUND_CLOSEST(fadc * 230, 1000);
> > -	case AD7124_FILTER_FILTER_SINC4:
> >  		return DIV_ROUND_CLOSEST(fadc * 262, 1000);
> 
> I wonder if we shouldn't fix the sinc3 factor as well? Or at the very least mention
> in the commit message why we're not doing it now. Otherwise it's confusing and raises
> questions to state the proper factor in the commit and then look at this diff.

Huh, I intended to fix that, but it seems I sent out an older version of
my patch :-\. Will send a v2. Thanks for catching that.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux