diff mbox series

[v2,2/4] dt-bindings: iio: imu: bmi160: add regulators and mount-matrix

Message ID 20200519075111.6356-3-jonathan.albrieux@gmail.com (mailing list archive)
State New, archived
Headers show
Series iio: imu: bmi160: added regulator and mount-matrix support | expand

Commit Message

Jonathan Albrieux May 19, 2020, 7:50 a.m. UTC
Add vdd-supply and vddio-supply support.
Add mount-matrix support.

Signed-off-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
---
 .../devicetree/bindings/iio/imu/bmi160.yaml   | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

Jonathan Cameron May 19, 2020, 5:51 p.m. UTC | #1
On Tue, 19 May 2020 09:50:58 +0200
Jonathan Albrieux <jonathan.albrieux@gmail.com> wrote:

> Add vdd-supply and vddio-supply support.
> Add mount-matrix support.
> 
> Signed-off-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>

A few minor comments inline.

> ---
>  .../devicetree/bindings/iio/imu/bmi160.yaml   | 21 +++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/imu/bmi160.yaml b/Documentation/devicetree/bindings/iio/imu/bmi160.yaml
> index 6b464ce5ed0b..5b13af7a209f 100644
> --- a/Documentation/devicetree/bindings/iio/imu/bmi160.yaml
> +++ b/Documentation/devicetree/bindings/iio/imu/bmi160.yaml
> @@ -46,6 +46,21 @@ properties:
>        set if the specified interrupt pin should be configured as
>        open drain. If not set, defaults to push-pull.
>  
> +  vdd-supply:
> +    maxItems: 1
> +    description: |
> +      an optional regulator that needs to be on to provide VDD power to
> +      the sensor.

They aren't optional.  Whether we specify them or rely on stub regulators
being provided because they aren't controllable is the optional bit.
That's clearly defined by them not being in the required list below.
So say something li.e

   description: |
      provide VDD power to the sensor.

> +
> +  vddio-supply:
> +    maxItems: 1
> +    description: |
> +      an optional regulator that needs to be on to provide the VDD IO power to
> +      the sensor.
> +
> +  mount-matrix:
> +    description: an optional 3x3 mounting rotation matrix
> +
>  required:
>    - compatible
>    - reg
> @@ -61,9 +76,15 @@ examples:
>          bmi160@68 {
>                  compatible = "bosch,bmi160";
>                  reg = <0x68>;
> +                vdd-supply = <&pm8916_l17>;
> +                vddio-supply = <&pm8916_l6>;
>                  interrupt-parent = <&gpio4>;
>                  interrupts = <12 1>;
>                  interrupt-names = "INT1";
> +                mount-matrix = "0", "1", "0",
> +                               "-1", "0", "0",
> +                               "0", "0", "1";
> +                };
>          };
>    - |
>      // Example for SPI
Jonathan Albrieux May 20, 2020, 7:11 a.m. UTC | #2
On Tue, May 19, 2020 at 06:51:59PM +0100, Jonathan Cameron wrote:
> On Tue, 19 May 2020 09:50:58 +0200
> Jonathan Albrieux <jonathan.albrieux@gmail.com> wrote:
> 
> > Add vdd-supply and vddio-supply support.
> > Add mount-matrix support.
> > 
> > Signed-off-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
> 
> A few minor comments inline.
> 
> > ---
> >  .../devicetree/bindings/iio/imu/bmi160.yaml   | 21 +++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/imu/bmi160.yaml b/Documentation/devicetree/bindings/iio/imu/bmi160.yaml
> > index 6b464ce5ed0b..5b13af7a209f 100644
> > --- a/Documentation/devicetree/bindings/iio/imu/bmi160.yaml
> > +++ b/Documentation/devicetree/bindings/iio/imu/bmi160.yaml
> > @@ -46,6 +46,21 @@ properties:
> >        set if the specified interrupt pin should be configured as
> >        open drain. If not set, defaults to push-pull.
> >  
> > +  vdd-supply:
> > +    maxItems: 1
> > +    description: |
> > +      an optional regulator that needs to be on to provide VDD power to
> > +      the sensor.
> 
> They aren't optional.  Whether we specify them or rely on stub regulators
> being provided because they aren't controllable is the optional bit.
> That's clearly defined by them not being in the required list below.
> So say something li.e
> 
>    description: |
>       provide VDD power to the sensor.
>

Oh ok thank you, will work on that

> > +
> > +  vddio-supply:
> > +    maxItems: 1
> > +    description: |
> > +      an optional regulator that needs to be on to provide the VDD IO power to
> > +      the sensor.
> > +
> > +  mount-matrix:
> > +    description: an optional 3x3 mounting rotation matrix
> > +
> >  required:
> >    - compatible
> >    - reg
> > @@ -61,9 +76,15 @@ examples:
> >          bmi160@68 {
> >                  compatible = "bosch,bmi160";
> >                  reg = <0x68>;
> > +                vdd-supply = <&pm8916_l17>;
> > +                vddio-supply = <&pm8916_l6>;
> >                  interrupt-parent = <&gpio4>;
> >                  interrupts = <12 1>;
> >                  interrupt-names = "INT1";
> > +                mount-matrix = "0", "1", "0",
> > +                               "-1", "0", "0",
> > +                               "0", "0", "1";
> > +                };
> >          };
> >    - |
> >      // Example for SPI
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/imu/bmi160.yaml b/Documentation/devicetree/bindings/iio/imu/bmi160.yaml
index 6b464ce5ed0b..5b13af7a209f 100644
--- a/Documentation/devicetree/bindings/iio/imu/bmi160.yaml
+++ b/Documentation/devicetree/bindings/iio/imu/bmi160.yaml
@@ -46,6 +46,21 @@  properties:
       set if the specified interrupt pin should be configured as
       open drain. If not set, defaults to push-pull.
 
+  vdd-supply:
+    maxItems: 1
+    description: |
+      an optional regulator that needs to be on to provide VDD power to
+      the sensor.
+
+  vddio-supply:
+    maxItems: 1
+    description: |
+      an optional regulator that needs to be on to provide the VDD IO power to
+      the sensor.
+
+  mount-matrix:
+    description: an optional 3x3 mounting rotation matrix
+
 required:
   - compatible
   - reg
@@ -61,9 +76,15 @@  examples:
         bmi160@68 {
                 compatible = "bosch,bmi160";
                 reg = <0x68>;
+                vdd-supply = <&pm8916_l17>;
+                vddio-supply = <&pm8916_l6>;
                 interrupt-parent = <&gpio4>;
                 interrupts = <12 1>;
                 interrupt-names = "INT1";
+                mount-matrix = "0", "1", "0",
+                               "-1", "0", "0",
+                               "0", "0", "1";
+                };
         };
   - |
     // Example for SPI