Skip to contentSkip to conversation

dt-bindings: Add some missing IIO related binding docs.

PATCH In review Jonathan Cameron 3 participants 14 messages Apr 1, 2021 – Apr 24, 2021

Subsystems (4)
lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 1/6 dt-bindings:iio:accel:adis16201 and adis16209 bindings

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

These two devices have different internal characterstics, but their external connectivity and as a result device tree descriptions are identical.

Note that neither driver in Linux currently has an of_match_table but instead rely on matching via name alone.

---
 .../bindings/iio/accel/adi,adis16201.yaml     | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)
Documentation/devicetree/bindings/iio/accel/adi,adis16201.yaml new file +55 -0
new file mode 100644
index 000000000000..6f8f8a6258fe
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/adi,adis16201.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ADIS16201 Dual Axis Inclinometer and similar
+
+maintainers:
+  - Jonathan Cameron <[email protected]>
+
+description: |
+  Two similar parts from external interface point of view.
+  SPI interface.
+    https://www.analog.com/en/products/adis16201.html
+    https://www.analog.com/en/products/adis16209.html
+
+properties:
+  compatible:
+    enum:
+      - adi,adis16201
+      - adi,adis16209
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  vdd-supply: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        accelerometer@0 {
+            compatible = "adi,adis16201";
+            reg = <0>;
+            spi-max-frequency = <2500000>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+...
Signature · 1 line
2.31.1
author maintainer
#7 lore raw

PATCH 4/6 dt-bindings:trivial-devices: Add memsic,mxc4005/mxc6255/mxc6655 entries

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple devices with I2C interface and single interrupt line so entries in trivial devices are sufficient.

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +6 -0
index a327130d1faa..c7d49a720afa 100644
@@ -166,8 +166,14 @@ properties:
           - meas,tsys01
             # MEMSIC magnetometer
           - memsic,mmc35240
+            # MEMSIC 3-axis accelerometer
+          - memsic,mx4005
             # MEMSIC 2-axis 8-bit digital accelerometer
           - memsic,mxc6225
+            # MEMSIC 2-axis 8-bit digital accelerometer
+          - memsic,mxc6255
+            # MEMSIC 3-axis accelerometer
+          - memsic,mxc6655
             # Microchip differential I2C ADC, 1 Channel, 18 bit
           - microchip,mcp3421
             # Microchip differential I2C ADC, 2 Channel, 18 bit
Signature · 1 line
2.31.1
author maintainer
#9 lore raw

PATCH 5/6 dt-bindings:trivial-devices: Add sensortek,stk8312 and sensortek,s8ba50

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Two simple devices. The stk8ba50 datasheet could be found via google, but I only have the driver for the 8312.

Given they both seem to be 3 axis devices with a single interrupt line, add them to trivial-devices.yaml

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +4 -0
index c7d49a720afa..92ea6b960e16 100644
@@ -258,6 +258,10 @@ properties:
           - sensirion,sgpc3
             # Sensirion multi-pixel gas sensor with I2C interface
           - sensirion,sgp30
+            # Sensortek 3 axis accelerometer
+          - sensortek,stk8312
+            # Sensortek 3 axis accelerometer
+          - sensortek,stk8ba50
             # SGX Sensortech VZ89X Sensors
           - sgx,vz89x
             # Relative Humidity and Temperature Sensors
Signature · 1 line
2.31.1
author maintainer
#3 lore raw

PATCH 2/6 dt-bindings:iio:accel:bosch,bma220 device tree binding documentation

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Linux driver currently relies on the driver.name to match to the compatible, but that doesn't mean it isn't a good idea to document it.

Only real complexity is the 3 separate power supplies.

---
 .../bindings/iio/accel/bosch,bma220.yaml      | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml new file +50 -0
new file mode 100644
index 000000000000..942b23ad0712
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/bosch,bma220.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bosch BMA220 Trixial Acceleration Sensor
+
+maintainers:
+  - Jonathan Cameron <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - bosch,bma220
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  spi-max-frequency: true
+
+  vdda-supply: true
+  vddd-supply: true
+  vddio-supply: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        accelerometer@0 {
+            compatible = "bosch,bma220";
+            reg = <0>;
+            spi-max-frequency = <2500000>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+...
Signature · 1 line
2.31.1
author maintainer
#11 lore raw

PATCH 6/6 dt-bindings:iio:adc:adi,ad7298 document bindings

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

The device has a tsens-busy pin, but it's both fiddly and currently ignored by the Linux driver. Given it's not clear whether the binding should be an interrupt, or a GPIO I have left that out for now.

Cc Michael Hennerich <[email protected]>
---
 .../bindings/iio/adc/adi,ad7298.yaml          | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
Documentation/devicetree/bindings/iio/adc/adi,ad7298.yaml new file +48 -0
new file mode 100644
index 000000000000..ca414bb396c5
@@ -0,0 +1,48 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright 2019 Analog Devices Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/adi,ad7298.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD7298 ADC
+
+maintainers:
+  - Michael Hennerich <[email protected]>
+
+description: |
+  Bindings for the Analog Devices AD7298 ADC device. Datasheet can be
+  found here:
+    https://www.analog.com/en/products/ad7298.html
+
+properties:
+  compatible:
+    const: adi,ad7298
+
+  reg:
+    maxItems: 1
+
+  vref-supply: true
+  vdd-supply: true
+  spi-max-frequency: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      adc@0 {
+        compatible = "adi,ad7298";
+        reg = <0>;
+        spi-max-frequency = <5000000>;
+        vref-supply = <&adc_vref>;
+      };
+    };
+...
Signature · 1 line
2.31.1
author maintainer
#5 lore raw

PATCH 3/6 dt-bindings:iio:accel:fsl,mma7455 binding doc

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Binding documentation for this driver was missing.
Note that the binding and some in tree dts files specifiy interrupts etc but the driver is fairly simple and does not yet make use of them.

Listed both Joachim and myself as maintainers for this binding on basis it's Joachim's driver but I don't want to volunteer Joachim too strongly to look after this doc.

---
 .../bindings/iio/accel/fsl,mma7455.yaml       | 82 +++++++++++++++++++
 1 file changed, 82 insertions(+)
Documentation/devicetree/bindings/iio/accel/fsl,mma7455.yaml new file +82 -0
new file mode 100644
index 000000000000..7c8f8bdc2333
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/fsl,mma7455.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale MMA7455 and MMA7456 three axis accelerometers
+
+maintainers:
+  - Joachim Eastwood <[email protected]>
+  - Jonathan Cameron <[email protected]>
+
+description:
+  Devices support both SPI and I2C interfaces.
+
+properties:
+  compatible:
+    enum:
+      - fsl,mma7455
+      - fsl,mma7456
+  reg:
+    maxItems: 1
+
+  avdd-supply: true
+  vddio-supply: true
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  interrupt-names:
+    description:
+      Data ready is only available on INT1, but events can use either or
+      both pins.  If not specified, first element assumed to correspond
+      to INT1 and second (where present) to INT2.
+    minItems: 1
+    maxItems: 2
+    items:
+      enum:
+        - "INT1"
+        - "INT2"
+
+  spi-max-frequency: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    # include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        accelerometer@18 {
+            compatible = "fsl,mma7455";
+            reg = <0x18>;
+            vddio-supply = <&iovdd>;
+            avdd-supply = <&avdd>;
+            interrupts = <57 IRQ_TYPE_EDGE_FALLING>, <58 IRQ_TYPE_EDGE_FALLING>;
+            interrupt-names = "INT2", "INT1";
+        };
+    };
+  - |
+    # include <dt-bindings/interrupt-controller/irq.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        accelerometer@0 {
+            compatible = "fsl,mma7456";
+            reg = <0>;
+            spi-max-frequency = <10000000>;
+            vddio-supply = <&iovdd>;
+            avdd-supply = <&avdd>;
+            interrupts = <57 IRQ_TYPE_EDGE_FALLING>;
+            interrupt-names = "INT1";
+        };
+    };
+...
Signature · 1 line
2.31.1

