iio: magnetometer: st_accel: Add LSM303D
authorMarius Hoch <mail@mariushoch.de>
Sat, 15 Apr 2023 23:11:26 +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-3-mail@mariushoch.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/st_magn_core.c

index 8faa7409d9e12d6a9192b3f9ec38bd659fe2d429..6cc0dfd31821b094735f04b0bc0e15319407a759 100644 (file)
@@ -427,6 +427,7 @@ static const struct st_sensor_settings st_magn_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_magn_4_16bit_channels,
                .odr = {