|
|
2a29b48 |
From f7da884578212f10fd200e48f4e4c56f78e513d6 Mon Sep 17 00:00:00 2001
|
|
|
2a29b48 |
From: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
|
|
|
2a29b48 |
Date: Mon, 14 Jan 2019 15:19:13 -0500
|
|
|
2a29b48 |
Subject: iio: chemical: bme680: Add device-tree support
|
|
|
2a29b48 |
|
|
|
2a29b48 |
This commit allow the driver to work with device-tree.
|
|
|
2a29b48 |
|
|
|
2a29b48 |
Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
|
|
|
2a29b48 |
Acked-by: Himanshu Jha <himanshujha199640@gmail.com>
|
|
|
2a29b48 |
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
|
|
|
2a29b48 |
---
|
|
|
2a29b48 |
drivers/iio/chemical/bme680_i2c.c | 7 +++++++
|
|
|
2a29b48 |
drivers/iio/chemical/bme680_spi.c | 8 ++++++++
|
|
|
2a29b48 |
2 files changed, 15 insertions(+)
|
|
|
2a29b48 |
|
|
|
2a29b48 |
diff --git a/drivers/iio/chemical/bme680_i2c.c b/drivers/iio/chemical/bme680_i2c.c
|
|
|
2a29b48 |
index 06d4be539d2e..b2f805b6b36a 100644
|
|
|
2a29b48 |
--- a/drivers/iio/chemical/bme680_i2c.c
|
|
|
2a29b48 |
+++ b/drivers/iio/chemical/bme680_i2c.c
|
|
|
2a29b48 |
@@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
|
|
|
2a29b48 |
};
|
|
|
2a29b48 |
MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
|
|
|
2a29b48 |
|
|
|
2a29b48 |
+static const struct of_device_id bme680_of_i2c_match[] = {
|
|
|
2a29b48 |
+ { .compatible = "bosch,bme680", },
|
|
|
2a29b48 |
+ {},
|
|
|
2a29b48 |
+};
|
|
|
2a29b48 |
+MODULE_DEVICE_TABLE(of, bme680_of_i2c_match);
|
|
|
2a29b48 |
+
|
|
|
2a29b48 |
static struct i2c_driver bme680_i2c_driver = {
|
|
|
2a29b48 |
.driver = {
|
|
|
2a29b48 |
.name = "bme680_i2c",
|
|
|
2a29b48 |
.acpi_match_table = ACPI_PTR(bme680_acpi_match),
|
|
|
2a29b48 |
+ .of_match_table = bme680_of_i2c_match,
|
|
|
2a29b48 |
},
|
|
|
2a29b48 |
.probe = bme680_i2c_probe,
|
|
|
2a29b48 |
.id_table = bme680_i2c_id,
|
|
|
2a29b48 |
diff --git a/drivers/iio/chemical/bme680_spi.c b/drivers/iio/chemical/bme680_spi.c
|
|
|
2a29b48 |
index c9fb05e8d0b9..d0b7bdd3f066 100644
|
|
|
2a29b48 |
--- a/drivers/iio/chemical/bme680_spi.c
|
|
|
2a29b48 |
+++ b/drivers/iio/chemical/bme680_spi.c
|
|
|
2a29b48 |
@@ -6,6 +6,7 @@
|
|
|
2a29b48 |
*/
|
|
|
2a29b48 |
#include <linux/acpi.h>
|
|
|
2a29b48 |
#include <linux/module.h>
|
|
|
2a29b48 |
+#include <linux/of.h>
|
|
|
2a29b48 |
#include <linux/regmap.h>
|
|
|
2a29b48 |
#include <linux/spi/spi.h>
|
|
|
2a29b48 |
|
|
|
2a29b48 |
@@ -110,10 +111,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
|
|
|
2a29b48 |
};
|
|
|
2a29b48 |
MODULE_DEVICE_TABLE(acpi, bme680_acpi_match);
|
|
|
2a29b48 |
|
|
|
2a29b48 |
+static const struct of_device_id bme680_of_spi_match[] = {
|
|
|
2a29b48 |
+ { .compatible = "bosch,bme680", },
|
|
|
2a29b48 |
+ {},
|
|
|
2a29b48 |
+};
|
|
|
2a29b48 |
+MODULE_DEVICE_TABLE(of, bme680_of_spi_match);
|
|
|
2a29b48 |
+
|
|
|
2a29b48 |
static struct spi_driver bme680_spi_driver = {
|
|
|
2a29b48 |
.driver = {
|
|
|
2a29b48 |
.name = "bme680_spi",
|
|
|
2a29b48 |
.acpi_match_table = ACPI_PTR(bme680_acpi_match),
|
|
|
2a29b48 |
+ .of_match_table = bme680_of_spi_match,
|
|
|
2a29b48 |
},
|
|
|
2a29b48 |
.probe = bme680_spi_probe,
|
|
|
2a29b48 |
.id_table = bme680_spi_id,
|
|
|
2a29b48 |
--
|
|
|
2a29b48 |
cgit 1.2-0.3.lf.el7
|