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  gpio-controller: true
18
19  '#gpio-cells':
20    const: 2
21
22  ngpios:
23    minimum: 0
24    maximum: 32
25    description:
26      Number of GPIOs this controller provides.
27
28  intel,sso-update-rate-hz:
29    description:
30      Blink frequency for SOUTs in Hz.
31
32  led-controller:
33    type: object
34    description:
35      This sub-node must contain a sub-node for each leds.
36
37    additionalProperties: false
38
39    patternProperties:
40      "^led@[0-23]$":
41        type: object
42
43        properties:
44          reg:
45            description: Index of the LED.
46            minimum: 0
47            maximum: 2
48
49          intel,sso-hw-trigger:
50            type: boolean
51            description: This property indicates Hardware driven/control LED.
52
53          intel,sso-hw-blink:
54            type: boolean
55            description: This property indicates Enable LED blink by Hardware.
56
57          intel,sso-blink-rate-hz:
58            description: LED HW blink frequency.
59
60          retain-state-suspended:
61            type: boolean
62            description: The suspend state of LED can be retained.
63
64          retain-state-shutdown:
65            type: boolean
66            description: Retain the state of the LED on shutdown.
67
68required:
69  - compatible
70  - reg
71  - clocks
72  - clock-names
73  - "#gpio-cells"
74  - gpio-controller
75
76additionalProperties: false
77
78examples:
79  - |
80    #include <dt-bindings/clock/intel,lgm-clk.h>
81    #include <dt-bindings/leds/common.h>
82
83    ssogpio: ssogpio@e0d40000 {
84      compatible = "intel,sso-led";
85      reg = <0xE0D40000 0x2E4>;
86      gpio-controller;
87      #gpio-cells = <2>;
88      ngpios = <32>;
89      pinctrl-names = "default";
90      pinctrl-0 = <&pinctrl_ledc>;
91      clocks = <&cgu0 LGM_GCLK_LEDC0>, <&afeclk>;
92      clock-names = "sso", "fpid";
93      intel,sso-update-rate-hz = <250000>;
94
95      led-controller {
96        #address-cells = <1>;
97        #size-cells = <0>;
98
99        led@0 {
100          reg = <0>;
101          function = "gphy";
102          color = <LED_COLOR_ID_GREEN>;
103          led-gpio = <&ssogpio 0 0>;
104        };
105
106        led@23 {
107          reg = <23>;
108          function = LED_FUNCTION_POWER;
109          color = <LED_COLOR_ID_GREEN>;
110          led-gpio = <&ssogpio 23 0>;
111        };
112      };
113    };
114