]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: ad4695: make ad4695_exit_conversion_mode() more robust
authorTrevor Gamblin <tgamblin@baylibre.com>
Wed, 13 Nov 2024 20:52:59 +0000 (15:52 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 3 Feb 2025 19:15:38 +0000 (19:15 +0000)
commit998d20e4e99d909f14d96fdf0bdcf860f7efe3ef
treeef3c63612813d9cc7b5fae0631106594e3f98334
parent7ecbbb5bb8fbec0697142acaf756a5f0e046046b
iio: adc: ad4695: make ad4695_exit_conversion_mode() more robust

Ensure that conversion mode is successfully exited when the command is
issued by adding an extra transfer beforehand, matching the minimum CNV
high and low times from the AD4695 datasheet. The AD4695 has a quirk
where the exit command only works during a conversion, so guarantee this
happens by triggering a conversion in ad4695_exit_conversion_mode().
Then make this even more robust by ensuring that the exit command is run
at AD4695_REG_ACCESS_SCLK_HZ rather than the bus maximum.

Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Tested-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241113-tgamblin-ad4695_improvements-v2-2-b6bb7c758fc4@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad4695.c