summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Popa <stefan.popa@analog.com>2020-07-22 10:30:03 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-08-22 10:53:16 +0100
commit5579db2cd5dd4032407114287dd0f97e07478e99 (patch)
tree40cad74458e67a0c1a00da9e7da45bd2f53a669d
parent9b3b3b284ad550ca6cd5049e84728d4939148b9d (diff)
iio: adxl372_i2c: Add OF device ID table
The driver does not have a struct of_device_id table, but supported devices are registered via Device Trees. This patch adds OF device ID table. Signed-off-by: Stefan Popa <stefan.popa@analog.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/accel/adxl372_i2c.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/iio/accel/adxl372_i2c.c b/drivers/iio/accel/adxl372_i2c.c
index e1affe480c77..9a07ab3d151a 100644
--- a/drivers/iio/accel/adxl372_i2c.c
+++ b/drivers/iio/accel/adxl372_i2c.c
@@ -6,6 +6,7 @@
*/
#include <linux/i2c.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/regmap.h>
@@ -46,9 +47,16 @@ static const struct i2c_device_id adxl372_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, adxl372_i2c_id);
+static const struct of_device_id adxl372_of_match[] = {
+ { .compatible = "adi,adxl372" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, adxl372_of_match);
+
static struct i2c_driver adxl372_i2c_driver = {
.driver = {
.name = "adxl372_i2c",
+ .of_match_table = adxl372_of_match,
},
.probe = adxl372_i2c_probe,
.id_table = adxl372_i2c_id,