summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorMarius Hoch <mail@mariushoch.de>2023-04-16 01:11:28 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2023-05-13 17:56:04 +0100
commit598e971fabf8c7c560896394b06175330b1c1aba (patch)
treeeb073b7101d26b533a774baf609597073c34741c /drivers/iio
parentc0f68439ae06c8612e4d64e24b70a5c82fcdede6 (diff)
downloadlinux-stable-598e971fabf8c7c560896394b06175330b1c1aba.tar.gz
linux-stable-598e971fabf8c7c560896394b06175330b1c1aba.tar.bz2
linux-stable-598e971fabf8c7c560896394b06175330b1c1aba.zip
iio: st_sensors: Add ACPI support for lsm303d to the LSM9DS0 IMU driver
The lsm303d can be found as ACCL0001 on various Lenovo devices, including the Lenovo Yoga Tablet 2 1051-F, where I tested this patch. Dropped SPI support as per discussion in thread linked below. Signed-off-by: Marius Hoch <mail@mariushoch.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Hans de Goede <hansg@kernel.org> Link: https://lore.kernel.org/r/20230415231130.115094-5-mail@mariushoch.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
index 611515c6a73d..a0b9b2df11ce 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
@@ -37,6 +37,12 @@ static const struct i2c_device_id st_lsm9ds0_id_table[] = {
};
MODULE_DEVICE_TABLE(i2c, st_lsm9ds0_id_table);
+static const struct acpi_device_id st_lsm9ds0_acpi_match[] = {
+ {"ACCL0001", (kernel_ulong_t)LSM303D_IMU_DEV_NAME},
+ { },
+};
+MODULE_DEVICE_TABLE(acpi, st_lsm9ds0_acpi_match);
+
static const struct regmap_config st_lsm9ds0_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
@@ -73,6 +79,7 @@ static struct i2c_driver st_lsm9ds0_driver = {
.driver = {
.name = "st-lsm9ds0-i2c",
.of_match_table = st_lsm9ds0_of_match,
+ .acpi_match_table = st_lsm9ds0_acpi_match,
},
.probe_new = st_lsm9ds0_i2c_probe,
.id_table = st_lsm9ds0_id_table,