staging:iio:adis16400: Fix ADIS16300 ROLL_OUT register address
Subsystems (4)
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
@@ -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
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
@@ -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
PATCH 4/4 staging:iio:adis16400: Fix ADIS163xx AUX_ADC address
In reply to Lars-Peter ClausenThe 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
@@ -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
@@ -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
PATCH 3/4 staging:iio:adis16400: Fix ADIS16334 temperature address
In reply to Lars-Peter ClausenThe 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
@@ -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
Quoted 4 lines · Lars-Peter Clausen
In the current driver
ROLL_OUTregister address is the same as thePITCH_OUTregister address. This patch fixes it to use the correct address.Signed-off-by Lars-Peter Clausen<[email protected]>
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@@ -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 */
Re: [PATCH 2/4] staging:iio:adis16400: Fix ADIS16300 temperature address
In reply to Lars-Peter ClausenQuoted 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
Signed-off-by Lars-Peter Clausen<[email protected]>
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@@ -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), }, {
Re: [PATCH 3/4] staging:iio:adis16400: Fix ADIS16334 temperature address
In reply to Lars-Peter ClausenQuoted 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
Signed-off-by Lars-Peter Clausen<[email protected]>
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@@ -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 )
Re: [PATCH 4/4] staging:iio:adis16400: Fix ADIS163xx AUX_ADC address
In reply to Lars-Peter ClausenQuoted 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
Signed-off-by Lars-Peter Clausen<[email protected]>
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@@ -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@@ -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), },