diff mbox series

[09/46] dt-bindings:iio:health:maxim,max30100: txt to yaml conversion

Message ID 20201031184854.745828-10-jic23@kernel.org
State New
Headers show
Series dt-bindings:iio: yet more txt to yam conversions | expand

Commit Message

Jonathan Cameron Oct. 31, 2020, 6:48 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>


Straight forward conversion. As with other bindings I've dropped
any standrd description, but kept the unusual bits, in thisscase
the maxim,led-current-microamp and it's description.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

---
 .../bindings/iio/health/max30100.txt          | 28 ----------
 .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++
 2 files changed, 52 insertions(+), 28 deletions(-)

-- 
2.28.0

Comments

Matt Ranostay Oct. 31, 2020, 9:41 p.m. UTC | #1
On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:
>

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

>

> Straight forward conversion. As with other bindings I've dropped

> any standrd description, but kept the unusual bits, in thisscase

> the maxim,led-current-microamp and it's description.

>

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---

>  .../bindings/iio/health/max30100.txt          | 28 ----------

>  .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++

>  2 files changed, 52 insertions(+), 28 deletions(-)

>

> diff --git a/Documentation/devicetree/bindings/iio/health/max30100.txt b/Documentation/devicetree/bindings/iio/health/max30100.txt

> deleted file mode 100644

> index 0054908a6e74..000000000000

> --- a/Documentation/devicetree/bindings/iio/health/max30100.txt

> +++ /dev/null

> @@ -1,28 +0,0 @@

> -Maxim MAX30100 heart rate and pulse oximeter sensor

> -

> -* https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf

> -

> -Required properties:

> -  - compatible: must be "maxim,max30100"

> -  - reg: the I2C address of the sensor

> -  - interrupts: the sole interrupt generated by the device

> -

> -  Refer to interrupt-controller/interrupts.txt for generic

> -  interrupt client node bindings.

> -

> -Optional properties:

> -  - maxim,led-current-microamp: configuration for LED current in microamperes

> -    while the engine is running. First indexed value is the configuration for

> -    the RED LED, and second value is for the IR LED.

> -

> -    Refer to the datasheet for the allowed current values.

> -

> -Example:

> -

> -max30100@57 {

> -       compatible = "maxim,max30100";

> -       reg = <0x57>;

> -       maxim,led-current-microamp = <24000 50000>;

> -       interrupt-parent = <&gpio1>;

> -       interrupts = <16 2>;

> -};

> diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml

> new file mode 100644

> index 000000000000..5684f2f61bcc

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml

> @@ -0,0 +1,52 @@

> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)

> +%YAML 1.2

> +---

> +$id: http://devicetree.org/schemas/iio/health/maxim,max30100.yaml#

> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> +

> +title: Maxim MAX30100 heart rate and pulse oximeter sensor

> +

> +maintainers:

> +  - Matt Ranostay <mranostay@gmail.com>


Please change to my Konsulko email, but otherwise LGTM

Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>


> +

> +properties:

> +  compatible:

> +    const: maxim,max30100

> +

> +  reg:

> +    maxItems: 1

> +

> +  interrupts:

> +    maxItems: 1

> +    description: Connected to ADC_RDY pin.

> +

> +  maxim,led-current-microamp:

> +    $ref: /schemas/types.yaml#/definitions/uint32-array

> +    minItems: 2

> +    maxItems: 2

> +    description: |

> +      LED current whilst the engine is running. First indexed value is

> +      the configuration for the RED LED, and second value is for the IR LED.

> +

> +additionalProperties: false

> +

> +required:

> +  - compatible

> +  - reg

> +  - interrupts

> +

> +examples:

> +  - |

> +    i2c {

> +        #address-cells = <1>;

> +        #size-cells = <0>;

> +

> +        heart-rate@57 {

> +            compatible = "maxim,max30100";

> +            reg = <0x57>;

> +            maxim,led-current-microamp = <24000 50000>;

> +            interrupt-parent = <&gpio1>;

> +            interrupts = <16 2>;

> +        };

> +    };

> +...

> --

> 2.28.0

>
Jonathan Cameron Nov. 22, 2020, 4:58 p.m. UTC | #2
On Sat, 31 Oct 2020 14:41:56 -0700
Matt Ranostay <matt.ranostay@konsulko.com> wrote:

> On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:

> >

> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> >

> > Straight forward conversion. As with other bindings I've dropped

> > any standrd description, but kept the unusual bits, in thisscase

> > the maxim,led-current-microamp and it's description.

> >

> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> > ---

> >  .../bindings/iio/health/max30100.txt          | 28 ----------

> >  .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++

> >  2 files changed, 52 insertions(+), 28 deletions(-)

> >

> > diff --git a/Documentation/devicetree/bindings/iio/health/max30100.txt b/Documentation/devicetree/bindings/iio/health/max30100.txt

> > deleted file mode 100644

> > index 0054908a6e74..000000000000

> > --- a/Documentation/devicetree/bindings/iio/health/max30100.txt

> > +++ /dev/null

> > @@ -1,28 +0,0 @@

> > -Maxim MAX30100 heart rate and pulse oximeter sensor

> > -

> > -* https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf

> > -

> > -Required properties:

> > -  - compatible: must be "maxim,max30100"

> > -  - reg: the I2C address of the sensor

> > -  - interrupts: the sole interrupt generated by the device

> > -

> > -  Refer to interrupt-controller/interrupts.txt for generic

> > -  interrupt client node bindings.

> > -

> > -Optional properties:

> > -  - maxim,led-current-microamp: configuration for LED current in microamperes

> > -    while the engine is running. First indexed value is the configuration for

> > -    the RED LED, and second value is for the IR LED.

> > -

> > -    Refer to the datasheet for the allowed current values.

> > -

> > -Example:

> > -

> > -max30100@57 {

> > -       compatible = "maxim,max30100";

> > -       reg = <0x57>;

> > -       maxim,led-current-microamp = <24000 50000>;

> > -       interrupt-parent = <&gpio1>;

> > -       interrupts = <16 2>;

> > -};

> > diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml

> > new file mode 100644

> > index 000000000000..5684f2f61bcc

> > --- /dev/null

> > +++ b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml

> > @@ -0,0 +1,52 @@

> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)

> > +%YAML 1.2

> > +---

> > +$id: http://devicetree.org/schemas/iio/health/maxim,max30100.yaml#

> > +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > +

> > +title: Maxim MAX30100 heart rate and pulse oximeter sensor

> > +

> > +maintainers:

> > +  - Matt Ranostay <mranostay@gmail.com>  

> 

> Please change to my Konsulko email, but otherwise LGTM

> 

> Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>

Fixed and also dropped the $ref for the *microamp item below
as that's already covered by dt-schema as Rob pointed out for another
occurrence.

Applied to the togreg branch of iio.git and pushed out as testing for
all the normal reasons.

Thanks,

Jonathan

> 

> > +

> > +properties:

> > +  compatible:

> > +    const: maxim,max30100

> > +

> > +  reg:

> > +    maxItems: 1

> > +

> > +  interrupts:

> > +    maxItems: 1

> > +    description: Connected to ADC_RDY pin.

> > +

> > +  maxim,led-current-microamp:

> > +    $ref: /schemas/types.yaml#/definitions/uint32-array

> > +    minItems: 2

> > +    maxItems: 2

> > +    description: |

> > +      LED current whilst the engine is running. First indexed value is

> > +      the configuration for the RED LED, and second value is for the IR LED.

> > +

> > +additionalProperties: false

> > +

> > +required:

> > +  - compatible

> > +  - reg

> > +  - interrupts

> > +

> > +examples:

> > +  - |

