Commit 598e971f authored by Marius Hoch's avatar Marius Hoch Committed by Jonathan Cameron
Browse files

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: default avatarMarius Hoch <mail@mariushoch.de>
Acked-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-5-mail@mariushoch.de


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent c0f68439
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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,