Commit 02a3fa1e authored by Rob Herring's avatar Rob Herring Committed by Lee Jones
Browse files

dt-bindings: leds: Convert Panasonic AN30259A to DT schema



Convert the Panasonic AN30259A 3-channel LED controller binding to DT
schema format.

Signed-off-by: default avatarRob Herring <robh@kernel.org>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230724230258.1017258-1-robh@kernel.org


Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent c8a03943
Loading
Loading
Loading
Loading
+0 −55
Original line number Diff line number Diff line
* Panasonic AN30259A 3-channel LED driver

The AN30259A is a LED controller capable of driving three LEDs independently. It supports
constant current output and sloping current output modes. The chip is connected over I2C.

Required properties:
	- compatible: Must be "panasonic,an30259a".
	- reg: I2C slave address.
	- #address-cells: Must be 1.
	- #size-cells: Must be 0.

Each LED is represented as a sub-node of the panasonic,an30259a node.

Required sub-node properties:
	- reg: Pin that the LED is connected to. Must be 1, 2, or 3.

Optional sub-node properties:
	- function :
		see Documentation/devicetree/bindings/leds/common.txt
	- color :
		see Documentation/devicetree/bindings/leds/common.txt
	- label :
		see Documentation/devicetree/bindings/leds/common.txt (deprecated)
	- linux,default-trigger :
		see Documentation/devicetree/bindings/leds/common.txt

Example:

#include <dt-bindings/leds/common.h>

led-controller@30 {
	compatible = "panasonic,an30259a";
	reg = <0x30>;
	#address-cells = <1>;
	#size-cells = <0>;

	led@1 {
		reg = <1>;
		linux,default-trigger = "heartbeat";
		function = LED_FUNCTION_INDICATOR;
		color = <LED_COLOR_ID_RED>;
	};

	led@2 {
		reg = <2>;
		function = LED_FUNCTION_INDICATOR;
		color = <LED_COLOR_ID_GREEN>;
	};

	led@3 {
		reg = <3>;
		function = LED_FUNCTION_INDICATOR;
		color = <LED_COLOR_ID_BLUE>;
	};
};
+84 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/panasonic,an30259a.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Panasonic AN30259A 3-channel LED controller

maintainers:
  - Iskren Chernev <me@iskren.info>

description:
  The AN30259A is a LED controller capable of driving three LEDs independently.
  It supports constant current output and sloping current output modes. The chip
  is connected over I2C.

properties:
  compatible:
    const: panasonic,an30259a

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

patternProperties:
  "^led@[1-3]$":
    $ref: common.yaml#
    unevaluatedProperties: false

    properties:
      reg:
        enum: [ 1, 2, 3 ]

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@30 {
            compatible = "panasonic,an30259a";
            reg = <0x30>;
            #address-cells = <1>;
            #size-cells = <0>;

            led@1 {
                reg = <1>;
                linux,default-trigger = "heartbeat";
                function = LED_FUNCTION_INDICATOR;
                color = <LED_COLOR_ID_RED>;
            };

            led@2 {
                reg = <2>;
                function = LED_FUNCTION_INDICATOR;
                color = <LED_COLOR_ID_GREEN>;
            };

            led@3 {
                reg = <3>;
                function = LED_FUNCTION_INDICATOR;
                color = <LED_COLOR_ID_BLUE>;
            };
        };
    };
...