> > +    i2c {

> > +        #address-cells = <1>;

> > +        #size-cells = <0>;

> > +

> > +        heart-rate@57 {

> > +            compatible = "maxim,max30100";

> > +            reg = <0x57>;

> > +            maxim,led-current-microamp = <24000 50000>;

> > +            interrupt-parent = <&gpio1>;

> > +            interrupts = <16 2>;

> > +        };

> > +    };

> > +...

> > --

> > 2.28.0

> >
Jonathan Cameron Nov. 22, 2020, 5:24 p.m. UTC | #3
On Sun, 22 Nov 2020 16:58:56 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> On Sat, 31 Oct 2020 14:41:56 -0700

> Matt Ranostay <matt.ranostay@konsulko.com> wrote:

> 

> > On Sat, Oct 31, 2020 at 11:51 AM Jonathan Cameron <jic23@kernel.org> wrote:  

> > >

> > > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> > >

> > > Straight forward conversion. As with other bindings I've dropped

> > > any standrd description, but kept the unusual bits, in thisscase

> > > the maxim,led-current-microamp and it's description.

> > >

> > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> > > ---

> > >  .../bindings/iio/health/max30100.txt          | 28 ----------

> > >  .../bindings/iio/health/maxim,max30100.yaml   | 52 +++++++++++++++++++

> > >  2 files changed, 52 insertions(+), 28 deletions(-)

> > >

> > > diff --git a/Documentation/devicetree/bindings/iio/health/max30100.txt b/Documentation/devicetree/bindings/iio/health/max30100.txt

> > > deleted file mode 100644

> > > index 0054908a6e74..000000000000

> > > --- a/Documentation/devicetree/bindings/iio/health/max30100.txt

> > > +++ /dev/null

> > > @@ -1,28 +0,0 @@

> > > -Maxim MAX30100 heart rate and pulse oximeter sensor

> > > -

> > > -* https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf

> > > -

> > > -Required properties:

> > > -  - compatible: must be "maxim,max30100"

> > > -  - reg: the I2C address of the sensor

> > > -  - interrupts: the sole interrupt generated by the device

> > > -

> > > -  Refer to interrupt-controller/interrupts.txt for generic

> > > -  interrupt client node bindings.

> > > -

> > > -Optional properties:

> > > -  - maxim,led-current-microamp: configuration for LED current in microamperes

> > > -    while the engine is running. First indexed value is the configuration for

> > > -    the RED LED, and second value is for the IR LED.

> > > -

> > > -    Refer to the datasheet for the allowed current values.

> > > -

> > > -Example:

> > > -

> > > -max30100@57 {

> > > -       compatible = "maxim,max30100";

> > > -       reg = <0x57>;

> > > -       maxim,led-current-microamp = <24000 50000>;

> > > -       interrupt-parent = <&gpio1>;

> > > -       interrupts = <16 2>;

> > > -};

> > > diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml

> > > new file mode 100644

> > > index 000000000000..5684f2f61bcc

> > > --- /dev/null

> > > +++ b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml

> > > @@ -0,0 +1,52 @@

> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)

> > > +%YAML 1.2

> > > +---

> > > +$id: http://devicetree.org/schemas/iio/health/maxim,max30100.yaml#

> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#

> > > +

> > > +title: Maxim MAX30100 heart rate and pulse oximeter sensor

> > > +

> > > +maintainers:

> > > +  - Matt Ranostay <mranostay@gmail.com>    

> > 

> > Please change to my Konsulko email, but otherwise LGTM

> > 

> > Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>  

> Fixed and also dropped the $ref for the *microamp item below

> as that's already covered by dt-schema as Rob pointed out for another

> occurrence.


I should really not send my replies at the same time as build tests are
running.   I've put the ref back in because without it I'm getting a build
warning.

maxim,max30100.example.dt.yaml: heart-rate@57: maxim,led-current-microamp: [[24000, 50000]] is too short

I assume that is because we have <24000, 50000> whereas it could have been
<24000>, <50000> but I don't get why having the ref to the same type
as implied by microamp doesn't work.

I've backed it out for now.   @Rob, what am I missing here?

I've applied it for now on basis that it can't do any harm, but would like to
understand what is going on here.

Thanks,

Jonathan
	
> 

> Applied to the togreg branch of iio.git and pushed out as testing for

> all the normal reasons.

> 

> Thanks,

> 

> Jonathan

> 

> >   

> > > +

> > > +properties:

> > > +  compatible:

> > > +    const: maxim,max30100

> > > +

> > > +  reg:

> > > +    maxItems: 1

> > > +

> > > +  interrupts:

> > > +    maxItems: 1

> > > +    description: Connected to ADC_RDY pin.

> > > +

> > > +  maxim,led-current-microamp:

> > > +    $ref: /schemas/types.yaml#/definitions/uint32-array

> > > +    minItems: 2

> > > +    maxItems: 2

> > > +    description: |

> > > +      LED current whilst the engine is running. First indexed value is

> > > +      the configuration for the RED LED, and second value is for the IR LED.

> > > +

> > > +additionalProperties: false

> > > +

> > > +required:

> > > +  - compatible

> > > +  - reg

> > > +  - interrupts

> > > +

> > > +examples:

> > > +  - |

> > > +    i2c {

> > > +        #address-cells = <1>;

> > > +        #size-cells = <0>;

> > > +

> > > +        heart-rate@57 {

> > > +            compatible = "maxim,max30100";

> > > +            reg = <0x57>;

> > > +            maxim,led-current-microamp = <24000 50000>;

> > > +            interrupt-parent = <&gpio1>;

> > > +            interrupts = <16 2>;

> > > +        };

> > > +    };

> > > +...

> > > --

> > > 2.28.0

> > >    

>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/health/max30100.txt b/Documentation/devicetree/bindings/iio/health/max30100.txt
deleted file mode 100644
index 0054908a6e74..000000000000
--- a/Documentation/devicetree/bindings/iio/health/max30100.txt
+++ /dev/null
@@ -1,28 +0,0 @@ 
-Maxim MAX30100 heart rate and pulse oximeter sensor
-
-* https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf
-
-Required properties:
-  - compatible: must be "maxim,max30100"
-  - reg: the I2C address of the sensor
-  - interrupts: the sole interrupt generated by the device
-
-  Refer to interrupt-controller/interrupts.txt for generic
-  interrupt client node bindings.
-
-Optional properties:
-  - maxim,led-current-microamp: configuration for LED current in microamperes
-    while the engine is running. First indexed value is the configuration for
-    the RED LED, and second value is for the IR LED.
-
-    Refer to the datasheet for the allowed current values.
-
-Example:
-
-max30100@57 {
-	compatible = "maxim,max30100";
-	reg = <0x57>;
-	maxim,led-current-microamp = <24000 50000>;
-	interrupt-parent = <&gpio1>;
-	interrupts = <16 2>;
-};
diff --git a/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
new file mode 100644
index 000000000000..5684f2f61bcc
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
@@ -0,0 +1,52 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/health/maxim,max30100.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim MAX30100 heart rate and pulse oximeter sensor
+
+maintainers:
+  - Matt Ranostay <mranostay@gmail.com>
+
+properties:
+  compatible:
+    const: maxim,max30100
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+    description: Connected to ADC_RDY pin.
+
+  maxim,led-current-microamp:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    minItems: 2
+    maxItems: 2
+    description: |
+      LED current whilst the engine is running. First indexed value is
+      the configuration for the RED LED, and second value is for the IR LED.
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        heart-rate@57 {
+            compatible = "maxim,max30100";
+            reg = <0x57>;
+            maxim,led-current-microamp = <24000 50000>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <16 2>;
+        };
+    };
+...