xref: /linux/Documentation/devicetree/bindings/leds/leds-lgm.yaml (revision ae22a94997b8a03dcb3c922857c203246711f9d4)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/leds/leds-lgm.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Intel Lightning Mountain (LGM) SoC LED Serial Shift Output (SSO) Controller driver
8
9maintainers:
10  - Zhu, Yi Xin <Yixin.zhu@intel.com>
11  - Amireddy Mallikarjuna reddy <mallikarjunax.reddy@intel.com>
12
13properties:
14  compatible:
15    const: intel,lgm-ssoled
16
17  reg:
18    maxItems: 1
19
20  clocks:
21    maxItems: 2
22
23  clock-names:
24    items:
25      - const: sso
26      - const: fpid
27
28  gpio-controller: true
29
30  '#gpio-cells':
31    const: 2
32
33  ngpios:
34    minimum: 0
35    maximum: 32
36    description:
37      Number of GPIOs this controller provides.
38
39  intel,sso-update-rate-hz:
40    description:
41      Blink frequency for SOUTs in Hz.
42
43  led-controller:
44    type: object
45    description:
46      This sub-node must contain a sub-node for each leds.
47
48    additionalProperties: false
49
50    properties:
51      '#address-cells':
52        const: 1
53
54      '#size-cells':
55        const: 0
56
57    patternProperties:
58      "^led@[0-2]$":
59        $ref: common.yaml#
60        unevaluatedProperties: false
61
62        properties:
63          reg:
64            description: Index of the LED.
65            minimum: 0
66            maximum: 2
67
68          led-gpios:
69            maxItems: 1
70
71          intel,sso-hw-trigger:
72            type: boolean
73            description: This property indicates Hardware driven/control LED.
74
75          intel,sso-hw-blink:
76            type: boolean
77            description: This property indicates Enable LED blink by Hardware.
78
79          intel,sso-blink-rate-hz:
80            description: LED HW blink frequency.
81
82          retain-state-suspended:
83            type: boolean
84            description: The suspend state of LED can be retained.
85
86          retain-state-shutdown:
87            type: boolean
88            description: Retain the state of the LED on shutdown.
89
90required:
91  - compatible
92  - reg
93  - clocks
94  - clock-names
95  - "#gpio-cells"
96  - gpio-controller
97
98additionalProperties: false
99
100examples:
101  - |
102    #include <dt-bindings/clock/intel,lgm-clk.h>
103    #include <dt-bindings/leds/common.h>
104
105    ssogpio: ssogpio@e0d40000 {
106      compatible = "intel,lgm-ssoled";
107      reg = <0xE0D40000 0x2E4>;
108      gpio-controller;
109      #gpio-cells = <2>;
110      ngpios = <32>;
111      pinctrl-names = "default";
112      pinctrl-0 = <&pinctrl_ledc>;
113      clocks = <&cgu0 LGM_GCLK_LEDC0>, <&afeclk>;
114      clock-names = "sso", "fpid";
115      intel,sso-update-rate-hz = <250000>;
116
117      led-controller {
118        #address-cells = <1>;
119        #size-cells = <0>;
120
121        led@0 {
122          reg = <0>;
123          function = "gphy";
124          color = <LED_COLOR_ID_GREEN>;
125          led-gpios = <&ssogpio 0 0>;
126        };
127
128        led@2 {
129          reg = <2>;
130          function = LED_FUNCTION_POWER;
131          color = <LED_COLOR_ID_GREEN>;
132          led-gpios = <&ssogpio 23 0>;
133        };
134      };
135    };
136