linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support
@ 2019-01-11 20:53 Sebastien Bourdelin
  2019-01-11 20:53 ` [PATCH v2 2/2] dt-bindings: iio: chemical: Add bindings for bme680 Sebastien Bourdelin
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Sebastien Bourdelin @ 2019-01-11 20:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, linux-iio, himanshujha199640, mark.rutland, robh+dt,
	pmeerw, lars, knaack.h, jic23, Sebastien Bourdelin

This commit allow the driver to work with device-tree.

Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
---
v1 -> v2:
  - add missing of.h header in bme680_spi.c
---
 drivers/iio/chemical/bme680_i2c.c | 7 +++++++
 drivers/iio/chemical/bme680_spi.c | 9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/drivers/iio/chemical/bme680_i2c.c b/drivers/iio/chemical/bme680_i2c.c
index 06d4be539d2e..94a36ebdf0b2 100644
--- a/drivers/iio/chemical/bme680_i2c.c
+++ b/drivers/iio/chemical/bme680_i2c.c
@@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
 
+static const struct of_device_id bme680_of_i2c_match[] = {
+	{ .compatible = "bosch,bme680", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, bme680_of_i2c_match);
+
 static struct i2c_driver bme680_i2c_driver = {
 	.driver = {
 		.name			= "bme680_i2c",
 		.acpi_match_table       = ACPI_PTR(bme680_acpi_match),
+		.of_match_table		= of_match_ptr(bme680_of_i2c_match),
 	},
 	.probe = bme680_i2c_probe,
 	.id_table = bme680_i2c_id,
diff --git a/drivers/iio/chemical/bme680_spi.c b/drivers/iio/chemical/bme680_spi.c
index c9fb05e8d0b9..caa57287a911 100644
--- a/drivers/iio/chemical/bme680_spi.c
+++ b/drivers/iio/chemical/bme680_spi.c
@@ -6,9 +6,11 @@
  */
 #include <linux/acpi.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/regmap.h>
 #include <linux/spi/spi.h>
 
+
 #include "bme680.h"
 
 static int bme680_regmap_spi_write(void *context, const void *data,
@@ -110,10 +112,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
 };
 MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
 
+static const struct of_device_id bme680_of_spi_match[] = {
+	{ .compatible = "bosch,bme680", },
+	{},
+}
+MODULE_DEVICE_TABLE(of, bme680_of_spi_match);
+
 static struct spi_driver bme680_spi_driver = {
 	.driver = {
 		.name			= "bme680_spi",
 		.acpi_match_table	= ACPI_PTR(bme680_acpi_match),
+		.of_match_table		= of_match_ptr(bme680_of_spi_match),
 	},
 	.probe = bme680_spi_probe,
 	.id_table = bme680_spi_id,
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-01-21 21:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 20:53 [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support Sebastien Bourdelin
2019-01-11 20:53 ` [PATCH v2 2/2] dt-bindings: iio: chemical: Add bindings for bme680 Sebastien Bourdelin
2019-01-12 18:28   ` Jonathan Cameron
2019-01-14 20:17     ` sebastien bourdelin
2019-01-19 16:57       ` Jonathan Cameron
2019-01-21 21:43         ` sebastien bourdelin
2019-01-12  9:42 ` [PATCH v2 1/2] iio: chemical: bme680: Add device-tree support Himanshu Jha
2019-01-12 18:25   ` Jonathan Cameron
2019-01-14 20:00   ` sebastien bourdelin
2019-01-15 18:41     ` Himanshu Jha
2019-01-16 22:31       ` Sebastien Bourdelin
2019-01-12 18:22 ` Jonathan Cameron
2019-01-14 20:01   ` sebastien bourdelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).