Commit 5579db2c authored by Stefan Popa's avatar Stefan Popa Committed by Jonathan Cameron

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: default avatarStefan Popa <stefan.popa@analog.com>
Signed-off-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 9b3b3b28
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/regmap.h> #include <linux/regmap.h>
...@@ -46,9 +47,16 @@ static const struct i2c_device_id adxl372_i2c_id[] = { ...@@ -46,9 +47,16 @@ static const struct i2c_device_id adxl372_i2c_id[] = {
}; };
MODULE_DEVICE_TABLE(i2c, 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 = { static struct i2c_driver adxl372_i2c_driver = {
.driver = { .driver = {
.name = "adxl372_i2c", .name = "adxl372_i2c",
.of_match_table = adxl372_of_match,
}, },
.probe = adxl372_i2c_probe, .probe = adxl372_i2c_probe,
.id_table = adxl372_i2c_id, .id_table = adxl372_i2c_id,
......
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