diff mbox series

[v2,11/20] dt-bindings:iio:adc:motorola,cpcap-adc yaml conversion

Message ID 20200909175946.395313-12-jic23@kernel.org
State Not Applicable, archived
Headers show
Series dt-bindings:iio:adc: Another set of yaml conversions. | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 2 warnings, 51 lines checked
robh/dt-meta-schema success

Commit Message

Jonathan Cameron Sept. 9, 2020, 5:59 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Conversion from txt to yaml.
Slightly expanded example to give a bit more context.
Description lifted from the original driver commit.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Tony Lindgren <tony@atomide.com>
---
 .../devicetree/bindings/iio/adc/cpcap-adc.txt | 17 -------
 .../bindings/iio/adc/motorola,cpcap-adc.yaml  | 51 +++++++++++++++++++
 2 files changed, 51 insertions(+), 17 deletions(-)

Comments

Rob Herring Sept. 15, 2020, 7:11 p.m. UTC | #1
On Wed, Sep 09, 2020 at 06:59:37PM +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Conversion from txt to yaml.
> Slightly expanded example to give a bit more context.
> Description lifted from the original driver commit.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Tony Lindgren <tony@atomide.com>
> ---
>  .../devicetree/bindings/iio/adc/cpcap-adc.txt | 17 -------
>  .../bindings/iio/adc/motorola,cpcap-adc.yaml  | 51 +++++++++++++++++++
>  2 files changed, 51 insertions(+), 17 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/cpcap-adc.txt b/Documentation/devicetree/bindings/iio/adc/cpcap-adc.txt
> deleted file mode 100644
> index ec04008e8f4f..000000000000
> --- a/Documentation/devicetree/bindings/iio/adc/cpcap-adc.txt
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -Motorola CPCAP PMIC ADC binding
> -
> -Required properties:
> -- compatible: Should be "motorola,cpcap-adc" or "motorola,mapphone-cpcap-adc"
> -- interrupts: The interrupt number for the ADC device
> -- interrupt-names: Should be "adcdone"
> -- #io-channel-cells: Number of cells in an IIO specifier
> -
> -Example:
> -
> -cpcap_adc: adc {
> -	compatible = "motorola,mapphone-cpcap-adc";
> -	interrupt-parent = <&cpcap>;
> -	interrupts = <8 IRQ_TYPE_NONE>;
> -	interrupt-names = "adcdone";
> -	#io-channel-cells = <1>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml b/Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml
> new file mode 100644
> index 000000000000..7811c0abd5d0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml
> @@ -0,0 +1,51 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/motorola,cpcap-adc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Motorola CPCAP PMIC ADC binding
> +
> +maintainers:
> +  - Tony Lindgren <tony@atomide.com>
> +
> +description:
> +  On Motorola phones like droid 4 there is a custom CPCAP PMIC. This PMIC
> +  has ADCs that are used for battery charging and USB PHY VBUS and ID pin
> +  detection.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - motorola,cpcap-adc
> +      - motorola,mapphone-cpcap-adc
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  interrupt-names:
> +    const: adcdone
> +
> +  "#io-channel-cells":
> +    const: 1
> +
> +required:
> +  - compatible
> +  - interrupts
> +  - "#io-channel-cells"

additionalProperties: false

With that,

Reviewed-by: Rob Herring <robh@kernel.org>
Jonathan Cameron Sept. 19, 2020, 2:25 p.m. UTC | #2
On Tue, 15 Sep 2020 13:11:01 -0600
Rob Herring <robh@kernel.org> wrote:

> On Wed, Sep 09, 2020 at 06:59:37PM +0100, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > Conversion from txt to yaml.
> > Slightly expanded example to give a bit more context.
> > Description lifted from the original driver commit.
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Tony Lindgren <tony@atomide.com>
> > ---
> >  .../devicetree/bindings/iio/adc/cpcap-adc.txt | 17 -------
> >  .../bindings/iio/adc/motorola,cpcap-adc.yaml  | 51 +++++++++++++++++++
> >  2 files changed, 51 insertions(+), 17 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/adc/cpcap-adc.txt b/Documentation/devicetree/bindings/iio/adc/cpcap-adc.txt
> > deleted file mode 100644
> > index ec04008e8f4f..000000000000
> > --- a/Documentation/devicetree/bindings/iio/adc/cpcap-adc.txt
> > +++ /dev/null
> > @@ -1,17 +0,0 @@
> > -Motorola CPCAP PMIC ADC binding
> > -
> > -Required properties:
> > -- compatible: Should be "motorola,cpcap-adc" or "motorola,mapphone-cpcap-adc"
> > -- interrupts: The interrupt number for the ADC device
> > -- interrupt-names: Should be "adcdone"
> > -- #io-channel-cells: Number of cells in an IIO specifier
> > -
> > -Example:
> > -
> > -cpcap_adc: adc {
> > -	compatible = "motorola,mapphone-cpcap-adc";
> > -	interrupt-parent = <&cpcap>;
> > -	interrupts = <8 IRQ_TYPE_NONE>;
> > -	interrupt-names = "adcdone";
> > -	#io-channel-cells = <1>;
> > -};
> > diff --git a/Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml b/Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml
> > new file mode 100644
> > index 000000000000..7811c0abd5d0
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml
> > @@ -0,0 +1,51 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/adc/motorola,cpcap-adc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Motorola CPCAP PMIC ADC binding
> > +
> > +maintainers:
> > +  - Tony Lindgren <tony@atomide.com>
> > +
> > +description:
> > +  On Motorola phones like droid 4 there is a custom CPCAP PMIC. This PMIC
> > +  has ADCs that are used for battery charging and USB PHY VBUS and ID pin
> > +  detection.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - motorola,cpcap-adc
> > +      - motorola,mapphone-cpcap-adc
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  interrupt-names:
> > +    const: adcdone
> > +
> > +  "#io-channel-cells":
> > +    const: 1
> > +
> > +required:
> > +  - compatible
> > +  - interrupts
> > +  - "#io-channel-cells"  
> 
> additionalProperties: false
Done
> 
> With that,
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied.  Thanks

Jonathan
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/cpcap-adc.txt b/Documentation/devicetree/bindings/iio/adc/cpcap-adc.txt
deleted file mode 100644
index ec04008e8f4f..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/cpcap-adc.txt
+++ /dev/null
@@ -1,17 +0,0 @@ 
-Motorola CPCAP PMIC ADC binding
-
-Required properties:
-- compatible: Should be "motorola,cpcap-adc" or "motorola,mapphone-cpcap-adc"
-- interrupts: The interrupt number for the ADC device
-- interrupt-names: Should be "adcdone"
-- #io-channel-cells: Number of cells in an IIO specifier
-
-Example:
-
-cpcap_adc: adc {
-	compatible = "motorola,mapphone-cpcap-adc";
-	interrupt-parent = <&cpcap>;
-	interrupts = <8 IRQ_TYPE_NONE>;
-	interrupt-names = "adcdone";
-	#io-channel-cells = <1>;
-};
diff --git a/Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml b/Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml
new file mode 100644
index 000000000000..7811c0abd5d0
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml
@@ -0,0 +1,51 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/motorola,cpcap-adc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Motorola CPCAP PMIC ADC binding
+
+maintainers:
+  - Tony Lindgren <tony@atomide.com>
+
+description:
+  On Motorola phones like droid 4 there is a custom CPCAP PMIC. This PMIC
+  has ADCs that are used for battery charging and USB PHY VBUS and ID pin
+  detection.
+
+properties:
+  compatible:
+    enum:
+      - motorola,cpcap-adc
+      - motorola,mapphone-cpcap-adc
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    const: adcdone
+
+  "#io-channel-cells":
+    const: 1
+
+required:
+  - compatible
+  - interrupts
+  - "#io-channel-cells"
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    pmic {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        adc {
+            compatible = "motorola,mapphone-cpcap-adc";
+            interrupt-parent = <&cpcap>;
+            interrupts = <8 IRQ_TYPE_NONE>;
+            interrupt-names = "adcdone";
+            #io-channel-cells = <1>;
+        };
+    };
+...