Skip to content

Commit b1f8a16

Browse files
machschmittcseci
authored andcommitted
iio: adc: ad4630: Set proper data width for AD4630/AD4632-20
Using a larger data width made SPI transfers run 4 additional bits which caused the capture data to be shifted by 4 bits. Use the correct data width for 20-bit precision ADCs, making SPI transfers run 20 SCLK pulses per transfer which in turn will make the controller gather only the expected data bits to the sample buffer. Fixes: 299dc60 ("iio: adc: ad4630: Add support for AD4630-20 and AD4632-20") Signed-off-by: Marcelo Schmitt <marcelo.schmitt@analog.com> (cherry picked from commit dfb6a9f)
1 parent 6a60d7c commit b1f8a16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/ad4630.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ static const struct ad4630_out_mode ad4630_20_modes[] = {
856856
AD4630_CHAN(0, AD4630_CHAN_INFO_NONE, 32, 20, 0, AD4630_CHAN_INFO_NONE),
857857
AD4630_CHAN(1, AD4630_CHAN_INFO_NONE, 32, 20, 0, AD4630_CHAN_INFO_NONE),
858858
},
859-
.data_width = 24,
859+
.data_width = 20,
860860
},
861861
[AD4630_16_DIFF_8_COM] = {
862862
.channels = {

0 commit comments

Comments
 (0)