diff mbox series

[2/2] dt-bindings: leds: Add bindings for MT6360 LED

Message ID 1598441840-15226-3-git-send-email-gene.chen.richtek@gmail.com (mailing list archive)
State New, archived
Headers show
Series leds: mt6360: Add LED driver for MT6360 | expand

Commit Message

Gene Chen Aug. 26, 2020, 11:37 a.m. UTC
From: Gene Chen <gene_chen@richtek.com>

Add bindings document for LED support on MT6360 PMIC

Signed-off-by: Gene Chen <gene_chen@richtek.com>
---
 .../devicetree/bindings/leds/leds-mt6360.yaml      | 50 ++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-mt6360.yaml

Comments

Dan Murphy Aug. 26, 2020, 11:54 a.m. UTC | #1
Gene

On 8/26/20 6:37 AM, Gene Chen wrote:
> From: Gene Chen <gene_chen@richtek.com>
>
> Add bindings document for LED support on MT6360 PMIC

Usually bindings are 1/x in the patchset.

And you should cc Rob Herring and the Device tree mail list other wise 
the maintainer will not apply this patch without their ACKs


> Signed-off-by: Gene Chen <gene_chen@richtek.com>
> ---
>   .../devicetree/bindings/leds/leds-mt6360.yaml      | 50 ++++++++++++++++++++++
>   1 file changed, 50 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/leds/leds-mt6360.yaml
>
> diff --git a/Documentation/devicetree/bindings/leds/leds-mt6360.yaml b/Documentation/devicetree/bindings/leds/leds-mt6360.yaml
> new file mode 100644
> index 0000000..4598be5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/leds-mt6360.yaml
> @@ -0,0 +1,50 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/leds-mt6360.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LED driver for MT6360 PMIC from MediaTek Integrated.
> +
> +maintainers:
> +  - Gene Chen <gene_chen@richtek.com>
> +
> +description: |
> +  This module is part of the MT6360 MFD device. For more details
> +  see Documentation/devicetree/bindings/mfd/mt6360.yaml.

I think you need to include this yaml using allof tag


> +
> +  The LED controller is represented as a sub-node of the PMIC node on
> +  the device tree.
> +
> +  This device has six current sinks.
> +
> +properties:
> +  compatible:
> +    const: mediatek,mt6360-led
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +patternProperties:
> +  "^led@[0-5]$":
> +    type: object
> +    description: |
> +      Properties for a single LED.
> +
> +    properties:
> +      reg:
> +        description:
> +          Index of the LED.
> +        minimum: 0
> +        maximum: 5
> +
> +required:
> +  - compatible
> +  - "#address-cells"
> +  - "#size-cells"
> +additionalProperties: false
> +
Need a new line


And an example

> +...
Gene Chen Sept. 1, 2020, 3:42 a.m. UTC | #2
Dan Murphy <dmurphy@ti.com> 於 2020年8月26日 週三 下午7:54寫道:
>
> Gene
>
> On 8/26/20 6:37 AM, Gene Chen wrote:
> > From: Gene Chen <gene_chen@richtek.com>
> >
> > Add bindings document for LED support on MT6360 PMIC
>
> Usually bindings are 1/x in the patchset.
>

ACK

> And you should cc Rob Herring and the Device tree mail list other wise
> the maintainer will not apply this patch without their ACKs
>
>

ACK

> > Signed-off-by: Gene Chen <gene_chen@richtek.com>
> > ---
> >   .../devicetree/bindings/leds/leds-mt6360.yaml      | 50 ++++++++++++++++++++++
> >   1 file changed, 50 insertions(+)
> >   create mode 100644 Documentation/devicetree/bindings/leds/leds-mt6360.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/leds/leds-mt6360.yaml b/Documentation/devicetree/bindings/leds/leds-mt6360.yaml
> > new file mode 100644
> > index 0000000..4598be5
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/leds/leds-mt6360.yaml
> > @@ -0,0 +1,50 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/leds/leds-mt6360.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: LED driver for MT6360 PMIC from MediaTek Integrated.
> > +
> > +maintainers:
> > +  - Gene Chen <gene_chen@richtek.com>
> > +
> > +description: |
> > +  This module is part of the MT6360 MFD device. For more details
> > +  see Documentation/devicetree/bindings/mfd/mt6360.yaml.
>
> I think you need to include this yaml using allof tag
>
>

I try add allOf tag
allOf:
 - $ref: "../mfd/mt6360.yaml"

then the required property contains mt6360.yaml, which leads to build dt error.
/media/gene_chen/WD/upstream/linux/Documentation/devicetree/bindings/leds/leds-mt6360.example.dt.yaml:
led-controller: 'reg' is a required property
/media/gene_chen/WD/upstream/linux/Documentation/devicetree/bindings/leds/leds-mt6360.example.dt.yaml:
led-controller: 'interrupt-controller' is a required property
/media/gene_chen/WD/upstream/linux/Documentation/devicetree/bindings/leds/leds-mt6360.example.dt.yaml:
led-controller: '#interrupt-cells' is a required property
/media/gene_chen/WD/upstream/linux/Documentation/devicetree/bindings/leds/leds-mt6360.example.dt.yaml:
led-controller: compatible:0: 'mediatek,mt6360' was expected

I think I can remove this description for misread.

> > +
> > +  The LED controller is represented as a sub-node of the PMIC node on
> > +  the device tree.
> > +
> > +  This device has six current sinks.
> > +
> > +properties:
> > +  compatible:
> > +    const: mediatek,mt6360-led
> > +
> > +  "#address-cells":
> > +    const: 1
> > +
> > +  "#size-cells":
> > +    const: 0
> > +
> > +patternProperties:
> > +  "^led@[0-5]$":
> > +    type: object
> > +    description: |
> > +      Properties for a single LED.
> > +
> > +    properties:
> > +      reg:
> > +        description:
> > +          Index of the LED.
> > +        minimum: 0
> > +        maximum: 5
> > +
> > +required:
> > +  - compatible
> > +  - "#address-cells"
> > +  - "#size-cells"
> > +additionalProperties: false
> > +
> Need a new line
>
>
> And an example
>
> > +...
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/leds/leds-mt6360.yaml b/Documentation/devicetree/bindings/leds/leds-mt6360.yaml
new file mode 100644
index 0000000..4598be5
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-mt6360.yaml
@@ -0,0 +1,50 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/leds-mt6360.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LED driver for MT6360 PMIC from MediaTek Integrated.
+
+maintainers:
+  - Gene Chen <gene_chen@richtek.com>
+
+description: |
+  This module is part of the MT6360 MFD device. For more details
+  see Documentation/devicetree/bindings/mfd/mt6360.yaml.
+
+  The LED controller is represented as a sub-node of the PMIC node on
+  the device tree.
+
+  This device has six current sinks.
+
+properties:
+  compatible:
+    const: mediatek,mt6360-led
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^led@[0-5]$":
+    type: object
+    description: |
+      Properties for a single LED.
+
+    properties:
+      reg:
+        description:
+          Index of the LED.
+        minimum: 0
+        maximum: 5
+
+required:
+  - compatible
+  - "#address-cells"
+  - "#size-cells"
+additionalProperties: false
+
+...