Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: imu: st_lsm6dsx: add support to ASM330LHHX

Add support to STM ASM330LHHX (acc + gyro) automotive Mems sensor.
The ASM330LHHX sensor can use LSM6DSR as fallback device since it
implements all the ASM330LHHX features currently implemented in
st_lsm6dsx.

Datasheet: https://www.st.com/resource/en/datasheet/asm330lhhx.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/04e2644772a6761a25c36bb9679979567fdebda3.1649100168.git.lorenzo@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Lorenzo Bianconi and committed by
Jonathan Cameron
fdd70d7a 3289237d

+22 -5
+3 -3
drivers/iio/imu/st_lsm6dsx/Kconfig
··· 11 11 help 12 12 Say yes here to build support for STMicroelectronics LSM6DSx imu 13 13 sensor. Supported devices: lsm6ds3, lsm6ds3h, lsm6dsl, lsm6dsm, 14 - ism330dlc, lsm6dso, lsm6dsox, asm330lhh, lsm6dsr, lsm6ds3tr-c, 15 - ism330dhcx, lsm6dsrx, lsm6ds0, lsm6dsop, the accelerometer/gyroscope 16 - of lsm9ds1 and lsm6dst. 14 + ism330dlc, lsm6dso, lsm6dsox, asm330lhh, asm330lhhx, lsm6dsr, 15 + lsm6ds3tr-c, ism330dhcx, lsm6dsrx, lsm6ds0, lsm6dsop, 16 + the accelerometer/gyroscope of lsm9ds1 and lsm6dst. 17 17 18 18 To compile this driver as a module, choose M here: the module 19 19 will be called st_lsm6dsx.
+2
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
··· 31 31 #define ST_LSM6DSRX_DEV_NAME "lsm6dsrx" 32 32 #define ST_LSM6DST_DEV_NAME "lsm6dst" 33 33 #define ST_LSM6DSOP_DEV_NAME "lsm6dsop" 34 + #define ST_ASM330LHHX_DEV_NAME "asm330lhhx" 34 35 35 36 enum st_lsm6dsx_hw_id { 36 37 ST_LSM6DS3_ID, ··· 50 49 ST_LSM6DSRX_ID, 51 50 ST_LSM6DST_ID, 52 51 ST_LSM6DSOP_ID, 52 + ST_ASM330LHHX_ID, 53 53 ST_LSM6DSX_MAX_ID, 54 54 }; 55 55
+2 -1
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
··· 14 14 * (e.g. Gx, Gy, Gz, Ax, Ay, Az), then data are repeated depending on the 15 15 * value of the decimation factor and ODR set for each FIFO data set. 16 16 * 17 - * LSM6DSO/LSM6DSOX/ASM330LHH/LSM6DSR/LSM6DSRX/ISM330DHCX/LSM6DST/LSM6DSOP: 17 + * LSM6DSO/LSM6DSOX/ASM330LHH/ASM330LHHX/LSM6DSR/LSM6DSRX/ISM330DHCX/ 18 + * LSM6DST/LSM6DSOP: 18 19 * The FIFO buffer can be configured to store data from gyroscope and 19 20 * accelerometer. Each sample is queued with a tag (1B) indicating data 20 21 * source (gyroscope, accelerometer, hw timer).
+5 -1
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
··· 26 26 * - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000 27 27 * - FIFO size: 4KB 28 28 * 29 - * - LSM6DSO/LSM6DSOX/ASM330LHH/LSM6DSR/ISM330DHCX/LSM6DST/LSM6DSOP: 29 + * - LSM6DSO/LSM6DSOX/ASM330LHH/ASM330LHHX/LSM6DSR/ISM330DHCX/LSM6DST/LSM6DSOP: 30 30 * - Accelerometer/Gyroscope supported ODR [Hz]: 12.5, 26, 52, 104, 208, 416, 31 31 * 833 32 32 * - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16 ··· 786 786 .hw_id = ST_LSM6DST_ID, 787 787 .name = ST_LSM6DST_DEV_NAME, 788 788 .wai = 0x6d, 789 + }, { 790 + .hw_id = ST_ASM330LHHX_ID, 791 + .name = ST_ASM330LHHX_DEV_NAME, 792 + .wai = 0x6b, 789 793 }, 790 794 }, 791 795 .channels = {
+5
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
··· 101 101 .compatible = "st,lsm6dsop", 102 102 .data = (void *)ST_LSM6DSOP_ID, 103 103 }, 104 + { 105 + .compatible = "st,asm330lhhx", 106 + .data = (void *)ST_ASM330LHHX_ID, 107 + }, 104 108 {}, 105 109 }; 106 110 MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match); ··· 126 122 { ST_LSM6DSRX_DEV_NAME, ST_LSM6DSRX_ID }, 127 123 { ST_LSM6DST_DEV_NAME, ST_LSM6DST_ID }, 128 124 { ST_LSM6DSOP_DEV_NAME, ST_LSM6DSOP_ID }, 125 + { ST_ASM330LHHX_DEV_NAME, ST_ASM330LHHX_ID }, 129 126 {}, 130 127 }; 131 128 MODULE_DEVICE_TABLE(i2c, st_lsm6dsx_i2c_id_table);
+5
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
··· 101 101 .compatible = "st,lsm6dsop", 102 102 .data = (void *)ST_LSM6DSOP_ID, 103 103 }, 104 + { 105 + .compatible = "st,asm330lhhx", 106 + .data = (void *)ST_ASM330LHHX_ID, 107 + }, 104 108 {}, 105 109 }; 106 110 MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match); ··· 126 122 { ST_LSM6DSRX_DEV_NAME, ST_LSM6DSRX_ID }, 127 123 { ST_LSM6DST_DEV_NAME, ST_LSM6DST_ID }, 128 124 { ST_LSM6DSOP_DEV_NAME, ST_LSM6DSOP_ID }, 125 + { ST_ASM330LHHX_DEV_NAME, ST_ASM330LHHX_ID }, 129 126 {}, 130 127 }; 131 128 MODULE_DEVICE_TABLE(spi, st_lsm6dsx_spi_id_table);