Skip to content

Commit a8e53db

Browse files
anderssonpavelmachek
authored andcommitted
dt-bindings: leds: Add Qualcomm Light Pulse Generator binding
This adds the binding document describing the three hardware blocks related to the Light Pulse Generator found in a wide range of Qualcomm PMICs. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Signed-off-by: Pavel Machek <pavel@ucw.cz>
1 parent 3123109 commit a8e53db

File tree

1 file changed

+173
-0
lines changed

1 file changed

+173
-0
lines changed
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
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-qcom-lpg.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm Light Pulse Generator
8+
9+
maintainers:
10+
- Bjorn Andersson <bjorn.andersson@linaro.org>
11+
12+
description: >
13+
The Qualcomm Light Pulse Generator consists of three different hardware blocks;
14+
a ramp generator with lookup table, the light pulse generator and a three
15+
channel current sink. These blocks are found in a wide range of Qualcomm PMICs.
16+
17+
properties:
18+
compatible:
19+
enum:
20+
- qcom,pm8150b-lpg
21+
- qcom,pm8150l-lpg
22+
- qcom,pm8916-pwm
23+
- qcom,pm8941-lpg
24+
- qcom,pm8994-lpg
25+
- qcom,pmc8180c-lpg
26+
- qcom,pmi8994-lpg
27+
- qcom,pmi8998-lpg
28+
29+
"#pwm-cells":
30+
const: 2
31+
32+
"#address-cells":
33+
const: 1
34+
35+
"#size-cells":
36+
const: 0
37+
38+
qcom,power-source:
39+
$ref: /schemas/types.yaml#/definitions/uint32
40+
description:
41+
power-source used to drive the output, as defined in the datasheet.
42+
Should be specified if the TRILED block is present
43+
enum: [0, 1, 3]
44+
45+
qcom,dtest:
46+
$ref: /schemas/types.yaml#/definitions/uint32-matrix
47+
description: >
48+
A list of integer pairs, where each pair represent the dtest line the
49+
particular channel should be connected to and the flags denoting how the
50+
value should be outputed, as defined in the datasheet. The number of
51+
pairs should be the same as the number of channels.
52+
items:
53+
items:
54+
- description: dtest line to attach
55+
- description: flags for the attachment
56+
57+
multi-led:
58+
type: object
59+
$ref: leds-class-multicolor.yaml#
60+
properties:
61+
"#address-cells":
62+
const: 1
63+
64+
"#size-cells":
65+
const: 0
66+
67+
patternProperties:
68+
"^led@[0-9a-f]$":
69+
type: object
70+
$ref: common.yaml#
71+
72+
patternProperties:
73+
"^led@[0-9a-f]$":
74+
type: object
75+
$ref: common.yaml#
76+
77+
properties:
78+
reg: true
79+
80+
required:
81+
- reg
82+
83+
required:
84+
- compatible
85+
86+
additionalProperties: false
87+
88+
examples:
89+
- |
90+
#include <dt-bindings/leds/common.h>
91+
92+
led-controller {
93+
compatible = "qcom,pmi8994-lpg";
94+
95+
#address-cells = <1>;
96+
#size-cells = <0>;
97+
98+
qcom,power-source = <1>;
99+
100+
qcom,dtest = <0 0>,
101+
<0 0>,
102+
<0 0>,
103+
<4 1>;
104+
105+
led@1 {
106+
reg = <1>;
107+
color = <LED_COLOR_ID_GREEN>;
108+
function = LED_FUNCTION_INDICATOR;
109+
function-enumerator = <1>;
110+
};
111+
112+
led@2 {
113+
reg = <2>;
114+
color = <LED_COLOR_ID_GREEN>;
115+
function = LED_FUNCTION_INDICATOR;
116+
function-enumerator = <0>;
117+
default-state = "on";
118+
};
119+
120+
led@3 {
121+
reg = <3>;
122+
color = <LED_COLOR_ID_GREEN>;
123+
function = LED_FUNCTION_INDICATOR;
124+
function-enumerator = <2>;
125+
};
126+
127+
led@4 {
128+
reg = <4>;
129+
color = <LED_COLOR_ID_GREEN>;
130+
function = LED_FUNCTION_INDICATOR;
131+
function-enumerator = <3>;
132+
};
133+
};
134+
- |
135+
#include <dt-bindings/leds/common.h>
136+
137+
led-controller {
138+
compatible = "qcom,pmi8994-lpg";
139+
140+
#address-cells = <1>;
141+
#size-cells = <0>;
142+
143+
qcom,power-source = <1>;
144+
145+
multi-led {
146+
color = <LED_COLOR_ID_RGB>;
147+
function = LED_FUNCTION_STATUS;
148+
149+
#address-cells = <1>;
150+
#size-cells = <0>;
151+
152+
led@1 {
153+
reg = <1>;
154+
color = <LED_COLOR_ID_RED>;
155+
};
156+
157+
led@2 {
158+
reg = <2>;
159+
color = <LED_COLOR_ID_GREEN>;
160+
};
161+
162+
led@3 {
163+
reg = <3>;
164+
color = <LED_COLOR_ID_BLUE>;
165+
};
166+
};
167+
};
168+
- |
169+
pwm-controller {
170+
compatible = "qcom,pm8916-pwm";
171+
#pwm-cells = <2>;
172+
};
173+
...

0 commit comments

Comments
 (0)