iio: accel: st_accel: Add LSM303D
authorMarius Hoch <mail@mariushoch.de>
Sat, 15 Apr 2023 23:11:25 +0000 (01:11 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 13 May 2023 16:56:04 +0000 (17:56 +0100)
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>
drivers/iio/accel/st_accel_core.c
include/linux/iio/common/st_sensors.h

index 5f7d81b44b1d28ce2eab297ec16c459bb9feed33..7c4f58c90f949b76b0c4d1a63bb22f10498a9356 100644 (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 = {
index f5f3ee57bc70a7bb3aa6d201577d5b88cfe55145..607c3a89a6471df963e6fc4ed09df84b53c0db0f 100644 (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 +