diff mbox series

[3/3] iio: chemical: Add OF match table for CCS811 VOC sensor

Message ID 20200412183658.6755-4-mani@kernel.org
State New
Headers show
Series [1/3] dt-bindings: iio: chemical: Add binding for CCS811 VOC sensor | expand

Commit Message

Manivannan Sadhasivam April 12, 2020, 6:36 p.m. UTC
From: Manivannan Sadhasivam <mani@kernel.org>

Add devicetree OF match table support for CCS811 VOC sensor.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
---
 drivers/iio/chemical/ccs811.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/drivers/iio/chemical/ccs811.c b/drivers/iio/chemical/ccs811.c
index 6cd92c49c348..313931208f61 100644
--- a/drivers/iio/chemical/ccs811.c
+++ b/drivers/iio/chemical/ccs811.c
@@ -24,6 +24,7 @@ 
 #include <linux/iio/triggered_buffer.h>
 #include <linux/iio/trigger_consumer.h>
 #include <linux/module.h>
+#include <linux/of.h>
 
 #define CCS811_STATUS		0x00
 #define CCS811_MEAS_MODE	0x01
@@ -538,9 +539,16 @@  static const struct i2c_device_id ccs811_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, ccs811_id);
 
+static const struct of_device_id ccs811_dt_ids[] = {
+	{ .compatible = "ams,ccs811" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, ccs811_dt_ids);
+
 static struct i2c_driver ccs811_driver = {
 	.driver = {
 		.name = "ccs811",
+		.of_match_table = of_match_ptr(ccs811_dt_ids),
 	},
 	.probe = ccs811_probe,
 	.remove = ccs811_remove,