summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorLuca Ceresoli <luca.ceresoli@bootlin.com>2023-10-04 18:39:28 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2023-10-11 15:54:39 +0100
commit4d7c16d08d248952c116f2eb9b7b5abc43a19688 (patch)
treec3e83902746bece26c4a65edbbf8c97539b9747d /drivers/iio
parent2d3dff577dd0ea8fe9637a13822f7603c4a881c8 (diff)
downloadlinux-4d7c16d08d248952c116f2eb9b7b5abc43a19688.tar.gz
linux-4d7c16d08d248952c116f2eb9b7b5abc43a19688.tar.bz2
linux-4d7c16d08d248952c116f2eb9b7b5abc43a19688.zip
iio: accel: mxc4005: allow module autoloading via OF compatible
Add OF device table with compatible strings to allow automatic module loading. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20231004-mxc4005-device-tree-support-v1-2-e7c0faea72e4@bootlin.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/accel/mxc4005.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/iio/accel/mxc4005.c b/drivers/iio/accel/mxc4005.c
index 75d142bc14b4..82e8d0b39049 100644
--- a/drivers/iio/accel/mxc4005.c
+++ b/drivers/iio/accel/mxc4005.c
@@ -476,6 +476,13 @@ static const struct acpi_device_id mxc4005_acpi_match[] = {
};
MODULE_DEVICE_TABLE(acpi, mxc4005_acpi_match);
+static const struct of_device_id mxc4005_of_match[] = {
+ { .compatible = "memsic,mxc4005", },
+ { .compatible = "memsic,mxc6655", },
+ { },
+};
+MODULE_DEVICE_TABLE(of, mxc4005_of_match);
+
static const struct i2c_device_id mxc4005_id[] = {
{"mxc4005", 0},
{"mxc6655", 0},
@@ -487,6 +494,7 @@ static struct i2c_driver mxc4005_driver = {
.driver = {
.name = MXC4005_DRV_NAME,
.acpi_match_table = ACPI_PTR(mxc4005_acpi_match),
+ .of_match_table = mxc4005_of_match,
},
.probe = mxc4005_probe,
.id_table = mxc4005_id,