linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support
@ 2019-01-14 20:19 Sebastien Bourdelin
  2019-01-14 20:19 ` [PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680 Sebastien Bourdelin
  2019-01-15 18:47 ` [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support Himanshu Jha
  0 siblings, 2 replies; 7+ messages in thread
From: Sebastien Bourdelin @ 2019-01-14 20:19 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>
---
v2 -> v3:
  - remove of_match_ptr: Suggested by Jonathan Cameron <jic23@kernel.org>
  - minor style fixup
  - rebase on master
v1 -> v2:
  - add missing of.h header in bme680_spi.c
---
 drivers/iio/chemical/bme680_i2c.c | 7 +++++++
 drivers/iio/chemical/bme680_spi.c | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/iio/chemical/bme680_i2c.c b/drivers/iio/chemical/bme680_i2c.c
index 06d4be539d2e..b2f805b6b36a 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		= 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..d0b7bdd3f066 100644
--- a/drivers/iio/chemical/bme680_spi.c
+++ b/drivers/iio/chemical/bme680_spi.c
@@ -6,6 +6,7 @@
  */
 #include <linux/acpi.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/regmap.h>
 #include <linux/spi/spi.h>
 
@@ -110,10 +111,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		= bme680_of_spi_match,
 	},
 	.probe = bme680_spi_probe,
 	.id_table = bme680_spi_id,
-- 
2.20.1


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