Jonathan Cameron

author maintainer
#0 lore raw

cover dt-bindings: Add some missing IIO related binding docs.

From: Jonathan Cameron <[email protected]>

First of what will probably be one of several sets to slowly but surely add yaml binding docs for all the defacto bindings hiding in IIO drivers. Ultimate I'd like to clear the backlog of these and so go forward with full documenation, but there may be some cases we just decide are too complex to bother. The fsl,mma955x parts are ignored (for now) on that basis (I think we have all the other accelerometers covered now)

Some of these date back to board file days and some were added by people only interested in ACPI, but all can be instantiated from dt-bindings. A few may simply have slipped through the net during review.

Testing done with hacked up qemu when anything was non trivial.

Jonathan Cameron (6):
dt-bindings:iio:accel:adis16201 and adis16209 bindings dt-bindings:iio:accel:bosch,bma220 device tree binding documentation dt-bindings:iio:accel:fsl,mma7455 binding doc dt-bindings:trivial-devices: Add memsic,mxc4005/mxc6255/mxc6655
entries
dt-bindings:trivial-devices: Add sensortek,stk8312 and
sensortek,s8ba50
dt-bindings:iio:adc:adi,ad7298 document bindings

 .../bindings/iio/accel/adi,adis16201.yaml     | 55 +++++++++++++
 .../bindings/iio/accel/bosch,bma220.yaml      | 50 +++++++++++
 .../bindings/iio/accel/fsl,mma7455.yaml       | 82 +++++++++++++++++++
 .../bindings/iio/adc/adi,ad7298.yaml          | 48 +++++++++++
 .../devicetree/bindings/trivial-devices.yaml  | 10 +++
 5 files changed, 245 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16201.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/accel/fsl,mma7455.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7298.yaml
Signature · 1 line
2.31.1
maintainer Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] dt-bindings:iio:accel:adis16201 and adis16209 bindings

In reply to Jonathan Cameron
Quoted 3 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

These two devices have different internal characterstics, but their

typo: characteristics

Quoted 10 lines

external connectivity and as a result device tree descriptions are identical.

Note that neither driver in Linux currently has an of_match_table but instead rely on matching via name alone.

---
 .../bindings/iio/accel/adi,adis16201.yaml     | 55 +++++++++++++++++++
 1 file changed, 55 insertions(+)

Otherwise,

maintainer Reviewed-by on v1 2/6
#4 lore raw

Re: [PATCH 2/6] dt-bindings:iio:accel:bosch,bma220 device tree binding documentation

In reply to Jonathan Cameron
Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Linux driver currently relies on the driver.name to match to the compatible, but that doesn't mean it isn't a good idea to document it.

Quoted 7 lines

Only real complexity is the 3 separate power supplies.

---
 .../bindings/iio/accel/bosch,bma220.yaml      | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
maintainer Reviewed-by on v1 3/6
#6 lore raw

Re: [PATCH 3/6] dt-bindings:iio:accel:fsl,mma7455 binding doc

In reply to Jonathan Cameron
Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Binding documentation for this driver was missing.
Note that the binding and some in tree dts files specifiy interrupts etc but the driver is fairly simple and does not yet make use of them.

Listed both Joachim and myself as maintainers for this binding on basis it's Joachim's driver but I don't want to volunteer Joachim too strongly to look after this doc.

Quoted 6 lines
---
 .../bindings/iio/accel/fsl,mma7455.yaml       | 82 +++++++++++++++++++
 1 file changed, 82 insertions(+)
maintainer Reviewed-by on v1 4/6
#8 lore raw

Re: [PATCH 4/6] dt-bindings:trivial-devices: Add memsic,mxc4005/mxc6255/mxc6655 entries

In reply to Jonathan Cameron
Quoted 10 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple devices with I2C interface and single interrupt line so entries in trivial devices are sufficient.

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
maintainer Reviewed-by on v1 5/6
#10 lore raw

Re: [PATCH 5/6] dt-bindings:trivial-devices: Add sensortek,stk8312 and sensortek,s8ba50

In reply to Jonathan Cameron
Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Two simple devices. The stk8ba50 datasheet could be found via google, but I only have the driver for the 8312.

Quoted 8 lines

Given they both seem to be 3 axis devices with a single interrupt line, add them to trivial-devices.yaml

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 4 ++++
 1 file changed, 4 insertions(+)
maintainer Reviewed-by on v1 6/6
#12 lore raw

Re: [PATCH 6/6] dt-bindings:iio:adc:adi,ad7298 document bindings

In reply to Jonathan Cameron
Quoted 6 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

The device has a tsens-busy pin, but it's both fiddly and currently ignored by the Linux driver. Given it's not clear whether the binding should be an interrupt, or a GPIO I have left that out for now.

Quoted 6 lines
Cc Michael Hennerich <[email protected]>
---
 .../bindings/iio/adc/adi,ad7298.yaml          | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
#13 lore raw
In reply to Jonathan Cameron
Quoted 9 lines · On Thu, 1 Apr 2021 18:41:06 +0100 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

First of what will probably be one of several sets to slowly but surely add yaml binding docs for all the defacto bindings hiding in IIO drivers. Ultimate I'd like to clear the backlog of these and so go forward with full documenation, but there may be some cases we just decide are too complex to bother. The fsl,mma955x parts are ignored (for now) on that basis (I think we have all the other accelerometers covered now)

Quoted 5 lines

Some of these date back to board file days and some were added by people only interested in ACPI, but all can be instantiated from dt-bindings. A few may simply have slipped through the net during review.

Testing done with hacked up qemu when anything was non trivial.

Series applied with typo fix in patch 1 description that Rob pointed out.

Thanks,

Jonathan

Quoted 22 lines

Jonathan Cameron (6):
dt-bindings:iio:accel:adis16201 and adis16209 bindings dt-bindings:iio:accel:bosch,bma220 device tree binding documentation dt-bindings:iio:accel:fsl,mma7455 binding doc dt-bindings:trivial-devices: Add memsic,mxc4005/mxc6255/mxc6655
entries
dt-bindings:trivial-devices: Add sensortek,stk8312 and
sensortek,s8ba50
dt-bindings:iio:adc:adi,ad7298 document bindings

 .../bindings/iio/accel/adi,adis16201.yaml     | 55 +++++++++++++
 .../bindings/iio/accel/bosch,bma220.yaml      | 50 +++++++++++
 .../bindings/iio/accel/fsl,mma7455.yaml       | 82 +++++++++++++++++++
 .../bindings/iio/adc/adi,ad7298.yaml          | 48 +++++++++++
 .../devicetree/bindings/trivial-devices.yaml  | 10 +++
 5 files changed, 245 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adis16201.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/accel/bosch,bma220.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/accel/fsl,mma7455.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7298.yaml