xref: /freebsd/sys/contrib/device-tree/Bindings/leds/ti,tca6507.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
16be33864SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only
26be33864SEmmanuel Vadot%YAML 1.2
36be33864SEmmanuel Vadot---
46be33864SEmmanuel Vadot$id: http://devicetree.org/schemas/leds/ti,tca6507.yaml#
56be33864SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
66be33864SEmmanuel Vadot
76be33864SEmmanuel Vadottitle: TCA6507 LED and GPIO controller
86be33864SEmmanuel Vadot
96be33864SEmmanuel Vadotmaintainers:
106be33864SEmmanuel Vadot  - NeilBrown <neilb@suse.de>
116be33864SEmmanuel Vadot
126be33864SEmmanuel Vadotdescription:
136be33864SEmmanuel Vadot  The TCA6507 is a programmable LED controller connected via I2C that can drive
146be33864SEmmanuel Vadot  7 separate lines either by holding them low, or by pulsing them with modulated
156be33864SEmmanuel Vadot  width.
166be33864SEmmanuel Vadot
176be33864SEmmanuel Vadotproperties:
186be33864SEmmanuel Vadot  compatible:
196be33864SEmmanuel Vadot    const: ti,tca6507
206be33864SEmmanuel Vadot
216be33864SEmmanuel Vadot  reg:
226be33864SEmmanuel Vadot    description: I2C slave address of the controller.
236be33864SEmmanuel Vadot    maxItems: 1
246be33864SEmmanuel Vadot
256be33864SEmmanuel Vadot  "#address-cells":
266be33864SEmmanuel Vadot    const: 1
276be33864SEmmanuel Vadot
286be33864SEmmanuel Vadot  "#size-cells":
296be33864SEmmanuel Vadot    const: 0
306be33864SEmmanuel Vadot
316be33864SEmmanuel Vadot  gpio-controller: true
326be33864SEmmanuel Vadot
336be33864SEmmanuel Vadot  "#gpio-cells":
346be33864SEmmanuel Vadot    const: 2
356be33864SEmmanuel Vadot
366be33864SEmmanuel Vadot  gpio-line-names: true
376be33864SEmmanuel Vadot
386be33864SEmmanuel VadotpatternProperties:
396be33864SEmmanuel Vadot  "^led@[0-6]$":
406be33864SEmmanuel Vadot    type: object
416be33864SEmmanuel Vadot    $ref: common.yaml#
428bab661aSEmmanuel Vadot    unevaluatedProperties: false
436be33864SEmmanuel Vadot
446be33864SEmmanuel Vadot    properties:
456be33864SEmmanuel Vadot      reg:
466be33864SEmmanuel Vadot        minimum: 0
476be33864SEmmanuel Vadot        maximum: 6
486be33864SEmmanuel Vadot
496be33864SEmmanuel Vadot    required:
506be33864SEmmanuel Vadot      - reg
516be33864SEmmanuel Vadot
526be33864SEmmanuel Vadot  "^gpio@[0-6]$":
536be33864SEmmanuel Vadot    type: object
546be33864SEmmanuel Vadot
556be33864SEmmanuel Vadot    properties:
566be33864SEmmanuel Vadot      compatible:
576be33864SEmmanuel Vadot        const: gpio
586be33864SEmmanuel Vadot
596be33864SEmmanuel Vadot      reg:
606be33864SEmmanuel Vadot        minimum: 0
616be33864SEmmanuel Vadot        maximum: 6
626be33864SEmmanuel Vadot
636be33864SEmmanuel Vadot    additionalProperties: false
646be33864SEmmanuel Vadot
656be33864SEmmanuel Vadot    required:
666be33864SEmmanuel Vadot      - reg
676be33864SEmmanuel Vadot      - compatible
686be33864SEmmanuel Vadot
696be33864SEmmanuel Vadotif:
706be33864SEmmanuel Vadot  patternProperties:
716be33864SEmmanuel Vadot    "^gpio@[0-6]$":
725def4c47SEmmanuel Vadot      type: object
736be33864SEmmanuel Vadot      properties:
746be33864SEmmanuel Vadot        compatible:
756be33864SEmmanuel Vadot          contains:
766be33864SEmmanuel Vadot            const: gpio
776be33864SEmmanuel Vadotthen:
786be33864SEmmanuel Vadot  required:
796be33864SEmmanuel Vadot    - gpio-controller
806be33864SEmmanuel Vadot    - "#gpio-cells"
816be33864SEmmanuel Vadot
826be33864SEmmanuel VadotadditionalProperties: false
836be33864SEmmanuel Vadot
846be33864SEmmanuel Vadotexamples:
856be33864SEmmanuel Vadot  - |
866be33864SEmmanuel Vadot
876be33864SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
886be33864SEmmanuel Vadot    #include <dt-bindings/leds/common.h>
896be33864SEmmanuel Vadot
90*fac71e4eSEmmanuel Vadot    i2c {
916be33864SEmmanuel Vadot        #address-cells = <1>;
926be33864SEmmanuel Vadot        #size-cells = <0>;
936be33864SEmmanuel Vadot
946be33864SEmmanuel Vadot        led-controller@45 {
956be33864SEmmanuel Vadot            compatible = "ti,tca6507";
966be33864SEmmanuel Vadot            #address-cells = <1>;
976be33864SEmmanuel Vadot            #size-cells = <0>;
986be33864SEmmanuel Vadot            reg = <0x45>;
996be33864SEmmanuel Vadot
1006be33864SEmmanuel Vadot            gpio-controller;
1016be33864SEmmanuel Vadot            #gpio-cells = <2>;
1026be33864SEmmanuel Vadot
1036be33864SEmmanuel Vadot            gpio-line-names = "wifi_reset@6";
1046be33864SEmmanuel Vadot
1056be33864SEmmanuel Vadot            led@0 {
1066be33864SEmmanuel Vadot                label = "gta04:red:aux";
1076be33864SEmmanuel Vadot                reg = <0x0>;
1086be33864SEmmanuel Vadot            };
1096be33864SEmmanuel Vadot
1106be33864SEmmanuel Vadot            led@1 {
1116be33864SEmmanuel Vadot                label = "gta04:green:aux";
1126be33864SEmmanuel Vadot                reg = <0x1>;
1136be33864SEmmanuel Vadot            };
1146be33864SEmmanuel Vadot
1156be33864SEmmanuel Vadot            led@3 {
1166be33864SEmmanuel Vadot                reg = <0x3>;
1176be33864SEmmanuel Vadot                color = <LED_COLOR_ID_RED>;
1186be33864SEmmanuel Vadot                function = LED_FUNCTION_POWER;
1196be33864SEmmanuel Vadot                linux,default-trigger = "default-on";
1206be33864SEmmanuel Vadot            };
1216be33864SEmmanuel Vadot
1226be33864SEmmanuel Vadot            led@4 {
1236be33864SEmmanuel Vadot                color = <LED_COLOR_ID_GREEN>;
1246be33864SEmmanuel Vadot                function = LED_FUNCTION_POWER;
1256be33864SEmmanuel Vadot                reg = <0x4>;
1266be33864SEmmanuel Vadot            };
1276be33864SEmmanuel Vadot
1286be33864SEmmanuel Vadot            gpio@6 {
1296be33864SEmmanuel Vadot                compatible = "gpio";
1306be33864SEmmanuel Vadot                reg = <0x6>;
1316be33864SEmmanuel Vadot            };
1326be33864SEmmanuel Vadot        };
1336be33864SEmmanuel Vadot    };
1346be33864SEmmanuel Vadot
1356be33864SEmmanuel Vadot...
136