* [PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680
  2019-01-14 20:19 [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support Sebastien Bourdelin
@ 2019-01-14 20:19 ` Sebastien Bourdelin
  2019-01-15 18:45   ` Himanshu Jha
  2019-01-15 20:28   ` Rob Herring
  2019-01-15 18:47 ` [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support Himanshu Jha
  1 sibling, 2 replies; 7+ messages in thread
From: Sebastien Bourdelin @ 2019-01-14 20:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: devicetree, linux-iio, himanshujha199640, mark.rutland, robh+dt,
	pmeerw, lars, knaack.h, jic23, Sebastien Bourdelin

BME680 is a pressure/temperature/humidity/voc sensor.

Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
---
v2 -> v3:
  - change i2c address to 0x76 as it seems more reliable: Suggested by Himanshu Jha <himanshujha199640@gmail.com>
  - rebase on master
---
 .../devicetree/bindings/iio/chemical/bme680.txt       | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/chemical/bme680.txt

diff --git a/Documentation/devicetree/bindings/iio/chemical/bme680.txt b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
new file mode 100644
index 000000000000..7f3827cfb2ff
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
@@ -0,0 +1,11 @@
+Bosch Sensortec BME680 pressure/temperature/humidity/voc sensors
+
+Required properties:
+- compatible: must be "bosch,bme680"
+
+Example:
+
+bme680@76 {
+          compatible = "bosch,bme680";
+          reg = <0x76>;
+};
-- 
2.20.1


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

* Re: [PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680
  2019-01-14 20:19 ` [PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680 Sebastien Bourdelin
@ 2019-01-15 18:45   ` Himanshu Jha
  2019-01-15 20:28   ` Rob Herring
  1 sibling, 0 replies; 7+ messages in thread
From: Himanshu Jha @ 2019-01-15 18:45 UTC (permalink / raw)
  To: Sebastien Bourdelin
  Cc: linux-kernel, devicetree, linux-iio, mark.rutland, robh+dt,
	pmeerw, lars, knaack.h, jic23

On Mon, Jan 14, 2019 at 03:19:14PM -0500, Sebastien Bourdelin wrote:
> BME680 is a pressure/temperature/humidity/voc sensor.
> 
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
> ---
> v2 -> v3:
>   - change i2c address to 0x76 as it seems more reliable: Suggested by Himanshu Jha <himanshujha199640@gmail.com>
>   - rebase on master
> ---
>  .../devicetree/bindings/iio/chemical/bme680.txt       | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/chemical/bme680.txt
> 
> diff --git a/Documentation/devicetree/bindings/iio/chemical/bme680.txt b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
> new file mode 100644
> index 000000000000..7f3827cfb2ff
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/chemical/bme680.txt
> @@ -0,0 +1,11 @@
> +Bosch Sensortec BME680 pressure/temperature/humidity/voc sensors
> +
> +Required properties:
> +- compatible: must be "bosch,bme680"
> +
> +Example:
> +
> +bme680@76 {
> +          compatible = "bosch,bme680";
> +          reg = <0x76>;
> +};

Thanks,

	Acked-by: Himanshu Jha <himanshujha199640@gmail.com>

-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology

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

* Re: [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support
  2019-01-14 20:19 [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support Sebastien Bourdelin
  2019-01-14 20:19 ` [PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680 Sebastien Bourdelin
@ 2019-01-15 18:47 ` Himanshu Jha
  2019-01-19 17:44   ` Jonathan Cameron
  1 sibling, 1 reply; 7+ messages in thread
From: Himanshu Jha @ 2019-01-15 18:47 UTC (permalink / raw)
  To: Sebastien Bourdelin
  Cc: linux-kernel, devicetree, linux-iio, mark.rutland, robh+dt,
	pmeerw, lars, knaack.h, jic23

On Mon, Jan 14, 2019 at 03:19:13PM -0500, Sebastien Bourdelin wrote:
> This commit allow the driver to work with device-tree.
> 
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
> ---

	Acked-by: Himanshu Jha <himanshujha199640@gmail.com>

Thanks!

> v2 -> v3:
>   - remove of_match_ptr: Suggested by Jonathan Cameron <jic23@kernel.org>
>   - minor style fixup
>   - rebase on master
> v1 -> v2:
>   - add missing of.h header in bme680_spi.c
> ---
>  drivers/iio/chemical/bme680_i2c.c | 7 +++++++
>  drivers/iio/chemical/bme680_spi.c | 8 ++++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/drivers/iio/chemical/bme680_i2c.c b/drivers/iio/chemical/bme680_i2c.c
> index 06d4be539d2e..b2f805b6b36a 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		= 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..d0b7bdd3f066 100644
> --- a/drivers/iio/chemical/bme680_spi.c
> +++ b/drivers/iio/chemical/bme680_spi.c
> @@ -6,6 +6,7 @@
>   */
>  #include <linux/acpi.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/regmap.h>
>  #include <linux/spi/spi.h>
>  
> @@ -110,10 +111,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		= bme680_of_spi_match,
>  	},
>  	.probe = bme680_spi_probe,
>  	.id_table = bme680_spi_id,
> -- 
> 2.20.1
> 

-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology

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

* Re: [PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680
  2019-01-14 20:19 ` [PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680 Sebastien Bourdelin
  2019-01-15 18:45   ` Himanshu Jha
@ 2019-01-15 20:28   ` Rob Herring
  2019-01-19 17:44     ` Jonathan Cameron
  1 sibling, 1 reply; 7+ messages in thread
From: Rob Herring @ 2019-01-15 20:28 UTC (permalink / raw)
  To: Sebastien Bourdelin
  Cc: linux-kernel, devicetree, linux-iio, himanshujha199640,
	mark.rutland, robh+dt, pmeerw, lars, knaack.h, jic23,
	Sebastien Bourdelin

On Mon, 14 Jan 2019 15:19:14 -0500, Sebastien Bourdelin wrote:
> BME680 is a pressure/temperature/humidity/voc sensor.
> 
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
> ---
> v2 -> v3:
>   - change i2c address to 0x76 as it seems more reliable: Suggested by Himanshu Jha <himanshujha199640@gmail.com>
>   - rebase on master
> ---
>  .../devicetree/bindings/iio/chemical/bme680.txt       | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/chemical/bme680.txt
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support
  2019-01-15 18:47 ` [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support Himanshu Jha
@ 2019-01-19 17:44   ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2019-01-19 17:44 UTC (permalink / raw)
  To: Himanshu Jha
  Cc: Sebastien Bourdelin, linux-kernel, devicetree, linux-iio,
	mark.rutland, robh+dt, pmeerw, lars, knaack.h

On Wed, 16 Jan 2019 00:17:13 +0530
Himanshu Jha <himanshujha199640@gmail.com> wrote:

> On Mon, Jan 14, 2019 at 03:19:13PM -0500, Sebastien Bourdelin wrote:
> > This commit allow the driver to work with device-tree.
> > 
> > Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
> > ---  
> 
> 	Acked-by: Himanshu Jha <himanshujha199640@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it and see if we missed anything.

Thanks,

Jonathan
> 
> Thanks!
> 
> > v2 -> v3:
> >   - remove of_match_ptr: Suggested by Jonathan Cameron <jic23@kernel.org>
> >   - minor style fixup
> >   - rebase on master
> > v1 -> v2:
> >   - add missing of.h header in bme680_spi.c
> > ---
> >  drivers/iio/chemical/bme680_i2c.c | 7 +++++++
> >  drivers/iio/chemical/bme680_spi.c | 8 ++++++++
> >  2 files changed, 15 insertions(+)
> > 
> > diff --git a/drivers/iio/chemical/bme680_i2c.c b/drivers/iio/chemical/bme680_i2c.c
> > index 06d4be539d2e..b2f805b6b36a 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		= 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..d0b7bdd3f066 100644
> > --- a/drivers/iio/chemical/bme680_spi.c
> > +++ b/drivers/iio/chemical/bme680_spi.c
> > @@ -6,6 +6,7 @@
> >   */
> >  #include <linux/acpi.h>
> >  #include <linux/module.h>
> > +#include <linux/of.h>
> >  #include <linux/regmap.h>
> >  #include <linux/spi/spi.h>
> >  
> > @@ -110,10 +111,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		= bme680_of_spi_match,
> >  	},
> >  	.probe = bme680_spi_probe,
> >  	.id_table = bme680_spi_id,
> > -- 
> > 2.20.1
> >   
> 


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

* Re: [PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680
  2019-01-15 20:28   ` Rob Herring
@ 2019-01-19 17:44     ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2019-01-19 17:44 UTC (permalink / raw)
  To: Rob Herring
  Cc: Sebastien Bourdelin, linux-kernel, devicetree, linux-iio,
	himanshujha199640, mark.rutland, robh+dt, pmeerw, lars, knaack.h

On Tue, 15 Jan 2019 14:28:02 -0600
Rob Herring <robh@kernel.org> wrote:

> On Mon, 14 Jan 2019 15:19:14 -0500, Sebastien Bourdelin wrote:
> > BME680 is a pressure/temperature/humidity/voc sensor.
> > 
> > Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@gmail.com>
> > ---
> > v2 -> v3:
> >   - change i2c address to 0x76 as it seems more reliable: Suggested by Himanshu Jha <himanshujha199640@gmail.com>
> >   - rebase on master
> > ---
> >  .../devicetree/bindings/iio/chemical/bme680.txt       | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/iio/chemical/bme680.txt
> >   
> 
> Reviewed-by: Rob Herring <robh@kernel.org>

Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-14 20:19 [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support Sebastien Bourdelin
2019-01-14 20:19 ` [PATCH v3 2/2] dt-bindings: iio: chemical: Add bindings for bme680 Sebastien Bourdelin
2019-01-15 18:45   ` Himanshu Jha
2019-01-15 20:28   ` Rob Herring
2019-01-19 17:44     ` Jonathan Cameron
2019-01-15 18:47 ` [PATCH v3 1/2] iio: chemical: bme680: Add device-tree support Himanshu Jha
2019-01-19 17:44   ` Jonathan Cameron

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).