diff options
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/imu/adis16400.h | 4 | ||||
-rw-r--r-- | drivers/iio/imu/adis16400_core.c | 36 |
2 files changed, 40 insertions, 0 deletions
diff --git a/drivers/iio/imu/adis16400.h b/drivers/iio/imu/adis16400.h index 627018537aac..2f8f9d632386 100644 --- a/drivers/iio/imu/adis16400.h +++ b/drivers/iio/imu/adis16400.h | |||
@@ -44,6 +44,9 @@ | |||
44 | #define ADIS16300_ROLL_OUT 0x14 /* Y axis inclinometer output measurement */ | 44 | #define ADIS16300_ROLL_OUT 0x14 /* Y axis inclinometer output measurement */ |
45 | #define ADIS16300_AUX_ADC 0x16 /* Auxiliary ADC measurement */ | 45 | #define ADIS16300_AUX_ADC 0x16 /* Auxiliary ADC measurement */ |
46 | 46 | ||
47 | #define ADIS16448_BARO_OUT 0x16 /* Barometric pressure output */ | ||
48 | #define ADIS16448_TEMP_OUT 0x18 /* Temperature output */ | ||
49 | |||
47 | /* Calibration parameters */ | 50 | /* Calibration parameters */ |
48 | #define ADIS16400_XGYRO_OFF 0x1A /* X-axis gyroscope bias offset factor */ | 51 | #define ADIS16400_XGYRO_OFF 0x1A /* X-axis gyroscope bias offset factor */ |
49 | #define ADIS16400_YGYRO_OFF 0x1C /* Y-axis gyroscope bias offset factor */ | 52 | #define ADIS16400_YGYRO_OFF 0x1C /* Y-axis gyroscope bias offset factor */ |
@@ -179,6 +182,7 @@ enum { | |||
179 | ADIS16400_SCAN_MAGN_X, | 182 | ADIS16400_SCAN_MAGN_X, |
180 | ADIS16400_SCAN_MAGN_Y, | 183 | ADIS16400_SCAN_MAGN_Y, |
181 | ADIS16400_SCAN_MAGN_Z, | 184 | ADIS16400_SCAN_MAGN_Z, |
185 | ADIS16400_SCAN_BARO, | ||
182 | ADIS16350_SCAN_TEMP_X, | 186 | ADIS16350_SCAN_TEMP_X, |
183 | ADIS16350_SCAN_TEMP_Y, | 187 | ADIS16350_SCAN_TEMP_Y, |
184 | ADIS16350_SCAN_TEMP_Z, | 188 | ADIS16350_SCAN_TEMP_Z, |
diff --git a/drivers/iio/imu/adis16400_core.c b/drivers/iio/imu/adis16400_core.c index e8f84c9e84c6..b7f215eab5de 100644 --- a/drivers/iio/imu/adis16400_core.c +++ b/drivers/iio/imu/adis16400_core.c | |||
@@ -139,6 +139,7 @@ enum adis16400_chip_variant { | |||
139 | ADIS16362, | 139 | ADIS16362, |
140 | ADIS16364, | 140 | ADIS16364, |
141 | ADIS16400, | 141 | ADIS16400, |
142 | ADIS16448, | ||
142 | }; | 143 | }; |
143 | 144 | ||
144 | static int adis16334_get_freq(struct adis16400_state *st) | 145 | static int adis16334_get_freq(struct adis16400_state *st) |
@@ -633,6 +634,28 @@ static const struct iio_chan_spec adis16400_channels[] = { | |||
633 | IIO_CHAN_SOFT_TIMESTAMP(12) | 634 | IIO_CHAN_SOFT_TIMESTAMP(12) |
634 | }; | 635 | }; |
635 | 636 | ||
637 | static const struct iio_chan_spec adis16448_channels[] = { | ||
638 | ADIS16400_GYRO_CHAN(X, ADIS16400_XGYRO_OUT, 16), | ||
639 | ADIS16400_GYRO_CHAN(Y, ADIS16400_YGYRO_OUT, 16), | ||
640 | ADIS16400_GYRO_CHAN(Z, ADIS16400_ZGYRO_OUT, 16), | ||
641 | ADIS16400_ACCEL_CHAN(X, ADIS16400_XACCL_OUT, 16), | ||
642 | ADIS16400_ACCEL_CHAN(Y, ADIS16400_YACCL_OUT, 16), | ||
643 | ADIS16400_ACCEL_CHAN(Z, ADIS16400_ZACCL_OUT, 16), | ||
644 | ADIS16400_MAGN_CHAN(X, ADIS16400_XMAGN_OUT, 16), | ||
645 | ADIS16400_MAGN_CHAN(Y, ADIS16400_YMAGN_OUT, 16), | ||
646 | ADIS16400_MAGN_CHAN(Z, ADIS16400_ZMAGN_OUT, 16), | ||
647 | { | ||
648 | .type = IIO_PRESSURE, | ||
649 | .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | | ||
650 | IIO_CHAN_INFO_SCALE_SHARED_BIT, | ||
651 | .address = ADIS16448_BARO_OUT, | ||
652 | .scan_index = ADIS16400_SCAN_BARO, | ||
653 | .scan_type = IIO_ST('s', 16, 16, 0), | ||
654 | }, | ||
655 | ADIS16400_TEMP_CHAN(ADIS16448_TEMP_OUT, 12), | ||
656 | IIO_CHAN_SOFT_TIMESTAMP(11) | ||
657 | }; | ||
658 | |||
636 | static const struct iio_chan_spec adis16350_channels[] = { | 659 | static const struct iio_chan_spec adis16350_channels[] = { |
637 | ADIS16400_SUPPLY_CHAN(ADIS16400_SUPPLY_OUT, 12), | 660 | ADIS16400_SUPPLY_CHAN(ADIS16400_SUPPLY_OUT, 12), |
638 | ADIS16400_GYRO_CHAN(X, ADIS16400_XGYRO_OUT, 14), | 661 | ADIS16400_GYRO_CHAN(X, ADIS16400_XGYRO_OUT, 14), |
@@ -765,6 +788,18 @@ static struct adis16400_chip_info adis16400_chips[] = { | |||
765 | .temp_offset = 25000000 / 140000, /* 25 C = 0x00 */ | 788 | .temp_offset = 25000000 / 140000, /* 25 C = 0x00 */ |
766 | .set_freq = adis16400_set_freq, | 789 | .set_freq = adis16400_set_freq, |
767 | .get_freq = adis16400_get_freq, | 790 | .get_freq = adis16400_get_freq, |
791 | }, | ||
792 | [ADIS16448] = { | ||
793 | .channels = adis16448_channels, | ||
794 | .num_channels = ARRAY_SIZE(adis16448_channels), | ||
795 | .flags = ADIS16400_HAS_PROD_ID | | ||
796 | ADIS16400_HAS_SERIAL_NUMBER, | ||
797 | .gyro_scale_micro = IIO_DEGREE_TO_RAD(10000), /* 0.01 deg/s */ | ||
798 | .accel_scale_micro = IIO_G_TO_M_S_2(833), /* 1/1200 g */ | ||
799 | .temp_scale_nano = 73860000, /* 0.07386 C */ | ||
800 | .temp_offset = 31000000 / 73860, /* 31 C = 0x00 */ | ||
801 | .set_freq = adis16334_set_freq, | ||
802 | .get_freq = adis16334_get_freq, | ||
768 | } | 803 | } |
769 | }; | 804 | }; |
770 | 805 | ||
@@ -909,6 +944,7 @@ static const struct spi_device_id adis16400_id[] = { | |||
909 | {"adis16365", ADIS16360}, | 944 | {"adis16365", ADIS16360}, |
910 | {"adis16400", ADIS16400}, | 945 | {"adis16400", ADIS16400}, |
911 | {"adis16405", ADIS16400}, | 946 | {"adis16405", ADIS16400}, |
947 | {"adis16448", ADIS16448}, | ||
912 | {} | 948 | {} |
913 | }; | 949 | }; |
914 | MODULE_DEVICE_TABLE(spi, adis16400_id); | 950 | MODULE_DEVICE_TABLE(spi, adis16400_id); |