Commit c0f68439 authored by Marius Hoch's avatar Marius Hoch Committed by Jonathan Cameron

iio: st_sensors: Add lsm303d support to the LSM9DS0 IMU driver

The lsm303d is basically the lsm9ds0 without the gyroscope
(which the LSM9DS0 IMU driver doesn't handle), as far as I
can tell.
Signed-off-by: default avatarMarius Hoch <mail@mariushoch.de>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Tested-by: default avatarHans de Goede <hansg@kernel.org>
Link: https://lore.kernel.org/r/20230415231130.115094-4-mail@mariushoch.deSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a9e19f63
...@@ -10,7 +10,8 @@ config IIO_ST_LSM9DS0 ...@@ -10,7 +10,8 @@ config IIO_ST_LSM9DS0
help help
Say yes here to build support for STMicroelectronics LSM9DS0 IMU Say yes here to build support for STMicroelectronics LSM9DS0 IMU
sensor. Supported devices: accelerometer/magnetometer of lsm9ds0. sensor. Supported devices: accelerometer/magnetometer of lsm9ds0
and lsm303d.
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called st_lsm9ds0. will be called st_lsm9ds0.
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
#include "st_lsm9ds0.h" #include "st_lsm9ds0.h"
static const struct of_device_id st_lsm9ds0_of_match[] = { static const struct of_device_id st_lsm9ds0_of_match[] = {
{
.compatible = "st,lsm303d-imu",
.data = LSM303D_IMU_DEV_NAME,
},
{ {
.compatible = "st,lsm9ds0-imu", .compatible = "st,lsm9ds0-imu",
.data = LSM9DS0_IMU_DEV_NAME, .data = LSM9DS0_IMU_DEV_NAME,
...@@ -27,6 +31,7 @@ static const struct of_device_id st_lsm9ds0_of_match[] = { ...@@ -27,6 +31,7 @@ static const struct of_device_id st_lsm9ds0_of_match[] = {
MODULE_DEVICE_TABLE(of, st_lsm9ds0_of_match); MODULE_DEVICE_TABLE(of, st_lsm9ds0_of_match);
static const struct i2c_device_id st_lsm9ds0_id_table[] = { static const struct i2c_device_id st_lsm9ds0_id_table[] = {
{ LSM303D_IMU_DEV_NAME },
{ LSM9DS0_IMU_DEV_NAME }, { LSM9DS0_IMU_DEV_NAME },
{} {}
}; };
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
#include "st_lsm9ds0.h" #include "st_lsm9ds0.h"
static const struct of_device_id st_lsm9ds0_of_match[] = { static const struct of_device_id st_lsm9ds0_of_match[] = {
{
.compatible = "st,lsm303d-imu",
.data = LSM303D_IMU_DEV_NAME,
},
{ {
.compatible = "st,lsm9ds0-imu", .compatible = "st,lsm9ds0-imu",
.data = LSM9DS0_IMU_DEV_NAME, .data = LSM9DS0_IMU_DEV_NAME,
...@@ -27,6 +31,7 @@ static const struct of_device_id st_lsm9ds0_of_match[] = { ...@@ -27,6 +31,7 @@ static const struct of_device_id st_lsm9ds0_of_match[] = {
MODULE_DEVICE_TABLE(of, st_lsm9ds0_of_match); MODULE_DEVICE_TABLE(of, st_lsm9ds0_of_match);
static const struct spi_device_id st_lsm9ds0_id_table[] = { static const struct spi_device_id st_lsm9ds0_id_table[] = {
{ LSM303D_IMU_DEV_NAME },
{ LSM9DS0_IMU_DEV_NAME }, { LSM9DS0_IMU_DEV_NAME },
{} {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment