iio: accel: st_accel: Add LSM303D

The lsm303d has the same register mapping as the lsm9ds0,
thus we can just re-use that.

Tested on a Lenovo Yoga Tablet 2 1051-F.

Signed-off-by: Marius Hoch <mail@mariushoch.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Hans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20230415231130.115094-2-mail@mariushoch.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Marius Hoch 2023-04-16 01:11:25 +02:00 committed by Jonathan Cameron
parent ef513aa7aa
commit 9445368bca
2 changed files with 2 additions and 0 deletions

View file

@ -1007,6 +1007,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
.sensors_supported = {
[0] = LSM9DS0_IMU_DEV_NAME,
[1] = LSM303D_IMU_DEV_NAME,
},
.ch = (struct iio_chan_spec *)st_accel_16bit_channels,
.odr = {

View file

@ -22,6 +22,7 @@
#include <linux/platform_data/st_sensors_pdata.h>
#define LSM9DS0_IMU_DEV_NAME "lsm9ds0"
#define LSM303D_IMU_DEV_NAME "lsm303d"
/*
* Buffer size max case: 2bytes per channel, 3 channels in total +