aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu
diff options
context:
space:
mode:
authorPaul Cercueil <paul.cercueil@analog.com>2015-05-15 11:18:35 -0400
committerJonathan Cameron <jic23@kernel.org>2015-05-16 05:57:07 -0400
commit7323d59862802ca109451eeda9777024a7625509 (patch)
tree0d32234b57d546b5e5cd61dcea8144fabd99d684 /drivers/iio/imu
parent69ca2d771e4e709c5ae1125858e1246e77ef8b86 (diff)
iio: adis16400: Use != channel indices for the two voltage channels
Previously, the two voltage channels had the same ID, which didn't cause conflicts in sysfs only because one channel is named and the other isn't; this is still violating the spec though, two indexed channels should never have the same index. Signed-off-by: Paul Cercueil <paul.cercueil@analog.com> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: <stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/imu')
-rw-r--r--drivers/iio/imu/adis16400_core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iio/imu/adis16400_core.c b/drivers/iio/imu/adis16400_core.c
index 8de6427121e2..7b63788c7d1c 100644
--- a/drivers/iio/imu/adis16400_core.c
+++ b/drivers/iio/imu/adis16400_core.c
@@ -459,10 +459,10 @@ static int adis16400_read_raw(struct iio_dev *indio_dev,
459 } 459 }
460} 460}
461 461
462#define ADIS16400_VOLTAGE_CHAN(addr, bits, name, si) { \ 462#define ADIS16400_VOLTAGE_CHAN(addr, bits, name, si, chn) { \
463 .type = IIO_VOLTAGE, \ 463 .type = IIO_VOLTAGE, \
464 .indexed = 1, \ 464 .indexed = 1, \
465 .channel = 0, \ 465 .channel = chn, \
466 .extend_name = name, \ 466 .extend_name = name, \
467 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ 467 .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
468 BIT(IIO_CHAN_INFO_SCALE), \ 468 BIT(IIO_CHAN_INFO_SCALE), \
@@ -479,10 +479,10 @@ static int adis16400_read_raw(struct iio_dev *indio_dev,
479} 479}
480 480
481#define ADIS16400_SUPPLY_CHAN(addr, bits) \ 481#define ADIS16400_SUPPLY_CHAN(addr, bits) \
482 ADIS16400_VOLTAGE_CHAN(addr, bits, "supply", ADIS16400_SCAN_SUPPLY) 482 ADIS16400_VOLTAGE_CHAN(addr, bits, "supply", ADIS16400_SCAN_SUPPLY, 0)
483 483
484#define ADIS16400_AUX_ADC_CHAN(addr, bits) \ 484#define ADIS16400_AUX_ADC_CHAN(addr, bits) \
485 ADIS16400_VOLTAGE_CHAN(addr, bits, NULL, ADIS16400_SCAN_ADC) 485 ADIS16400_VOLTAGE_CHAN(addr, bits, NULL, ADIS16400_SCAN_ADC, 1)
486 486
487#define ADIS16400_GYRO_CHAN(mod, addr, bits) { \ 487#define ADIS16400_GYRO_CHAN(mod, addr, bits) { \
488 .type = IIO_ANGL_VEL, \ 488 .type = IIO_ANGL_VEL, \