mbox series

[v2,0/3] Re-add filter_type/filter_mode

Message ID cover.1736261047.git.marcelo.schmitt@analog.com (mailing list archive)
Headers show
Series Re-add filter_type/filter_mode | expand

Message

Marcelo Schmitt Jan. 7, 2025, 3:11 p.m. UTC
Better document sysfs ABI for ADC digital filter configuration.

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 v1: https://lore.kernel.org/linux-iio/b2132bd3ca1d64cdd8d5afab1f1f33c574718b50.1732901318.git.marcelo.schmitt@analog.com/

Additional specific comments in patches 1 and 3.

Marcelo Schmitt (3):
  Documentation: ABI: IIO: Re-add sysfs-bus-iio-adc-ad4130
  Documentation: ABI: IIO: Add filter_type documentation
  Documentation: ABI: IIO: Drop AD4130 specific filter_type_available
    options

 Documentation/ABI/testing/sysfs-bus-iio       | 29 ++++------
 .../ABI/testing/sysfs-bus-iio-adc-ad4130      | 55 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 3 files changed, 68 insertions(+), 17 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130


base-commit: 9b75dd1b7d6b98699a104c6b1eec0c8817e5fd4b

Comments

David Lechner Jan. 7, 2025, 4:32 p.m. UTC | #1
On 1/7/25 9:11 AM, Marcelo Schmitt wrote:
> Better document sysfs ABI for ADC digital filter configuration.
> 
> Change log v1 -> v2
> - Split into 3 patches.
> - Re-added sysfs-bus-iio-adc-ad4130 to keep filter_mode separate from filter_type.

If ad7779 is the only driver with filter_type{,available} attributes while
ad4130 and admv8818 both have filter_mode{,available} attributes, shouldn't we
be deprecating filter_type and promoting filter_mode?

(Looks like I might have got that backwards in my previous reply. :-/)
Marcelo Schmitt Jan. 7, 2025, 5:44 p.m. UTC | #2
On 01/07, David Lechner wrote:
> On 1/7/25 9:11 AM, Marcelo Schmitt wrote:
> > Better document sysfs ABI for ADC digital filter configuration.
> > 
> > Change log v1 -> v2
> > - Split into 3 patches.
> > - Re-added sysfs-bus-iio-adc-ad4130 to keep filter_mode separate from filter_type.
> 
> If ad7779 is the only driver with filter_type{,available} attributes while
> ad4130 and admv8818 both have filter_mode{,available} attributes, shouldn't we
> be deprecating filter_type and promoting filter_mode?

Oh, I had only grepped the adc dir and I didn't noticed admv8818 also had
filter_mode.
Hmm, don't know, though still biased towards filter_type.

- The admv8818 filter_mode_available ABI exports different values (auto,
  manual, bypass).
- AD7768-1, ADAQ7768-1, AD7768/AD7768-4, AD7124-4, and AD4170 datasheets
  refer to sinc filters as filter types (though not all of those designs are
  supported in IIO or have filter attributes).
- The AD4130 datasheets also refers to the digital filter as filter type in
  some occasions.

But some datasheets seem to use filter mode and filter type interchangeably
so I don't know. The admv8818 use case is valid and is both low and high-pass
filtering while the ADCs sinc digital filters act like low-pass filter.
Maybe even provide a different name for ADC digital filtering?
digital_filter_type (or digital_filter_mode)?.

Thanks for pointing that out.
David Lechner Jan. 7, 2025, 5:48 p.m. UTC | #3
On 1/7/25 11:44 AM, Marcelo Schmitt wrote:
> On 01/07, David Lechner wrote:
>> On 1/7/25 9:11 AM, Marcelo Schmitt wrote:
>>> Better document sysfs ABI for ADC digital filter configuration.
>>>
>>> Change log v1 -> v2
>>> - Split into 3 patches.
>>> - Re-added sysfs-bus-iio-adc-ad4130 to keep filter_mode separate from filter_type.
>>
>> If ad7779 is the only driver with filter_type{,available} attributes while
>> ad4130 and admv8818 both have filter_mode{,available} attributes, shouldn't we
>> be deprecating filter_type and promoting filter_mode?
> 
> Oh, I had only grepped the adc dir and I didn't noticed admv8818 also had
> filter_mode.
> Hmm, don't know, though still biased towards filter_type.
> 
> - The admv8818 filter_mode_available ABI exports different values (auto,
>   manual, bypass).

Ah, I didn't look that far, so yes, I agree this is a good reason to standardize
on filter_type instead.

> - AD7768-1, ADAQ7768-1, AD7768/AD7768-4, AD7124-4, and AD4170 datasheets
>   refer to sinc filters as filter types (though not all of those designs are
>   supported in IIO or have filter attributes).
> - The AD4130 datasheets also refers to the digital filter as filter type in
>   some occasions.
> 
> But some datasheets seem to use filter mode and filter type interchangeably
> so I don't know. The admv8818 use case is valid and is both low and high-pass
> filtering while the ADCs sinc digital filters act like low-pass filter.
> Maybe even provide a different name for ADC digital filtering?
> digital_filter_type (or digital_filter_mode)?.
> 
> Thanks for pointing that out.