mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
iio: adc: ade9000: fix overlapping scan_index for current and voltage channels
Current channels used scan_index "num" and voltage "num + 1", so with
phases 0, 1 and 2 the indices overlapped and no longer matched the
IA=0, VA=1, IB=2, VB=3, IC=4, VC=5 layout expected by
ade9000_waveform_buffer_config(). Phase B and C buffers were configured
incorrectly.
Use "num * 2" for current and "num * 2 + 1" for voltage to get the
non-overlapping 0/1, 2/3, 4/5 layout.
Fixes: 81de7b4619 ("iio: adc: add ade9000 support")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
parent
88fda1ed51
commit
d01f63f673
|
|
@ -444,7 +444,7 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = {
|
|||
BIT(IIO_CHAN_INFO_CALIBSCALE), \
|
||||
.event_spec = ade9000_current_events, \
|
||||
.num_event_specs = ARRAY_SIZE(ade9000_current_events), \
|
||||
.scan_index = num, \
|
||||
.scan_index = num * 2, \
|
||||
.indexed = 1, \
|
||||
.scan_type = { \
|
||||
.sign = 's', \
|
||||
|
|
@ -464,7 +464,7 @@ static const struct iio_chan_spec_ext_info ade9000_ext_info[] = {
|
|||
BIT(IIO_CHAN_INFO_FREQUENCY), \
|
||||
.event_spec = ade9000_voltage_events, \
|
||||
.num_event_specs = ARRAY_SIZE(ade9000_voltage_events), \
|
||||
.scan_index = num + 1, /* interleave with current channels */ \
|
||||
.scan_index = num * 2 + 1, /* interleave with current channels */ \
|
||||
.indexed = 1, \
|
||||
.scan_type = { \
|
||||
.sign = 's', \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user