Commit dddfd0c4 authored by Trevor Gamblin's avatar Trevor Gamblin Committed by Jonathan Cameron
Browse files

iio: adc: ad4695: fix buffered read, single sample timings



Modify ad4695_buffer_preenable() by adding an extra SPI transfer after
each data read to help ensure that the timing requirement between the
last SCLK rising edge and the next CNV rising edge is met. This requires
a restructure of the buf_read_xfer array in ad4695_state. Also define
AD4695_T_SCK_CNV_DELAY_NS to use for each added transfer. Without this
change it is possible for the data to become corrupted on sequential
buffered reads due to the device not properly exiting conversion mode.

Similarly, make adjustments to ad4695_read_one_sample() so that timings
are respected, and clean up the function slightly in the process.

Fixes: 6cc7e4bf ("iio: adc: ad4695: implement triggered buffer")
Co-developed-by: default avatarDavid Lechner <dlechner@baylibre.com>
Signed-off-by: default avatarDavid Lechner <dlechner@baylibre.com>
Signed-off-by: default avatarTrevor Gamblin <tgamblin@baylibre.com>
Reviewed-by: default avatarDavid Lechner <dlechner@baylibre.com>
Tested-by: default avatarDavid Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20241113-tgamblin-ad4695_improvements-v2-1-b6bb7c758fc4@baylibre.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 65a60a59
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment