All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] iio: gyro: bmg160 add device tree support
@ 2019-03-18 15:14 H. Nikolaus Schaller
  2019-03-18 15:14 ` [PATCH 1/2] iio: gyro: bmg160: add device tree compatibility table H. Nikolaus Schaller
  2019-03-18 15:14 ` [PATCH 2/2] dt-bindings: iio: add Bosch BMG160 gyroscope sensor H. Nikolaus Schaller
  0 siblings, 2 replies; 9+ messages in thread
From: H. Nikolaus Schaller @ 2019-03-18 15:14 UTC (permalink / raw)
  To: Jonathan Cameron, Rob Herring, Mark Rutland, H. Nikolaus Schaller
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, devicetree, linux-kernel, letux-kernel, kernel

There is no device tree support since the of_device_id table is missing.

H. Nikolaus Schaller (2):
  iio: gyro: bmg160: add device tree compatibility table
  dt-bindings: iio: add Bosch BMG160 gyroscope sensor

 .../bindings/iio/gyroscope/bmg160.txt         | 20 +++++++++++++++++++
 drivers/iio/gyro/bmg160_i2c.c                 |  9 +++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt

-- 
2.19.1


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

* [PATCH 1/2] iio: gyro: bmg160: add device tree compatibility table
  2019-03-18 15:14 [PATCH 0/2] iio: gyro: bmg160 add device tree support H. Nikolaus Schaller
@ 2019-03-18 15:14 ` H. Nikolaus Schaller
  2019-03-24 18:05   ` Jonathan Cameron
  2019-03-18 15:14 ` [PATCH 2/2] dt-bindings: iio: add Bosch BMG160 gyroscope sensor H. Nikolaus Schaller
  1 sibling, 1 reply; 9+ messages in thread
From: H. Nikolaus Schaller @ 2019-03-18 15:14 UTC (permalink / raw)
  To: Jonathan Cameron, Rob Herring, Mark Rutland, H. Nikolaus Schaller
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, devicetree, linux-kernel, letux-kernel, kernel

Add of_match_table.

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/iio/gyro/bmg160_i2c.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c
index 90126a5a7663..934a092134f0 100644
--- a/drivers/iio/gyro/bmg160_i2c.c
+++ b/drivers/iio/gyro/bmg160_i2c.c
@@ -54,10 +54,19 @@ static const struct i2c_device_id bmg160_i2c_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, bmg160_i2c_id);
 
+static const struct of_device_id bmg160_of_match[] = {
+	{ .compatible = "bosch,bmg160" },
+	{ .compatible = "bosch,bmi055_gyro" },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(of, bmg160_of_match);
+
 static struct i2c_driver bmg160_i2c_driver = {
 	.driver = {
 		.name	= "bmg160_i2c",
 		.acpi_match_table = ACPI_PTR(bmg160_acpi_match),
+		.of_match_table = bmg160_of_match,
 		.pm	= &bmg160_pm_ops,
 	},
 	.probe		= bmg160_i2c_probe,
-- 
2.19.1


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

* [PATCH 2/2] dt-bindings: iio: add Bosch BMG160 gyroscope sensor
  2019-03-18 15:14 [PATCH 0/2] iio: gyro: bmg160 add device tree support H. Nikolaus Schaller
  2019-03-18 15:14 ` [PATCH 1/2] iio: gyro: bmg160: add device tree compatibility table H. Nikolaus Schaller
