Commit f7da8845 authored by Sebastien Bourdelin's avatar Sebastien Bourdelin Committed by Jonathan Cameron

iio: chemical: bme680: Add device-tree support

This commit allow the driver to work with device-tree.
Signed-off-by: default avatarSebastien Bourdelin <sebastien.bourdelin@gmail.com>
Acked-by: default avatarHimanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent e5aab7b0
...@@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = { ...@@ -70,10 +70,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
}; };
MODULE_DEVICE_TABLE(acpi, 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 = { static struct i2c_driver bme680_i2c_driver = {
.driver = { .driver = {
.name = "bme680_i2c", .name = "bme680_i2c",
.acpi_match_table = ACPI_PTR(bme680_acpi_match), .acpi_match_table = ACPI_PTR(bme680_acpi_match),
.of_match_table = bme680_of_i2c_match,
}, },
.probe = bme680_i2c_probe, .probe = bme680_i2c_probe,
.id_table = bme680_i2c_id, .id_table = bme680_i2c_id,
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
...@@ -110,10 +111,17 @@ static const struct acpi_device_id bme680_acpi_match[] = { ...@@ -110,10 +111,17 @@ static const struct acpi_device_id bme680_acpi_match[] = {
}; };
MODULE_DEVICE_TABLE(acpi, 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 = { static struct spi_driver bme680_spi_driver = {
.driver = { .driver = {
.name = "bme680_spi", .name = "bme680_spi",
.acpi_match_table = ACPI_PTR(bme680_acpi_match), .acpi_match_table = ACPI_PTR(bme680_acpi_match),
.of_match_table = bme680_of_spi_match,
}, },
.probe = bme680_spi_probe, .probe = bme680_spi_probe,
.id_table = bme680_spi_id, .id_table = bme680_spi_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