mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 14:56:54 -04:00
iio: adc: ad4030: explain rearranging raw sample data
Add a comment explaining why the raw sample data is rearranged in the in the ad4030_conversion() function. It is not so obvious from the code why this is done. Signed-off-by: David Lechner <dlechner@baylibre.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Link: https://patch.msgid.link/20250310-iio-adc-ad4030-check-scan-type-err-v1-5-589e4ebd9711@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
15ffee89c7
commit
9415c8b5b9
@@ -646,6 +646,12 @@ static int ad4030_conversion(struct iio_dev *indio_dev)
|
||||
&st->rx_data.dual.diff[0],
|
||||
&st->rx_data.dual.diff[1]);
|
||||
|
||||
/*
|
||||
* If no common mode voltage channel is enabled, we can use the raw
|
||||
* data as is. Otherwise, we need to rearrange the data a bit to match
|
||||
* the natural alignment of the IIO buffer.
|
||||
*/
|
||||
|
||||
if (st->mode != AD4030_OUT_DATA_MD_16_DIFF_8_COM &&
|
||||
st->mode != AD4030_OUT_DATA_MD_24_DIFF_8_COM)
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user