drivers: iio: filter: admv8818: add bypass mode
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 31 Jul 2023 08:49:26 +0000 (11:49 +0300)
committerJonathan Cameron <jonathan.cameron@huawei.com>
Tue, 8 Aug 2023 08:51:06 +0000 (09:51 +0100)
commit1ed8775496c2f9a7153abbdca0818640eb4ebdc3
tree64a06c351278e16257f77043a5de6147dec04d3e
parentfdb48f9d1a6ae5d17719ed8bfe836dfd473996d2
drivers: iio: filter: admv8818: add bypass mode

Add filter bypass mode, which bypasses the low pass filter, high pass
filter and disables/unregister the clock rate notifier.

Currently a feature like bypassing the filter is not achievable
straightforward and not very deductive. The user has to look through the
code and call the set_lpf_3db_frequency and set_hpf_3db_frequency iio
attributes from the user interface using the corner cases (freq >
largest lpf supported by the part, respectively freq < smallest hpf
supported by the part). Moreover, in such case of bypassing the filter,
the input clock rate change might mess up things so we want to make sure
that it is disabled. Also, the feature will help emphasizing the filter
behavior, therefore adding it in the userspace will ease the
charcaterization of the filter's effects when active/disabled.

It was requested by users of the driver to ease the interaction with
different configuration modes of the device.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20230731084928.8302-1-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/filter/admv8818.c