summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-06-15 20:11:52 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-16 01:36:25 +0400
commit07a8329c48b699a85086756eaa1a658540d02ac4 (patch)
treed2f58f291f8f8485b2e484171ef7e4fd7764580f
parentbb7cf8bc52ff388c89f5984e428e966e326315ad (diff)
downloadlinux-07a8329c48b699a85086756eaa1a658540d02ac4.tar.xz
staging:iio:adis16400: Fix ADIS163xx AUX_ADC address
The ADIS163xx variants use a different register address for the auxiliary ADC channel than the ADIS16400. This patch fixes them to use the correct address. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/iio/imu/adis16400.h1
-rw-r--r--drivers/staging/iio/imu/adis16400_core.c8
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/iio/imu/adis16400.h b/drivers/staging/iio/imu/adis16400.h
index 1f4e98783ef5..9dd9f1459a4d 100644
--- a/drivers/staging/iio/imu/adis16400.h
+++ b/drivers/staging/iio/imu/adis16400.h
@@ -43,6 +43,7 @@
#define ADIS16300_PITCH_OUT 0x12 /* X axis inclinometer output measurement */
#define ADIS16300_ROLL_OUT 0x14 /* Y axis inclinometer output measurement */
+#define ADIS16300_AUX_ADC 0x16 /* Auxiliary ADC measurement */
/* Calibration parameters */
#define ADIS16400_XGYRO_OFF 0x1A /* X-axis gyroscope bias offset factor */
diff --git a/drivers/staging/iio/imu/adis16400_core.c b/drivers/staging/iio/imu/adis16400_core.c
index 7aa3a9aa55e4..387301437cf5 100644
--- a/drivers/staging/iio/imu/adis16400_core.c
+++ b/drivers/staging/iio/imu/adis16400_core.c
@@ -472,11 +472,12 @@ enum adis16400_chan {
temp,
temp0, temp1, temp2,
in1,
+ in2,
incli_x,
incli_y,
};
-static u8 adis16400_addresses[17][2] = {
+static u8 adis16400_addresses[18][2] = {
[in_supply] = { ADIS16400_SUPPLY_OUT },
[gyro_x] = { ADIS16400_XGYRO_OUT, ADIS16400_XGYRO_OFF },
[gyro_y] = { ADIS16400_YGYRO_OUT, ADIS16400_YGYRO_OFF },
@@ -491,7 +492,8 @@ static u8 adis16400_addresses[17][2] = {
[temp0] = { ADIS16350_XTEMP_OUT },
[temp1] = { ADIS16350_YTEMP_OUT },
[temp2] = { ADIS16350_ZTEMP_OUT },
- [in1] = { ADIS16400_AUX_ADC },
+ [in1] = { ADIS16300_AUX_ADC },
+ [in2] = { ADIS16400_AUX_ADC },
[incli_x] = { ADIS16300_PITCH_OUT },
[incli_y] = { ADIS16300_ROLL_OUT }
};
@@ -752,7 +754,7 @@ static struct iio_chan_spec adis16400_channels[] = {
.channel = 1,
.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
- .address = in1,
+ .address = in2,
.scan_index = ADIS16400_SCAN_ADC_0,
.scan_type = IIO_ST('s', 12, 16, 0),
},