@ 2019-03-18 15:14 ` H. Nikolaus Schaller
  2019-03-24 18:06   ` Jonathan Cameron
  2019-03-31  6:40     ` Rob Herring
  1 sibling, 2 replies; 9+ messages in thread
From: H. Nikolaus Schaller @ 2019-03-18 15:14 UTC (permalink / raw)
  To: Jonathan Cameron, Rob Herring, Mark Rutland, H. Nikolaus Schaller
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, devicetree, linux-kernel, letux-kernel, kernel

Define bindings for "bosch,bmg160" and "bosch,bmi055_gyro".

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 .../bindings/iio/gyroscope/bmg160.txt         | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt

diff --git a/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt b/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
new file mode 100644
index 000000000000..78e18a1e9c1d
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
@@ -0,0 +1,20 @@
+* Bosch BMG160 triaxial rotation sensor (gyroscope)
+
+Required properties:
+
+  - compatible : should be "bosch,bmg160" or "bosch,bmi055_gyro"
+  - reg : the I2C address of the sensor (0x69)
+
+Optional properties:
+
+  - interrupts : interrupt mapping for GPIO IRQ, it should by configured with
+		flags IRQ_TYPE_EDGE_RISING
+
+Example:
+
+bmg160@69 {
+	compatible = "bosch,bmg160";
+	reg = <0x69>;
+	interrupt-parent = <&gpio6>;
+	interrupts = <18 (IRQ_TYPE_EDGE_RISING)>;
+};
-- 
2.19.1


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

* Re: [PATCH 1/2] iio: gyro: bmg160: add device tree compatibility table
  2019-03-18 15:14 ` [PATCH 1/2] iio: gyro: bmg160: add device tree compatibility table H. Nikolaus Schaller
@ 2019-03-24 18:05   ` Jonathan Cameron
  2019-03-28 16:25     ` H. Nikolaus Schaller
  0 siblings, 1 reply; 9+ messages in thread
From: Jonathan Cameron @ 2019-03-24 18:05 UTC (permalink / raw)
  To: H. Nikolaus Schaller
  Cc: Rob Herring, Mark Rutland, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, devicetree, linux-kernel,
	letux-kernel, kernel

On Mon, 18 Mar 2019 16:14:14 +0100
"H. Nikolaus Schaller" <hns@goldelico.com> wrote:

> Add of_match_table.
> 
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
I'm not against doing this, but do note that there is still a back up
path in which the i2c_device_id table is used to match but without
the vendor part of the string.

I theory the plan is to eventually remove that, but it's not the
case that this driver could not be probed from devicetree previously.

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

Thanks,

Jonathan

