Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

David Lechner and committed by
Jonathan Cameron
9415c8b5 15ffee89

+6
+6
drivers/iio/adc/ad4030.c
··· 646 646 &st->rx_data.dual.diff[0], 647 647 &st->rx_data.dual.diff[1]); 648 648 649 + /* 650 + * If no common mode voltage channel is enabled, we can use the raw 651 + * data as is. Otherwise, we need to rearrange the data a bit to match 652 + * the natural alignment of the IIO buffer. 653 + */ 654 + 649 655 if (st->mode != AD4030_OUT_DATA_MD_16_DIFF_8_COM && 650 656 st->mode != AD4030_OUT_DATA_MD_24_DIFF_8_COM) 651 657 return 0;