]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: adc: ad7173: fix setting ODR in probe
authorDavid Lechner <dlechner@baylibre.com>
Thu, 10 Jul 2025 20:43:40 +0000 (15:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:34:20 +0000 (16:34 +0200)
commitfb67be2b6864f7dae754582533d91725339d6154
treef51ad5f25349fb74c63d9274a922dcd5f0963705
parent5c6c645d991605cbac2cd4832ef3582ef010c85c
iio: adc: ad7173: fix setting ODR in probe

commit 6fa908abd19cc35c205f343b79c67ff38dbc9b76 upstream.

Fix the setting of the ODR register value in the probe function for
AD7177. The AD7177 chip has a different ODR value after reset than the
other chips (0x7 vs. 0x0) and 0 is a reserved value on that chip.

The driver already has this information available in odr_start_value
and uses it when checking valid values when writing to the
sampling_frequency attribute, but failed to set the correct initial
value in the probe function.

Fixes: 37ae8381ccda ("iio: adc: ad7173: add support for additional models")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250710-iio-adc-ad7173-fix-setting-odr-in-probe-v1-1-78a100fec998@baylibre.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/ad7173.c