> ---
>  drivers/iio/gyro/bmg160_i2c.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c
> index 90126a5a7663..934a092134f0 100644
> --- a/drivers/iio/gyro/bmg160_i2c.c
> +++ b/drivers/iio/gyro/bmg160_i2c.c
> @@ -54,10 +54,19 @@ static const struct i2c_device_id bmg160_i2c_id[] = {
>  
>  MODULE_DEVICE_TABLE(i2c, bmg160_i2c_id);
>  
> +static const struct of_device_id bmg160_of_match[] = {
> +	{ .compatible = "bosch,bmg160" },
> +	{ .compatible = "bosch,bmi055_gyro" },
> +	{ }
> +};
> +
> +MODULE_DEVICE_TABLE(of, bmg160_of_match);
> +
>  static struct i2c_driver bmg160_i2c_driver = {
>  	.driver = {
>  		.name	= "bmg160_i2c",
>  		.acpi_match_table = ACPI_PTR(bmg160_acpi_match),
> +		.of_match_table = bmg160_of_match,
>  		.pm	= &bmg160_pm_ops,
>  	},
>  	.probe		= bmg160_i2c_probe,


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

* Re: [PATCH 2/2] dt-bindings: iio: add Bosch BMG160 gyroscope sensor
  2019-03-18 15:14 ` [PATCH 2/2] dt-bindings: iio: add Bosch BMG160 gyroscope sensor H. Nikolaus Schaller
@ 2019-03-24 18:06   ` Jonathan Cameron
  2019-03-28 16:29     ` H. Nikolaus Schaller
  2019-03-31  6:40     ` Rob Herring
  1 sibling, 1 reply; 9+ messages in thread
From: Jonathan Cameron @ 2019-03-24 18:06 UTC (permalink / raw)
  To: H. Nikolaus Schaller
  Cc: Rob Herring, Mark Rutland, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, devicetree, linux-kernel,
	letux-kernel, kernel

On Mon, 18 Mar 2019 16:14:15 +0100
"H. Nikolaus Schaller" <hns@goldelico.com> wrote:

> Define bindings for "bosch,bmg160" and "bosch,bmi055_gyro".
> 
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Simple binding so applied to the togreg branch of iio.git and pushed out as
testing. Still time for a devicetree ack (or to pull it ;) if anyone has
time to look.

Thanks,

Jonathan

> ---
>  .../bindings/iio/gyroscope/bmg160.txt         | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
> 
> diff --git a/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt b/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
> new file mode 100644
> index 000000000000..78e18a1e9c1d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
> @@ -0,0 +1,20 @@
> +* Bosch BMG160 triaxial rotation sensor (gyroscope)
> +
> +Required properties:
> +
> +  - compatible : should be "bosch,bmg160" or "bosch,bmi055_gyro"
> +  - reg : the I2C address of the sensor (0x69)
> +
> +Optional properties:
> +
> +  - interrupts : interrupt mapping for GPIO IRQ, it should by configured with
> +		flags IRQ_TYPE_EDGE_RISING
> +
> +Example:
> +
> +bmg160@69 {
> +	compatible = "bosch,bmg160";
> +	reg = <0x69>;
> +	interrupt-parent = <&gpio6>;
> +	interrupts = <18 (IRQ_TYPE_EDGE_RISING)>;
> +};


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

* Re: [PATCH 1/2] iio: gyro: bmg160: add device tree compatibility table
  2019-03-24 18:05   ` Jonathan Cameron
@ 2019-03-28 16:25     ` H. Nikolaus Schaller
  0 siblings, 0 replies; 9+ messages in thread
From: H. Nikolaus Schaller @ 2019-03-28 16:25 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Rob Herring, Mark Rutland, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, devicetree, linux-kernel,
	letux-kernel, kernel

Hi Jonathan,
> Am 24.03.2019 um 19:05 schrieb Jonathan Cameron <jic23@kernel.org>:
> 
> On Mon, 18 Mar 2019 16:14:14 +0100
> "H. Nikolaus Schaller" <hns@goldelico.com> wrote:
> 
>> Add of_match_table.
>> 
>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> I'm not against doing this, but do note that there is still a back up
> path in which the i2c_device_id table is used to match but without
> the vendor part of the string.
> 
> I theory the plan is to eventually remove that, but it's not the
> case that this driver could not be probed from devicetree previously.
> 
> Applied to the togreg branch of iio.git and pushed out as testing
> for the autobuilders to play with it.

Thanks,
Nikolaus

> 
> Thanks,
> 
> Jonathan
> 
>> ---
>> drivers/iio/gyro/bmg160_i2c.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>> 
>> diff --git a/drivers/iio/gyro/bmg160_i2c.c b/drivers/iio/gyro/bmg160_i2c.c
>> index 90126a5a7663..934a092134f0 100644
>> --- a/drivers/iio/gyro/bmg160_i2c.c
>> +++ b/drivers/iio/gyro/bmg160_i2c.c
>> @@ -54,10 +54,19 @@ static const struct i2c_device_id bmg160_i2c_id[] = {
>> 
>> MODULE_DEVICE_TABLE(i2c, bmg160_i2c_id);
>> 
>> +static const struct of_device_id bmg160_of_match[] = {
>> +	{ .compatible = "bosch,bmg160" },
>> +	{ .compatible = "bosch,bmi055_gyro" },
>> +	{ }
>> +};
>> +
>> +MODULE_DEVICE_TABLE(of, bmg160_of_match);
>> +
>> static struct i2c_driver bmg160_i2c_driver = {
>> 	.driver = {
>> 		.name	= "bmg160_i2c",
>> 		.acpi_match_table = ACPI_PTR(bmg160_acpi_match),
>> +		.of_match_table = bmg160_of_match,
>> 		.pm	= &bmg160_pm_ops,
>> 	},
>> 	.probe		= bmg160_i2c_probe,
> 


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

* Re: [PATCH 2/2] dt-bindings: iio: add Bosch BMG160 gyroscope sensor
  2019-03-24 18:06   ` Jonathan Cameron
@ 2019-03-28 16:29     ` H. Nikolaus Schaller
  0 siblings, 0 replies; 9+ messages in thread
From: H. Nikolaus Schaller @ 2019-03-28 16:29 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Rob Herring, Mark Rutland, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, devicetree, linux-kernel,
	letux-kernel, kernel


> Am 24.03.2019 um 19:06 schrieb Jonathan Cameron <jic23@kernel.org>:
> 
> On Mon, 18 Mar 2019 16:14:15 +0100
> "H. Nikolaus Schaller" <hns@goldelico.com> wrote:
> 
>> Define bindings for "bosch,bmg160" and "bosch,bmi055_gyro".
>> 
>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> Simple binding so applied to the togreg branch of iio.git and pushed out as
> testing. Still time for a devicetree ack (or to pull it ;) if anyone has
> time to look.

It is more or less an adapation of the bma180 bindings.

> 
> Thanks,
> 
> Jonathan
> 
>> ---
>> .../bindings/iio/gyroscope/bmg160.txt         | 20 +++++++++++++++++++
>> 1 file changed, 20 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
>> 
>> diff --git a/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt b/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
>> new file mode 100644
>> index 000000000000..78e18a1e9c1d
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
>> @@ -0,0 +1,20 @@
>> +* Bosch BMG160 triaxial rotation sensor (gyroscope)
>> +
>> +Required properties:
>> +
>> +  - compatible : should be "bosch,bmg160" or "bosch,bmi055_gyro"
>> +  - reg : the I2C address of the sensor (0x69)
>> +
>> +Optional properties:
>> +
>> +  - interrupts : interrupt mapping for GPIO IRQ, it should by configured with
>> +		flags IRQ_TYPE_EDGE_RISING
>> +
>> +Example:
>> +
>> +bmg160@69 {
>> +	compatible = "bosch,bmg160";
>> +	reg = <0x69>;
>> +	interrupt-parent = <&gpio6>;
>> +	interrupts = <18 (IRQ_TYPE_EDGE_RISING)>;
>> +};
> 


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

* Re: [PATCH 2/2] dt-bindings: iio: add Bosch BMG160 gyroscope sensor
  2019-03-18 15:14 ` [PATCH 2/2] dt-bindings: iio: add Bosch BMG160 gyroscope sensor H. Nikolaus Schaller
@ 2019-03-31  6:40     ` Rob Herring
  2019-03-31  6:40     ` Rob Herring
  1 sibling, 0 replies; 9+ messages in thread
From: Rob Herring @ 2019-03-31  6:40 UTC (permalink / raw)
  To: H. Nikolaus Schaller
  Cc: Jonathan Cameron, Mark Rutland, H. Nikolaus Schaller,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, devicetree, linux-kernel, letux-kernel, kernel

On Mon, 18 Mar 2019 16:14:15 +0100, "H. Nikolaus Schaller" wrote:
> Define bindings for "bosch,bmg160" and "bosch,bmi055_gyro".
> 
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> ---
>  .../bindings/iio/gyroscope/bmg160.txt         | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
> 

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


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

* Re: [PATCH 2/2] dt-bindings: iio: add Bosch BMG160 gyroscope sensor
@ 2019-03-31  6:40     ` Rob Herring
  0 siblings, 0 replies; 9+ messages in thread
From: Rob Herring @ 2019-03-31  6:40 UTC (permalink / raw)
  Cc: Jonathan Cameron, Mark Rutland, H. Nikolaus Schaller,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, devicetree, linux-kernel, letux-kernel, kernel

On Mon, 18 Mar 2019 16:14:15 +0100, "H. Nikolaus Schaller" wrote:
> Define bindings for "bosch,bmg160" and "bosch,bmi055_gyro".
> 
> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
> ---
>  .../bindings/iio/gyroscope/bmg160.txt         | 20 +++++++++++++++++++
>  1 file changed, 20 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/gyroscope/bmg160.txt
> 

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

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

end of thread, other threads:[~2019-03-31  6:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-18 15:14 [PATCH 0/2] iio: gyro: bmg160 add device tree support H. Nikolaus Schaller
2019-03-18 15:14 ` [PATCH 1/2] iio: gyro: bmg160: add device tree compatibility table H. Nikolaus Schaller
2019-03-24 18:05   ` Jonathan Cameron
2019-03-28 16:25     ` H. Nikolaus Schaller
2019-03-18 15:14 ` [PATCH 2/2] dt-bindings: iio: add Bosch BMG160 gyroscope sensor H. Nikolaus Schaller
2019-03-24 18:06   ` Jonathan Cameron
2019-03-28 16:29     ` H. Nikolaus Schaller
2019-03-31  6:40   ` Rob Herring
2019-03-31  6:40     ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.