diff options
author | Lorenzo Bianconi | 2019-02-21 16:20:20 +0100 |
---|---|---|
committer | Jonathan Cameron | 2019-04-04 21:19:49 +0200 |
commit | 3054c4ff28bfdb37fdb5dc077ee611bfa5547e99 (patch) | |
tree | 20667908a2e2465cb46db8b3cb6d300ba48e8d80 /drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | |
parent | iio: ak8975: improve code readability (diff) | |
download | kernel-qcow2-linux-3054c4ff28bfdb37fdb5dc077ee611bfa5547e99.tar.gz kernel-qcow2-linux-3054c4ff28bfdb37fdb5dc077ee611bfa5547e99.tar.xz kernel-qcow2-linux-3054c4ff28bfdb37fdb5dc077ee611bfa5547e99.zip |
iio: imu: st_lsm6dsx: add support to ASM330LHH
Add support to STM ASM330LHH 6-axis (acc + gyro) Mems sensor
https://www.st.com/resource/en/datasheet/asm330lhh.pdf
Tested-by: Mario Tesi <mario.tesi@st.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c')
-rw-r--r-- | drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c index 12e29dda9b98..50cab3531b11 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c @@ -23,7 +23,7 @@ * - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000 * - FIFO size: 4KB * - * - LSM6DSO + * - LSM6DSO/ASM330LHH * - Accelerometer/Gyroscope supported ODR [Hz]: 13, 26, 52, 104, 208, 416 * - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16 * - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000 @@ -347,6 +347,45 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = { .batch_en = BIT(3), } }, + { + .wai = 0x6b, + .max_fifo_size = 512, + .id = { + [0] = ST_ASM330LHH_ID, + }, + .batch = { + [ST_LSM6DSX_ID_ACC] = { + .addr = 0x09, + .mask = GENMASK(3, 0), + }, + [ST_LSM6DSX_ID_GYRO] = { + .addr = 0x09, + .mask = GENMASK(7, 4), + }, + }, + .fifo_ops = { + .read_fifo = st_lsm6dsx_read_tagged_fifo, + .fifo_th = { + .addr = 0x07, + .mask = GENMASK(8, 0), + }, + .fifo_diff = { + .addr = 0x3a, + .mask = GENMASK(8, 0), + }, + .th_wl = 1, + }, + .ts_settings = { + .timer_en = { + .addr = 0x19, + .mask = BIT(5), + }, + .decimator = { + .addr = 0x0a, + .mask = GENMASK(7, 6), + }, + }, + }, }; static const struct iio_chan_spec st_lsm6dsx_acc_channels[] = { |