iio: adc: ad7173: fix setting ODR in probe
authorDavid Lechner <dlechner@baylibre.com>
Thu, 10 Jul 2025 20:43:40 +0000 (15:43 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 16 Jul 2025 07:47:50 +0000 (08:47 +0100)
commit6fa908abd19cc35c205f343b79c67ff38dbc9b76
tree049c05bc7438924759c2447a8afa34f59ec315e0
parent1d9a21ffb43b6fd326ead98f0d0afd6d104b739a
iio: adc: ad7173: fix setting ODR in probe

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>
drivers/iio/adc/ad7173.c