Skip to contentSkip to conversation

staging:iio:adis16400: Fix ADIS16300 ROLL_OUT register address

PATCH In review Lars-Peter Clausen 2 participants 8 messages Jun 15, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 staging:iio:adis16400: Fix ADIS16300 ROLL_OUT register address

In the current driver ROLL_OUT register address is the same as the PITCH_OUT register address. This patch fixes it to use the correct address.

---
 drivers/staging/iio/imu/adis16400.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/imu/adis16400.h +1 -1
index 83d133e..1f4e987 100644
@@ -42,7 +42,7 @@
 #define ADIS16350_ZTEMP_OUT 0x14 /* Z-axis gyroscope temperature measurement */
 
 #define ADIS16300_PITCH_OUT 0x12 /* X axis inclinometer output measurement */
-#define ADIS16300_ROLL_OUT  0x12 /* Y axis inclinometer output measurement */
+#define ADIS16300_ROLL_OUT  0x14 /* Y axis inclinometer output measurement */
 
 /* Calibration parameters */
 #define ADIS16400_XGYRO_OFF 0x1A /* X-axis gyroscope bias offset factor */
Signature · 1 line
1.7.10
#1 lore raw

PATCH 2/4 staging:iio:adis16400: Fix ADIS16300 temperature address

The ADIS16300 uses the same address for the temperature register as the ADIS16350 and not the ADIS16400.

---
 drivers/staging/iio/imu/adis16400_core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/imu/adis16400_core.c +1 -1
index 1f6bd85..1c9931e 100644
@@ -946,7 +946,7 @@ static struct iio_chan_spec adis16300_channels[] = {
 		.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
 		IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
 		IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
-		.address = temp,
+		.address = temp0,
 		.scan_index = ADIS16400_SCAN_TEMP,
 		.scan_type = IIO_ST('s', 12, 16, 0),
 	}, {
Signature · 1 line
1.7.10
Acked-by on v1 2/4
#2 lore raw

Re: [PATCH 2/4] staging:iio:adis16400: Fix ADIS16300 temperature address

Quoted 2 lines · Lars-Peter Clausen

The ADIS16300 uses the same address for the temperature register as the ADIS16350 and not the ADIS16400.

oops.

Quoted 2 lines
Quoted 17 lines
---
  drivers/staging/iio/imu/adis16400_core.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/imu/adis16400_core.c +1 -1
index 1f6bd85..1c9931e 100644
@@ -946,7 +946,7 @@ static struct iio_chan_spec adis16300_channels[] = {
  		.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
  		IIO_CHAN_INFO_OFFSET_SEPARATE_BIT |
  		IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
-		.address = temp,
+		.address = temp0,
  		.scan_index = ADIS16400_SCAN_TEMP,
  		.scan_type = IIO_ST('s', 12, 16, 0),
  	}, {
#3 lore raw

PATCH 3/4 staging:iio:adis16400: Fix ADIS16334 temperature address

In reply to Lars-Peter Clausen

The channel spec for ADUS16334's temperature channel uses the address and scan index for the Z-axis acceleration channel. This patch fixes it to use the temperature channel address and scan index instead.

---
 drivers/staging/iio/imu/adis16400_core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/iio/imu/adis16400_core.c +2 -2
index 1c9931e..7aa3a9a 100644
@@ -1054,8 +1054,8 @@ static const struct iio_chan_spec adis16334_channels[] = {
 		.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
 		IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
 		IIO_CHAN_INFO_SCALE_SHARED_BIT,
-		.address = accel_z,
-		.scan_index = ADIS16400_SCAN_ACC_Z,
+		.address = temp0,
+		.scan_index = ADIS16400_SCAN_TEMP,
 		.scan_type = IIO_ST('s', 14, 16, 0),
 	},
 	IIO_CHAN_SOFT_TIMESTAMP(12)
Signature · 1 line
1.7.10
Acked-by on v1 3/4
#4 lore raw

Re: [PATCH 3/4] staging:iio:adis16400: Fix ADIS16334 temperature address

Quoted 4 lines · Lars-Peter Clausen

The channel spec for ADUS16334's temperature channel uses the address and scan index for the Z-axis acceleration channel. This patch fixes it to use the temperature channel address and scan index instead.

doh, that one is particularly bad (and obvious!) Thanks,

Quoted 1 line
Quoted 19 lines
---
  drivers/staging/iio/imu/adis16400_core.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/iio/imu/adis16400_core.c +2 -2
index 1c9931e..7aa3a9a 100644
@@ -1054,8 +1054,8 @@ static const struct iio_chan_spec adis16334_channels[] = {
  		.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
  		IIO_CHAN_INFO_CALIBBIAS_SEPARATE_BIT |
  		IIO_CHAN_INFO_SCALE_SHARED_BIT,
-		.address = accel_z,
-		.scan_index = ADIS16400_SCAN_ACC_Z,
+		.address = temp0,
+		.scan_index = ADIS16400_SCAN_TEMP,
  		.scan_type = IIO_ST('s', 14, 16, 0),
  	},
  	IIO_CHAN_SOFT_TIMESTAMP(12)
#5 lore raw

PATCH 4/4 staging:iio:adis16400: Fix ADIS163xx AUX_ADC address

In reply to Lars-Peter Clausen

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.

---
 drivers/staging/iio/imu/adis16400.h      |    1 +
 drivers/staging/iio/imu/adis16400_core.c |    8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/staging/iio/imu/adis16400.h +1 -0
index 1f4e987..9dd9f14 100644
@@ -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 */
drivers/staging/iio/imu/adis16400_core.c +5 -3
index 7aa3a9a..3873014 100644
@@ -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),
 	},
Signature · 1 line
1.7.10
Acked-by on v1 4/4
#6 lore raw

Re: [PATCH 4/4] staging:iio:adis16400: Fix ADIS163xx AUX_ADC address

Quoted 2 lines · Lars-Peter Clausen

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.

Ah well, guess I never bothered testing that channel with an actual voltage.. oops.

Quoted 2 lines
Quoted 54 lines
---
  drivers/staging/iio/imu/adis16400.h      |    1 +
  drivers/staging/iio/imu/adis16400_core.c |    8 +++++---
  2 files changed, 6 insertions(+), 3 deletions(-)
drivers/staging/iio/imu/adis16400.h +1 -0
index 1f4e987..9dd9f14 100644
@@ -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 */
drivers/staging/iio/imu/adis16400_core.c +5 -3
index 7aa3a9a..3873014 100644
@@ -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),
  	},
Acked-by on v1 1/4
#7 lore raw
In reply to Lars-Peter Clausen
Quoted 4 lines · Lars-Peter Clausen

In the current driver ROLL_OUT register address is the same as the PITCH_OUT register address. This patch fixes it to use the correct address.

Quoted 17 lines
---
  drivers/staging/iio/imu/adis16400.h |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/imu/adis16400.h +1 -1
index 83d133e..1f4e987 100644
@@ -42,7 +42,7 @@
  #define ADIS16350_ZTEMP_OUT 0x14 /* Z-axis gyroscope temperature measurement */
 
  #define ADIS16300_PITCH_OUT 0x12 /* X axis inclinometer output measurement */
-#define ADIS16300_ROLL_OUT  0x12 /* Y axis inclinometer output measurement */
+#define ADIS16300_ROLL_OUT  0x14 /* Y axis inclinometer output measurement */
 
  /* Calibration parameters */
  #define ADIS16400_XGYRO_OFF 0x1A /* X-axis gyroscope bias offset factor */