From: Jonathan Cameron <jic23@kernel.org>
To: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Cc: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Nuno Sá" <noname.nuno@gmail.com>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v2 2/3] iio: adc: ad7124: Remove ability to write filter_low_pass_3db_frequency
Date: Mon, 31 Mar 2025 10:53:34 +0100 [thread overview]
Message-ID: <20250331105334.677b60c6@jic23-huawei> (raw)
In-Reply-To: <Z-RI2JsbK9l2aMnY@debian-BULLSEYE-live-builder-AMD64>
On Wed, 26 Mar 2025 15:35:04 -0300
Marcelo Schmitt <marcelo.schmitt1@gmail.com> wrote:
> On 03/17, Uwe Kleine-König wrote:
> > There are several issues with the function that implements writing to
> > the filter_low_pass_3db_frequency property:
> >
> > - The sinc3 factor should be 0.272 not 0.262 (this is fixed for the
> > reading side in the previous patch).
> > - For freq > 1 the if condition is always true so the sinc4 filter is
> > hardly ever chosen.
> > - In the nearly always taken if branch the filter is set to sinc3, but
> > the frequency is set for sinc4. (And vice versa in the else branch.)
> >
> > This is broken enough to justify the claim that there isn't any serious
> > user. Also it it counter-intuitive that setting the 3db frequency
> > modifies the sample frequency and the filter type.
>
> Not from engineering background but, as a Linux developer, I agree changing 3dB
> frequency to set the ODR (sampling frequency) is counter-intuitive and uncommon
> among other IIO sigma-delta ADC drivers.
First, ABI wise, any parameter is allowed to change any other - so we have
no firm rules on this.
Changing the filter type isn't completely silly as a side effect of changing
3db point as when we are selecting between fixed filters that may be precisely
what the user is trying to do.
Changing the sampling frequency is harder to argue.
Given it's horribly broken anyway I guess no one ever touched it and we are
fine to clean things up.
Jonathan
>
> >
> > So drop the ability to write that property.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
>
> Reviewed-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
next prev parent reply other threads:[~2025-03-31 9:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 11:52 [PATCH v2 0/3] iio: adc: ad7124: Fix 3dB filter frequency reading Uwe Kleine-König
2025-03-17 11:52 ` [PATCH v2 1/3] " Uwe Kleine-König
2025-03-26 18:20 ` Marcelo Schmitt
2025-03-31 13:38 ` Uwe Kleine-König
2025-03-31 14:40 ` Marcelo Schmitt
2025-03-17 11:52 ` [PATCH v2 2/3] iio: adc: ad7124: Remove ability to write filter_low_pass_3db_frequency Uwe Kleine-König
2025-03-26 18:35 ` Marcelo Schmitt
2025-03-31 9:53 ` Jonathan Cameron [this message]
2025-03-17 11:52 ` [PATCH v2 3/3] iio: adc: ad7124: Make register naming consistent Uwe Kleine-König
2025-03-17 19:00 ` [PATCH v2 0/3] iio: adc: ad7124: Fix 3dB filter frequency reading Jonathan Cameron
2025-03-24 9:44 ` Uwe Kleine-König
2025-03-31 10:02 ` Jonathan Cameron
2025-04-06 10:54 ` 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=20250331105334.677b60c6@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=noname.nuno@gmail.com \
--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