hc
2024-05-10 10ebd8556b7990499c896a550e3d416b444211e6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/leds/ti,tca6507.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
 
title: TCA6507 LED and GPIO controller
 
maintainers:
  - NeilBrown <neilb@suse.de>
 
description:
  The TCA6507 is a programmable LED controller connected via I2C that can drive
  7 separate lines either by holding them low, or by pulsing them with modulated
  width.
 
properties:
  compatible:
    const: ti,tca6507
 
  reg:
    description: I2C slave address of the controller.
    maxItems: 1
 
  "#address-cells":
    const: 1
 
  "#size-cells":
    const: 0
 
  gpio-controller: true
 
  "#gpio-cells":
    const: 2
 
  gpio-line-names: true
 
patternProperties:
  "^led@[0-6]$":
    type: object
 
    $ref: common.yaml#
 
    properties:
      reg:
        minimum: 0
        maximum: 6
 
    required:
      - reg
 
  "^gpio@[0-6]$":
    type: object
 
    properties:
      compatible:
        const: gpio
 
      reg:
        minimum: 0
        maximum: 6
 
    additionalProperties: false
 
    required:
      - reg
      - compatible
 
if:
  patternProperties:
    "^gpio@[0-6]$":
      properties:
        compatible:
          contains:
            const: gpio
then:
  required:
    - gpio-controller
    - "#gpio-cells"
 
additionalProperties: false
 
examples:
  - |
 
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/leds/common.h>
 
    i2c0 {
        #address-cells = <1>;
        #size-cells = <0>;
 
        led-controller@45 {
            compatible = "ti,tca6507";
            #address-cells = <1>;
            #size-cells = <0>;
            reg = <0x45>;
 
            gpio-controller;
            #gpio-cells = <2>;
 
            gpio-line-names = "wifi_reset@6";
 
            led@0 {
                label = "gta04:red:aux";
                reg = <0x0>;
            };
 
            led@1 {
                label = "gta04:green:aux";
                reg = <0x1>;
            };
 
            led@3 {
                reg = <0x3>;
                color = <LED_COLOR_ID_RED>;
                function = LED_FUNCTION_POWER;
                linux,default-trigger = "default-on";
            };
 
            led@4 {
                color = <LED_COLOR_ID_GREEN>;
                function = LED_FUNCTION_POWER;
                reg = <0x4>;
            };
 
            gpio@6 {
                compatible = "gpio";
                reg = <0x6>;
            };
        };
    };
 
...