linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Alexandru Tachici" <alexandru.tachici@analog.com>
Cc: linux-iio@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: adc: ad7124: Fix 3dB filter frequency reading
Date: Fri, 14 Mar 2025 08:01:13 +0000	[thread overview]
Message-ID: <4d3e77deab4741112d7ef45ba331177bbc3879ca.camel@gmail.com> (raw)
In-Reply-To: <6d31f9559939ec04066bec612a59bc7ace2ca548.1741801853.git.u.kleine-koenig@baylibre.com>

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@baylibre.com>
> ---
>  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.

- Nuno Sá

> +	case AD7124_FILTER_FILTER_SINC4:
> +		return DIV_ROUND_CLOSEST(fadc * 230, 1000);
>  	default:
>  		return -EINVAL;
>  	}


  reply	other threads:[~2025-03-14  8:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12 18:38 [PATCH 0/2] iio: adc: ad7124: Fix 3dB filter frequency reading Uwe Kleine-König
2025-03-12 18:38 ` [PATCH 1/2] iio: adc: ad7124: Make register naming consistent Uwe Kleine-König
2025-03-12 18:38 ` [PATCH 2/2] iio: adc: ad7124: Fix 3dB filter frequency reading Uwe Kleine-König
2025-03-14  8:01   ` Nuno Sá [this message]
2025-03-14  8:17     ` Uwe Kleine-König
2025-03-14  8:06 ` [PATCH 0/2] " Nuno Sá
2025-03-15 18:46 ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d3e77deab4741112d7ef45ba331177bbc3879ca.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=alexandru.tachici@analog.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).