diff mbox series

[v3,2/2] dt-bindings: leds: Add new as3668 support

Message ID 20250604225838.102910-3-linux@timmermann.space
State Superseded
Headers show
Series Follow-Up: Support for Osram as3668 LED driver | expand

Commit Message

Lukas Timmermann June 4, 2025, 10:58 p.m. UTC
Document Osram as3668 LED driver devicetree bindings.

Signed-off-by: Lukas Timmermann <linux@timmermann.space>
---
 .../devicetree/bindings/leds/leds-as3668.yaml | 76 +++++++++++++++++++
 1 file changed, 76 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-as3668.yaml

Comments

Krzysztof Kozlowski June 5, 2025, 6:21 a.m. UTC | #1
On Thu, Jun 05, 2025 at 12:58:38AM GMT, Lukas Timmermann wrote:
> Document Osram as3668 LED driver devicetree bindings.
> 
> Signed-off-by: Lukas Timmermann <linux@timmermann.space>

Please organize the patch documenting compatible (DT bindings) before their user.
See also: https://elixir.bootlin.com/linux/v6.14-rc6/source/Documentation/devicetree/bindings/submitting-patches.rst#L46

> ---
>  .../devicetree/bindings/leds/leds-as3668.yaml | 76 +++++++++++++++++++
>  1 file changed, 76 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/leds/leds-as3668.yaml
> 
> diff --git a/Documentation/devicetree/bindings/leds/leds-as3668.yaml b/Documentation/devicetree/bindings/leds/leds-as3668.yaml
> new file mode 100644
> index 000000000000..a9d698eb87d2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/leds-as3668.yaml

Filename matching compatible. ams,as3668.yaml


> @@ -0,0 +1,76 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/leds-as3668.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Osram 4-channel i2c LED driver.

Drop full stop

> +
> +maintainers:
> +  - Lukas Timmermann <linux@timmermann.space>
> +
> +description: |

Drop |, Do not need '|' unless you need to preserve formatting.

> +  This IC can drive up to four separate LEDs.
> +  Having four channels suggests it could be used with a single RGBW LED.
> +
> +properties:
> +  compatible:
> +    const: ams,as3668
> +
> +  reg:
> +    maxItems: 1
> +    description:
> +      I2C slave address

Drop description, obvious.

> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0

Missing gpio / pwm / audio input. I guess you omitted it because you do
not know how to implement the audio input part? Bindings should be
complete, so at least mention this in commit msg.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/leds/leds-as3668.yaml b/Documentation/devicetree/bindings/leds/leds-as3668.yaml
new file mode 100644
index 000000000000..a9d698eb87d2
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/leds-as3668.yaml
@@ -0,0 +1,76 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/leds-as3668.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Osram 4-channel i2c LED driver.
+
+maintainers:
+  - Lukas Timmermann <linux@timmermann.space>
+
+description: |
+  This IC can drive up to four separate LEDs.
+  Having four channels suggests it could be used with a single RGBW LED.
+
+properties:
+  compatible:
+    const: ams,as3668
+
+  reg:
+    maxItems: 1
+    description:
+      I2C slave address
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^led@[0-3]$":
+    type: object
+    $ref: common.yaml#
+    unevaluatedProperties: false
+
+    properties:
+      reg:
+        maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/leds/common.h>
+
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      led-controller@42 {
+        compatible = "ams,as3668";
+        reg = <0x42>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        led@0 {
+          reg = <0x0>;
+          function = LED_FUNCTION_STATUS;
+          color = <LED_COLOR_ID_RED>;
+        };
+
+        led@1 {
+          reg = <0x1>;
+          function = LED_FUNCTION_STATUS;
+          color = <LED_COLOR_ID_GREEN>;
+        };
+      };
+    };
+