* [PATCH v3 0/3] Re-add filter_type/filter_mode
@ 2025-02-03 19:10 Marcelo Schmitt
2025-02-03 19:11 ` [PATCH v3 1/3] Documentation: ABI: IIO: Add filter_type documentation Marcelo Schmitt
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Marcelo Schmitt @ 2025-02-03 19:10 UTC (permalink / raw)
To: linux-iio, linux-kernel
Cc: cosmin.tanislav, jic23, lars, marcelo.schmitt, dlechner, granquet,
u.kleine-koenig, marcelo.schmitt1
Better document sysfs ABI for ADC digital filter configuration.
Also update ad4130 driver to support the standardized IIO ABI for digital filter
configuration.
Change log v2 -> v3
- Added in_voltageY-voltageZ_filter_type to main IIO ADI doc too.
- Added filter_type attributes to ad4130 driver so it also supports the
standardized ABI for digital filter configuration.
- No longer dropping AD4130 specific filter_type_available options from sysfs-bus-iio.
- Re-add sysfs-bus-iio-adc-ad4130 just mentioning the ABI at sysfs-bus-iio instead
of repeating the doc.
Change log v1 -> v2
- Split into 3 patches.
- Re-added sysfs-bus-iio-adc-ad4130 to keep filter_mode separate from filter_type.
- Removed in_voltage-voltage_filter_mode_available from sysfs-bus-iio.
- Added deprecation notes in sysfs-bus-iio-adc-ad4130 asking to use filter_type
for new drivers and referencing sysfs-bus-iio.
- Improved commit message with explanation about use of filter type attributes.
- Dropped AD4130 specific filter_type_available options from sysfs-bus-iio.
Link to v2: https://lore.kernel.org/linux-iio/cover.1736261047.git.marcelo.schmitt@analog.com/
Link to v1: https://lore.kernel.org/linux-iio/b2132bd3ca1d64cdd8d5afab1f1f33c574718b50.1732901318.git.marcelo.schmitt@analog.com/
Marcelo Schmitt (3):
Documentation: ABI: IIO: Add filter_type documentation
iio: adc: ad4130: Add filter_type attributes
Documentation: ABI: IIO: Re-add sysfs-bus-iio-adc-ad4130
Documentation/ABI/testing/sysfs-bus-iio | 9 ++++++++-
.../ABI/testing/sysfs-bus-iio-adc-ad4130 | 20 +++++++++++++++++++
MAINTAINERS | 1 +
drivers/iio/adc/ad4130.c | 3 +++
4 files changed, 32 insertions(+), 1 deletion(-)
create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
base-commit: 9b75dd1b7d6b98699a104c6b1eec0c8817e5fd4b
--
2.47.2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 1/3] Documentation: ABI: IIO: Add filter_type documentation
2025-02-03 19:10 [PATCH v3 0/3] Re-add filter_type/filter_mode Marcelo Schmitt
@ 2025-02-03 19:11 ` Marcelo Schmitt
2025-02-03 19:39 ` David Lechner
2025-02-03 19:11 ` [PATCH v3 2/3] iio: adc: ad4130: Add filter_type attributes Marcelo Schmitt
2025-02-03 19:11 ` [PATCH v3 3/3] Documentation: ABI: IIO: Re-add sysfs-bus-iio-adc-ad4130 Marcelo Schmitt
2 siblings, 1 reply; 10+ messages in thread
From: Marcelo Schmitt @ 2025-02-03 19:11 UTC (permalink / raw)
To: linux-iio, linux-kernel
Cc: cosmin.tanislav, jic23, lars, marcelo.schmitt, dlechner, granquet,
u.kleine-koenig, marcelo.schmitt1
A previous patch added documentation for filter_type_available attributes.
However, the description for the value attribute (filter_type) was missing.
Add documentation for filter_type sysfs ABI.
Fixes: 01bb12922b60 ("Documentation: ABI: added filter mode doc in sysfs-bus-iio")
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
---
Documentation/ABI/testing/sysfs-bus-iio | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index d97c35057a03..ff9cc09360dc 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -2300,6 +2300,14 @@ Description:
* "sinc3+pf3" - Sinc3 + device specific Post Filter 3.
* "sinc3+pf4" - Sinc3 + device specific Post Filter 4.
+What: /sys/bus/iio/devices/iio:deviceX/filter_type
+What: /sys/bus/iio/devices/iio:deviceX/in_voltageY-voltageZ_filter_type
+KernelVersion: 6.1
+Contact: linux-iio@vger.kernel.org
+Description:
+ Specifies which filter type apply to the channel. The possible
+ values are given by the filter_type_available attribute.
+
What: /sys/.../events/in_proximity_thresh_either_runningperiod
KernelVersion: 6.6
Contact: linux-iio@vger.kernel.org
--
2.47.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 2/3] iio: adc: ad4130: Add filter_type attributes
2025-02-03 19:10 [PATCH v3 0/3] Re-add filter_type/filter_mode Marcelo Schmitt
2025-02-03 19:11 ` [PATCH v3 1/3] Documentation: ABI: IIO: Add filter_type documentation Marcelo Schmitt
@ 2025-02-03 19:11 ` Marcelo Schmitt
2025-02-03 19:40 ` David Lechner
2025-02-03 19:11 ` [PATCH v3 3/3] Documentation: ABI: IIO: Re-add sysfs-bus-iio-adc-ad4130 Marcelo Schmitt
2 siblings, 1 reply; 10+ messages in thread
From: Marcelo Schmitt @ 2025-02-03 19:11 UTC (permalink / raw)
To: linux-iio, linux-kernel
Cc: cosmin.tanislav, jic23, lars, marcelo.schmitt, dlechner, granquet,
u.kleine-koenig, marcelo.schmitt1
Make filter control also available through filter_type attributes which are
now standardized in main IIO ABI documentation.
Suggested-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
---
Hi David, I forgot to ask if you wanted it, but I've added a suggested-by tag
for your advice on v2.
Thanks,
Marcelo
drivers/iio/adc/ad4130.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/iio/adc/ad4130.c b/drivers/iio/adc/ad4130.c
index de32cc9d18c5..66097ff65740 100644
--- a/drivers/iio/adc/ad4130.c
+++ b/drivers/iio/adc/ad4130.c
@@ -942,6 +942,9 @@ static const struct iio_chan_spec_ext_info ad4130_filter_mode_ext_info[] = {
IIO_ENUM("filter_mode", IIO_SEPARATE, &ad4130_filter_mode_enum),
IIO_ENUM_AVAILABLE("filter_mode", IIO_SHARED_BY_TYPE,
&ad4130_filter_mode_enum),
+ IIO_ENUM("filter_type", IIO_SEPARATE, &ad4130_filter_mode_enum),
+ IIO_ENUM_AVAILABLE("filter_type", IIO_SHARED_BY_TYPE,
+ &ad4130_filter_mode_enum),
{ }
};
--
2.47.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 3/3] Documentation: ABI: IIO: Re-add sysfs-bus-iio-adc-ad4130
2025-02-03 19:10 [PATCH v3 0/3] Re-add filter_type/filter_mode Marcelo Schmitt
2025-02-03 19:11 ` [PATCH v3 1/3] Documentation: ABI: IIO: Add filter_type documentation Marcelo Schmitt
2025-02-03 19:11 ` [PATCH v3 2/3] iio: adc: ad4130: Add filter_type attributes Marcelo Schmitt
@ 2025-02-03 19:11 ` Marcelo Schmitt
2025-02-03 19:41 ` David Lechner
2 siblings, 1 reply; 10+ messages in thread
From: Marcelo Schmitt @ 2025-02-03 19:11 UTC (permalink / raw)
To: linux-iio, linux-kernel
Cc: cosmin.tanislav, jic23, lars, marcelo.schmitt, dlechner, granquet,
u.kleine-koenig, marcelo.schmitt1
The ad4130 driver exports in_voltageY-voltageZ_filter_mode and
in_voltage-voltage_filter_mode_available attributes to user space. A
previous patch merged the documentation for those attributes with the
documentation for filter_type/filter_type_available into sysfs-bus-iio.
Filter mode and filter type refer to the same feature which is the digital
filter applied over ADC samples. However, since datasheets use the term
`filter type` and ad4130 driver is the only one using filter_mode,
deprecate the filter_mode ABI in favor of filter_type and keep the docs
separate to avoid confusion and intricate attribute descriptions.
The digital filter helps shape the noise rejection bandwidth and is
supposed to be adjusted according to the signal of interest. Depending on
the particular ADC design, the digital filter configuration may have an
impact on the output data rate (ODR) (which is equivalent to the sampling
frequency for SAR ADCs - `sampling_frequency` ABI), 3dB cutoff frequency of
the filter (`_low_pass_3db_frequency` attributes), or settling time.
Digital filters are a common feature among sigma-delta ADCs and
IIO drivers set digital filters according to different attributes.
ad4130 and ad7779 filter options are supported through dedicated
filter_mode/filter_type attributes in sysfs.
ad7768-1 and ad7173 set the sinc filters according to the
sampling_frequency attribute. No filter_type attribute.
ad7124 sets the digital filter according to a filter_low_pass_3db_frequency
attribute so it doesn't export filter type attributes to user space.
Fixes: 01bb12922b60 ("Documentation: ABI: added filter mode doc in sysfs-bus-iio")
Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
---
Documentation/ABI/testing/sysfs-bus-iio | 1 -
.../ABI/testing/sysfs-bus-iio-adc-ad4130 | 20 +++++++++++++++++++
MAINTAINERS | 1 +
3 files changed, 21 insertions(+), 1 deletion(-)
create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
index ff9cc09360dc..e4fd99c92d81 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -2277,7 +2277,6 @@ Description:
representing the sensor unique ID number.
What: /sys/bus/iio/devices/iio:deviceX/filter_type_available
-What: /sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_mode_available
KernelVersion: 6.1
Contact: linux-iio@vger.kernel.org
Description:
diff --git a/Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130 b/Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
new file mode 100644
index 000000000000..9c0698ad27f9
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
@@ -0,0 +1,20 @@
+What: /sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_mode_available
+KernelVersion: 6.2
+Contact: linux-iio@vger.kernel.org
+Description:
+ Reading returns a list with the possible filter modes.
+
+ This ABI is only kept for backwards compatibility and the values
+ returned are identical to filter_type_available attribute
+ documented in Documentation/ABI/testing/sysfs-bus-iio. Please,
+ use filter_type_available to provide filter options for new
+ drivers.
+
+What: /sys/bus/iio/devices/iio:deviceX/in_voltageY-voltageZ_filter_mode
+KernelVersion: 6.2
+Contact: linux-iio@vger.kernel.org
+Description:
+ This ABI is only kept for backwards compatibility and the values
+ returned are identical to in_voltageY-voltageZ_filter_type
+ attribute documented in Documentation/ABI/testing/sysfs-bus-iio.
+ Please, use in_voltageY-voltageZ_filter_type for new drivers.
diff --git a/MAINTAINERS b/MAINTAINERS
index 98a3c1e46311..28dbbf6d6efa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1279,6 +1279,7 @@ M: Cosmin Tanislav <cosmin.tanislav@analog.com>
L: linux-iio@vger.kernel.org
S: Supported
W: https://ez.analog.com/linux-software-drivers
+F: Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
F: Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml
F: drivers/iio/adc/ad4130.c
--
2.47.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v3 1/3] Documentation: ABI: IIO: Add filter_type documentation
2025-02-03 19:11 ` [PATCH v3 1/3] Documentation: ABI: IIO: Add filter_type documentation Marcelo Schmitt
@ 2025-02-03 19:39 ` David Lechner
0 siblings, 0 replies; 10+ messages in thread
From: David Lechner @ 2025-02-03 19:39 UTC (permalink / raw)
To: Marcelo Schmitt, linux-iio, linux-kernel
Cc: cosmin.tanislav, jic23, lars, granquet, u.kleine-koenig,
marcelo.schmitt1
On 2/3/25 1:11 PM, Marcelo Schmitt wrote:
> A previous patch added documentation for filter_type_available attributes.
> However, the description for the value attribute (filter_type) was missing.
> Add documentation for filter_type sysfs ABI.
>
> Fixes: 01bb12922b60 ("Documentation: ABI: added filter mode doc in sysfs-bus-iio")
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> ---
Reviewed-by: David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/3] iio: adc: ad4130: Add filter_type attributes
2025-02-03 19:11 ` [PATCH v3 2/3] iio: adc: ad4130: Add filter_type attributes Marcelo Schmitt
@ 2025-02-03 19:40 ` David Lechner
2025-02-04 12:54 ` Marcelo Schmitt
0 siblings, 1 reply; 10+ messages in thread
From: David Lechner @ 2025-02-03 19:40 UTC (permalink / raw)
To: Marcelo Schmitt, linux-iio, linux-kernel
Cc: cosmin.tanislav, jic23, lars, granquet, u.kleine-koenig,
marcelo.schmitt1
On 2/3/25 1:11 PM, Marcelo Schmitt wrote:
> Make filter control also available through filter_type attributes which are
> now standardized in main IIO ABI documentation.
>
> Suggested-by: David Lechner <dlechner@baylibre.com>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> ---
> Hi David, I forgot to ask if you wanted it, but I've added a suggested-by tag
> for your advice on v2.
OK with me. :-)
>
> Thanks,
> Marcelo
>
> drivers/iio/adc/ad4130.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/iio/adc/ad4130.c b/drivers/iio/adc/ad4130.c
> index de32cc9d18c5..66097ff65740 100644
> --- a/drivers/iio/adc/ad4130.c
> +++ b/drivers/iio/adc/ad4130.c
> @@ -942,6 +942,9 @@ static const struct iio_chan_spec_ext_info ad4130_filter_mode_ext_info[] = {
I suggest to add a comment here to say that the duplication is intentional and
the filter_mode attributes are for backwards compatibility.
> IIO_ENUM("filter_mode", IIO_SEPARATE, &ad4130_filter_mode_enum),
> IIO_ENUM_AVAILABLE("filter_mode", IIO_SHARED_BY_TYPE,
> &ad4130_filter_mode_enum),
> + IIO_ENUM("filter_type", IIO_SEPARATE, &ad4130_filter_mode_enum),
> + IIO_ENUM_AVAILABLE("filter_type", IIO_SHARED_BY_TYPE,
> + &ad4130_filter_mode_enum),
> { }
> };
>
With that...
Reviewed-by: David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 3/3] Documentation: ABI: IIO: Re-add sysfs-bus-iio-adc-ad4130
2025-02-03 19:11 ` [PATCH v3 3/3] Documentation: ABI: IIO: Re-add sysfs-bus-iio-adc-ad4130 Marcelo Schmitt
@ 2025-02-03 19:41 ` David Lechner
2025-02-04 12:53 ` Marcelo Schmitt
2025-02-04 13:00 ` Marcelo Schmitt
0 siblings, 2 replies; 10+ messages in thread
From: David Lechner @ 2025-02-03 19:41 UTC (permalink / raw)
To: Marcelo Schmitt, linux-iio, linux-kernel
Cc: cosmin.tanislav, jic23, lars, granquet, u.kleine-koenig,
marcelo.schmitt1
On 2/3/25 1:11 PM, Marcelo Schmitt wrote:
> The ad4130 driver exports in_voltageY-voltageZ_filter_mode and
> in_voltage-voltage_filter_mode_available attributes to user space. A
> previous patch merged the documentation for those attributes with the
> documentation for filter_type/filter_type_available into sysfs-bus-iio.
> Filter mode and filter type refer to the same feature which is the digital
> filter applied over ADC samples. However, since datasheets use the term
> `filter type` and ad4130 driver is the only one using filter_mode,
> deprecate the filter_mode ABI in favor of filter_type and keep the docs
> separate to avoid confusion and intricate attribute descriptions.
>
> The digital filter helps shape the noise rejection bandwidth and is
> supposed to be adjusted according to the signal of interest. Depending on
> the particular ADC design, the digital filter configuration may have an
> impact on the output data rate (ODR) (which is equivalent to the sampling
> frequency for SAR ADCs - `sampling_frequency` ABI), 3dB cutoff frequency of
> the filter (`_low_pass_3db_frequency` attributes), or settling time.
>
> Digital filters are a common feature among sigma-delta ADCs and
> IIO drivers set digital filters according to different attributes.
> ad4130 and ad7779 filter options are supported through dedicated
> filter_mode/filter_type attributes in sysfs.
> ad7768-1 and ad7173 set the sinc filters according to the
> sampling_frequency attribute. No filter_type attribute.
> ad7124 sets the digital filter according to a filter_low_pass_3db_frequency
> attribute so it doesn't export filter type attributes to user space.
These last two paragraphs seems a bit excessive and could be dropped.
>
> Fixes: 01bb12922b60 ("Documentation: ABI: added filter mode doc in sysfs-bus-iio")
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> ---
> Documentation/ABI/testing/sysfs-bus-iio | 1 -
> .../ABI/testing/sysfs-bus-iio-adc-ad4130 | 20 +++++++++++++++++++
> MAINTAINERS | 1 +
> 3 files changed, 21 insertions(+), 1 deletion(-)
> create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
>
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index ff9cc09360dc..e4fd99c92d81 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -2277,7 +2277,6 @@ Description:
> representing the sensor unique ID number.
>
> What: /sys/bus/iio/devices/iio:deviceX/filter_type_available
> -What: /sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_mode_available
Instead of removing the line, I think we need to replace it with:
/sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_type_available
(change mode to type)
This attribute is used in the previous patch.
> KernelVersion: 6.1
> Contact: linux-iio@vger.kernel.org
> Description:
With those changes...
Reviewed-by: David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 3/3] Documentation: ABI: IIO: Re-add sysfs-bus-iio-adc-ad4130
2025-02-03 19:41 ` David Lechner
@ 2025-02-04 12:53 ` Marcelo Schmitt
2025-02-04 13:00 ` Marcelo Schmitt
1 sibling, 0 replies; 10+ messages in thread
From: Marcelo Schmitt @ 2025-02-04 12:53 UTC (permalink / raw)
To: David Lechner
Cc: Marcelo Schmitt, linux-iio, linux-kernel, cosmin.tanislav, jic23,
lars, granquet, u.kleine-koenig
On 02/03, David Lechner wrote:
> On 2/3/25 1:11 PM, Marcelo Schmitt wrote:
> > The ad4130 driver exports in_voltageY-voltageZ_filter_mode and
> > in_voltage-voltage_filter_mode_available attributes to user space. A
> > previous patch merged the documentation for those attributes with the
> > documentation for filter_type/filter_type_available into sysfs-bus-iio.
> > Filter mode and filter type refer to the same feature which is the digital
> > filter applied over ADC samples. However, since datasheets use the term
> > `filter type` and ad4130 driver is the only one using filter_mode,
> > deprecate the filter_mode ABI in favor of filter_type and keep the docs
> > separate to avoid confusion and intricate attribute descriptions.
> >
>
>
> > The digital filter helps shape the noise rejection bandwidth and is
> > supposed to be adjusted according to the signal of interest. Depending on
> > the particular ADC design, the digital filter configuration may have an
> > impact on the output data rate (ODR) (which is equivalent to the sampling
> > frequency for SAR ADCs - `sampling_frequency` ABI), 3dB cutoff frequency of
> > the filter (`_low_pass_3db_frequency` attributes), or settling time.
> >
> > Digital filters are a common feature among sigma-delta ADCs and
> > IIO drivers set digital filters according to different attributes.
> > ad4130 and ad7779 filter options are supported through dedicated
> > filter_mode/filter_type attributes in sysfs.
> > ad7768-1 and ad7173 set the sinc filters according to the
> > sampling_frequency attribute. No filter_type attribute.
> > ad7124 sets the digital filter according to a filter_low_pass_3db_frequency
> > attribute so it doesn't export filter type attributes to user space.
>
> These last two paragraphs seems a bit excessive and could be dropped.
Yes, the patch is justified without those paragraphs.
I wanted to understand how digital filtering works and how it was supported
across IIO ADC drivers to implement something reasonable for AD4170.
Those are my conclusions after looking at few ADC drivers.
I thought those could be useful but didn't have a good place to write to.
Oh well, that is not covering all ADCs so also a bit far-fetched to propose it
as some doc. Will drop the extra text on v4.
>
> >
> > Fixes: 01bb12922b60 ("Documentation: ABI: added filter mode doc in sysfs-bus-iio")
> > Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> > ---
> > Documentation/ABI/testing/sysfs-bus-iio | 1 -
> > .../ABI/testing/sysfs-bus-iio-adc-ad4130 | 20 +++++++++++++++++++
> > MAINTAINERS | 1 +
> > 3 files changed, 21 insertions(+), 1 deletion(-)
> > create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
> >
> > diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> > index ff9cc09360dc..e4fd99c92d81 100644
> > --- a/Documentation/ABI/testing/sysfs-bus-iio
> > +++ b/Documentation/ABI/testing/sysfs-bus-iio
> > @@ -2277,7 +2277,6 @@ Description:
> > representing the sensor unique ID number.
> >
> > What: /sys/bus/iio/devices/iio:deviceX/filter_type_available
> > -What: /sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_mode_available
>
> Instead of removing the line, I think we need to replace it with:
>
> /sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_type_available
>
> (change mode to type)
>
> This attribute is used in the previous patch.
>
>
> > KernelVersion: 6.1
> > Contact: linux-iio@vger.kernel.org
> > Description:
> With those changes...
>
> Reviewed-by: David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/3] iio: adc: ad4130: Add filter_type attributes
2025-02-03 19:40 ` David Lechner
@ 2025-02-04 12:54 ` Marcelo Schmitt
0 siblings, 0 replies; 10+ messages in thread
From: Marcelo Schmitt @ 2025-02-04 12:54 UTC (permalink / raw)
To: David Lechner
Cc: Marcelo Schmitt, linux-iio, linux-kernel, cosmin.tanislav, jic23,
lars, granquet, u.kleine-koenig
On 02/03, David Lechner wrote:
> On 2/3/25 1:11 PM, Marcelo Schmitt wrote:
> > Make filter control also available through filter_type attributes which are
> > now standardized in main IIO ABI documentation.
> >
> > Suggested-by: David Lechner <dlechner@baylibre.com>
> > Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> > ---
> > Hi David, I forgot to ask if you wanted it, but I've added a suggested-by tag
> > for your advice on v2.
>
> OK with me. :-)
>
> >
> > Thanks,
> > Marcelo
> >
> > drivers/iio/adc/ad4130.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/iio/adc/ad4130.c b/drivers/iio/adc/ad4130.c
> > index de32cc9d18c5..66097ff65740 100644
> > --- a/drivers/iio/adc/ad4130.c
> > +++ b/drivers/iio/adc/ad4130.c
> > @@ -942,6 +942,9 @@ static const struct iio_chan_spec_ext_info ad4130_filter_mode_ext_info[] = {
>
> I suggest to add a comment here to say that the duplication is intentional and
> the filter_mode attributes are for backwards compatibility.
>
Okay, will do.
> > IIO_ENUM("filter_mode", IIO_SEPARATE, &ad4130_filter_mode_enum),
> > IIO_ENUM_AVAILABLE("filter_mode", IIO_SHARED_BY_TYPE,
> > &ad4130_filter_mode_enum),
> > + IIO_ENUM("filter_type", IIO_SEPARATE, &ad4130_filter_mode_enum),
> > + IIO_ENUM_AVAILABLE("filter_type", IIO_SHARED_BY_TYPE,
> > + &ad4130_filter_mode_enum),
> > { }
> > };
> >
>
> With that...
>
> Reviewed-by: David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 3/3] Documentation: ABI: IIO: Re-add sysfs-bus-iio-adc-ad4130
2025-02-03 19:41 ` David Lechner
2025-02-04 12:53 ` Marcelo Schmitt
@ 2025-02-04 13:00 ` Marcelo Schmitt
1 sibling, 0 replies; 10+ messages in thread
From: Marcelo Schmitt @ 2025-02-04 13:00 UTC (permalink / raw)
To: David Lechner
Cc: Marcelo Schmitt, linux-iio, linux-kernel, cosmin.tanislav, jic23,
lars, granquet, u.kleine-koenig
On 02/03, David Lechner wrote:
> On 2/3/25 1:11 PM, Marcelo Schmitt wrote:
> > The ad4130 driver exports in_voltageY-voltageZ_filter_mode and
> > in_voltage-voltage_filter_mode_available attributes to user space. A
> > previous patch merged the documentation for those attributes with the
> > documentation for filter_type/filter_type_available into sysfs-bus-iio.
> > Filter mode and filter type refer to the same feature which is the digital
> > filter applied over ADC samples. However, since datasheets use the term
> > `filter type` and ad4130 driver is the only one using filter_mode,
> > deprecate the filter_mode ABI in favor of filter_type and keep the docs
> > separate to avoid confusion and intricate attribute descriptions.
> >
>
>
> > The digital filter helps shape the noise rejection bandwidth and is
> > supposed to be adjusted according to the signal of interest. Depending on
> > the particular ADC design, the digital filter configuration may have an
> > impact on the output data rate (ODR) (which is equivalent to the sampling
> > frequency for SAR ADCs - `sampling_frequency` ABI), 3dB cutoff frequency of
> > the filter (`_low_pass_3db_frequency` attributes), or settling time.
> >
> > Digital filters are a common feature among sigma-delta ADCs and
> > IIO drivers set digital filters according to different attributes.
> > ad4130 and ad7779 filter options are supported through dedicated
> > filter_mode/filter_type attributes in sysfs.
> > ad7768-1 and ad7173 set the sinc filters according to the
> > sampling_frequency attribute. No filter_type attribute.
> > ad7124 sets the digital filter according to a filter_low_pass_3db_frequency
> > attribute so it doesn't export filter type attributes to user space.
>
> These last two paragraphs seems a bit excessive and could be dropped.
>
> >
> > Fixes: 01bb12922b60 ("Documentation: ABI: added filter mode doc in sysfs-bus-iio")
> > Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com>
> > ---
> > Documentation/ABI/testing/sysfs-bus-iio | 1 -
> > .../ABI/testing/sysfs-bus-iio-adc-ad4130 | 20 +++++++++++++++++++
> > MAINTAINERS | 1 +
> > 3 files changed, 21 insertions(+), 1 deletion(-)
> > create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
> >
> > diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> > index ff9cc09360dc..e4fd99c92d81 100644
> > --- a/Documentation/ABI/testing/sysfs-bus-iio
> > +++ b/Documentation/ABI/testing/sysfs-bus-iio
> > @@ -2277,7 +2277,6 @@ Description:
> > representing the sensor unique ID number.
> >
> > What: /sys/bus/iio/devices/iio:deviceX/filter_type_available
> > -What: /sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_mode_available
>
> Instead of removing the line, I think we need to replace it with:
>
> /sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_type_available
>
> (change mode to type)
>
> This attribute is used in the previous patch.
Ah yes, good catch.
Will do. And will also reorder the patches so it gets documented before being used.
Thanks,
Marcelo
>
>
> > KernelVersion: 6.1
> > Contact: linux-iio@vger.kernel.org
> > Description:
> With those changes...
>
> Reviewed-by: David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2025-02-04 12:59 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-03 19:10 [PATCH v3 0/3] Re-add filter_type/filter_mode Marcelo Schmitt
2025-02-03 19:11 ` [PATCH v3 1/3] Documentation: ABI: IIO: Add filter_type documentation Marcelo Schmitt
2025-02-03 19:39 ` David Lechner
2025-02-03 19:11 ` [PATCH v3 2/3] iio: adc: ad4130: Add filter_type attributes Marcelo Schmitt
2025-02-03 19:40 ` David Lechner
2025-02-04 12:54 ` Marcelo Schmitt
2025-02-03 19:11 ` [PATCH v3 3/3] Documentation: ABI: IIO: Re-add sysfs-bus-iio-adc-ad4130 Marcelo Schmitt
2025-02-03 19:41 ` David Lechner
2025-02-04 12:53 ` Marcelo Schmitt
2025-02-04 13:00 ` Marcelo Schmitt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox