@@ -31,6 +31,7 @@
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/slab.h>
+#include <linux/of.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/bma150.h>
@@ -628,6 +629,14 @@ static int bma150_resume(struct device *dev)
static UNIVERSAL_DEV_PM_OPS(bma150_pm, bma150_suspend, bma150_resume, NULL);
+#if IS_ENABLED(CONFIG_OF)
+static const struct of_device_id bma150_of_match[] = {
+ { .compatible = "bosch,bma150" },
+ { },
+};
+MODULE_DEVICE_TABLE(of, bma150_of_match);
+#endif
+
static const struct i2c_device_id bma150_id[] = {
{ "bma150", 0 },
{ "smb380", 0 },
@@ -640,6 +649,7 @@ MODULE_DEVICE_TABLE(i2c, bma150_id);
static struct i2c_driver bma150_driver = {
.driver = {
.name = BMA150_DRIVER,
+ .of_match_table = of_match_ptr(bma150_of_match),
.pm = &bma150_pm,
},
.class = I2C_CLASS_HWMON,