Skip to content

Commit bead181

Browse files
spectrum70jic23
authored andcommitted
iio: adc: ad7606: fix wrong scale available
Fix wrong scale available list since only one value is returned: ... iio:device1: ad7606b (buffer capable) 8 channels found: voltage0: (input, index: 0, format: le:S16/16>>0) 2 channel-specific attributes found: attr 0: scale value: 0.305176 attr 1: scale_available value: 0.076293 Fix as: voltage0: (input, index: 0, format: le:S16/16>>0) 2 channel-specific attributes found: attr 0: scale value: 0.305176 attr 1: scale_available value: 0.076293 0.152588 0.305176 Fixes: 97c6d85 ("iio: adc: ad7606: rework scale-available to be static") Signed-off-by: Angelo Dureghello <[email protected]> Link: https://patch.msgid.link/20250129-wip-bl-ad7606_add_backend_sw_mode-v3-3-c3aec77c0ab7@baylibre.com Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 02ccd7e commit bead181

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/ad7606.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ static int ad7606_read_avail(struct iio_dev *indio_dev,
10471047

10481048
cs = &st->chan_scales[ch];
10491049
*vals = (int *)cs->scale_avail;
1050-
*length = cs->num_scales;
1050+
*length = cs->num_scales * 2;
10511051
*type = IIO_VAL_INT_PLUS_MICRO;
10521052

10531053
return IIO_AVAIL_LIST;

0 commit comments

Comments
 (0)