summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/leds/leds-qpnp.txt
blob: 9524360436d1966b9575395a4272a56117f4973a (plain)
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
Qualcomm QPNP Leds

QPNP (Qualcomm Plug N Play) LEDs driver is used for
controlling LEDs that are part of PMIC on Qualcomm reference
platforms. The PMIC is connected to Host processor via
SPMI bus. This driver supports various LED modules such as
Keypad backlight, WLED (white LED), RGB LED and flash LED.

Each LED module is represented as a node of "leds-qpnp". This
node will further contain the type of LED supported and its
properties.  At least one child node is required for each LED
module.  Each must have the required properties below, in addition
to the properties for the LED type, WLED, Flash or RGB.

Required properties for each child node, WLED, Flash and RGB:
- compatible		: should be "qcom,leds-qpnp"
- qcom,id		: must be one of values supported in enum qpnp_led
- label			: type of led that will be used, ie "wled"
- qcom,max-current	: maximum current that the LED can sustain
- linux,name		: name of the led that is used in led framework

WLED is primarily used as display backlight. Display subsystem uses
LED triggers for WLED to control the brightness as needed.

Optional properties for WLED:
- qcom,num-strings: number of wled strings supported
- qcom,ovp-val: over voltage protection threshold,
		follows enum wled_ovp_threshold
- qcom,boost-curr-lim: boot currnet limit, follows enum wled_current_bost_limit
- qcom,ctrl-delay-us: delay in activation of led
- qcom,dig-mod-gen-en: digital module generator
- qcom,cs-out-en: current sink output enable
- qcom,op-fdbck: selection of output as feedback for the boost, 00 = automatic selection, 01 = select LED1 output, 02 = select LED2 output, 03 = select LED3 output
- qcom,cp-select: high pole capacitance
- linux,default-trigger: trigger the led from external modules such as display
- qcom,default-state:  default state of the led, should be "on" or "off"

Flash is used primarily as a camera or video flash.

Optional properties for flash:
- qcom,headroom: headroom to use, mV
- qcom,duration: duration of the flash, ms
- qcom,clamp-curr: current to clamp at, mA
- qcom,startup-dly: delay before flashing after flash executed, us
- qcom,saftey-timer: include for safety timer use, otherwise watchdog timer will be used
- linux,default-trigger: trigger the led from external modules such as display
- qcom,default-state:  default state of the led, should be "on" or "off"
- qcom,torch-enable: set flash led to torch mode
- flash_boost-supply: SMBB regulator for LED flash mode
- torch_boost-supply: SMBB regulator for LED torch mode

RGB Led is a tri-colored led, Red, Blue & Green.

Required properties for RGB led:
- qcom,mode: mode the led should operate in, options "pwm" and "lpg"
- qcom,pwm-channel: pwm channel the led will operate on

Required properties for PWM mode only:
- qcom,pwm-us: time the pwm device will modulate at (us)

Required properties for LPG mode only:
- qcom,duty-pcts: array of values for duty cycle to go through
- qcom,start-idx: starting point duty-pcts array

Optional properties for LPG mode only:
- qcom,pause-lo: pause at low end of cycle
- qcom,pause-hi: pause at high end of cycle
- qcom,ramp-step-ms: step between each cycle (ms)
- qcom,lut-flags: flags to be used in lut configuration

Optional properties for RGB led:
- linux,default-trigger: trigger the led from external modules such as display
- qcom,default-state:  default state of the led, should be "on" or "off"
- qcom,turn-off-delay-ms: delay in millisecond for turning off the led when its default-state is "on". Value is being ignored in case default-state is "off".
- qcom,use-blink: Use blink sysfs entry for switching into lpg mode.  For optimal use, set default mode to pwm.  All required lpg parameters must be supplied.

MPP LED is an LED controled through a Multi Purpose Pin.

Optional properties for MPP LED:
- linux,default-trigger: trigger the led from external modules such as display
- qcom,default-state: default state of the led, should be "on" or "off"
- qcom,source-sel: select power source, default 1 (enabled)
- qcom,mode-ctrl: select operation mode, default 0x60 = Mode Sink
- qcom,mode: mode the led should operate in, options "pwm", "lpg" and "manual"
- qcom,vin-ctrl: select input source, supported values are 0 to 3
- qcom,use-blink: Use blink sysfs entry for switching into lpg mode.  For optimal use, set default mode to pwm.  All required lpg parameters must be supplied.
- qcom,min-brightness - Lowest possible brightness supported on this LED other than 0.

Required properties for PWM mode only:
- qcom,pwm-channel: pwm channel the led will operate on
- qcom,pwm-us: time the pwm device will modulate at (us)

Required properties for LPG mode only:
- qcom,pwm-channel: pwm channel the led will operate on
- qcom,duty-pcts: array of values for duty cycle to go through
- qcom,start-idx: starting point duty-pcts array

Optional properties for LPG mode only:
- qcom,pause-lo: pause at low end of cycle
- qcom,pause-hi: pause at high end of cycle
- qcom,ramp-step-ms: step between each cycle (ms)
- qcom,lut-flags: flags to be used in lut configuration

Keypad backlight is a backlight source for buttons. It supports four rows
and the required rows are enabled by specifying values in the properties.

Required properties for keypad backlight:
- qcom,mode: mode the led should operate in, options "pwm" and "lpg"
- qcom,pwm-channel: pwm channel the led will operate on
- qcom,pwm-us: time the pwm device will modulate at (us)
- qcom,row-id: specify the id of the row. Supported values are 0 to 3.

Optional properties for keypad backlight:
- qcom,row-src-vbst: select source for rows. Specify for vbst and ignore it
			for vph_pwr.
- qcom,row-src-en: specify to enable row source
- qcom,always-on: specify if the module has to be always on

Required properties for PWM mode only:
- qcom,pwm-us: time the pwm device will modulate at (us)

Required properties for LPG mode only:
- qcom,duty-pcts: array of values for duty cycle to go through
- qcom,start-idx: starting point duty-pcts array

Optional properties for LPG mode only:
- qcom,pause-lo: pause at low end of cycle
- qcom,pause-hi: pause at high end of cycle
- qcom,ramp-step-ms: step between each cycle (ms)
- qcom,lut-flags: flags to be used in lut configuration

Example:

	qcom,leds@a200 {
		status = "okay";
		qcom,led_mpp_3 {
			label = "mpp";
			linux,name = "wled-backlight";
			linux-default-trigger = "none";
			qcom,default-state = "on";
			qcom,max-current = <40>;
			qcom,id = <6>;
			qcom,source-sel = <1>;
			qcom,mode-ctrl = <0x10>;
			qcom,vin-ctrl = <0x03>;
			qcom,min-brightness = <20>;
		};
	};

	qcom,leds@a300 {
		status = "okay";
		qcom,led_mpp_pwm {
			label = "mpp";
			linux,name = "green";
			linux,default-trigger = "none";
			qcom,default-state = "off";
			qcom,max-current = <40>;
			qcom,current-setting = <5>;
			qcom,id = <6>;
			qcom,mode = "pwm";
			qcom,source-sel = <8>;
			qcom,mode-ctrl = <0x60>;
			qcom,pwm-channel = <0>;
			qcom,pwm-us = <1000>;
		};
	};

	qcom,leds@d000 {
		status = "okay";
		qcom,rgb_pwm {
			label = "rgb";
			linux,name = "led:rgb_red";
			qcom,mode = "pwm";
			qcom,pwm-us = <1000>;
			qcom,pwm-channel = <6>;
			qcom,max-current = <12>;
			qcom,default-state = "off";
			qcom,id = <3>;
			linux,default-trigger =
				"battery-charging";
		};
		qcom,rgb_lpg {
			label = "rgb";
			linux,name = "led:rgb_green";
			qcom,mode = "lpg";
			qcom,pwm-channel = <5>;
			qcom,duty-ms = <20>;
			qcom,start-idx = <1>;
			qcom,idx-len = <10>;
			qcom,duty-pcts = [00 19 32 4B 64
					 64 4B 32 19 00];
			qcom,max-current = <12>;
			qcom,default-state = "off";
			qcom,id = <3>;
			linux,default-trigger =
				"battery-charging";
		};

		qcom,rgb_blink {
			label = "rgb";
			linux,name = "led:rgb_blue";
			qcom,mode = "pwm";
			qcom,pwm-channel = <4>;
			qcom,start-idx = <1>;
			qcom,idx-len = <10>;
			qcom,duty-pcts = [00 19 32 4B 64
					 64 4B 32 19 00];
			qcom,lut-flags = <3>;
			qcom,pause-lo = <0>;
			qcom,pause-hi = <0>;
			qcom,ramp-step-ms = <255>;
			qcom,max-current = <12>;
			qcom,default-state = "on";
			qcom,turn-off-delay-ms = <500>;
			qcom,id = <5>;
			linux,default-trigger = "none";
			qcom,pwm-us = <1000>;
			qcom,use-blink;
		};
	};

	qcom,leds@d300 {
			compatible = "qcom,leds-qpnp";
			status = "okay";
			flash_boost-supply = <&pm8941_chg_boost>;
			torch_boost-supply = <&pm8941_boost>;
			qcom,flash_0 {
				qcom,max-current = <1000>;
				qcom,default-state = "off";
				qcom,headroom = <0>;
				qcom,duration = <200>;
				qcom,clamp-curr = <200>;
				qcom,startup-dly = <1>;
				qcom,safety-timer;
				label = "flash";
				linux,default-trigger =
					"flash0_trigger";
				linux,name = "led:flash_0";
				qcom,current = <625>;
				qcom,id = <1>;
			};
	};

	qcom,leds@d800 {
			compatible = "qcom,leds-qpnp";
			status = "okay";
			qcom,wled_0 {
				linux,default-trigger = "bkl-trigger"
				label = "wled";
				qcom,cs-out-en;
				qcom,op-fdbck = <1>;
				qcom,default-state "off";
				qcom,max-current = <25>;
				qcom,ctrl-delay-us = <0>;
				qcom,boost-curr-lim = <3>;
				qcom,cp-sel = <0>;
				qcom,switch-freq = <2>;
				qcom,ovp-val = <2>;
				qcom,num-strings = <1>;
				qcom,id = <0>;
				linux,name = "led:wled_backlight";
			};
	};

	qcom,leds@e200 {
		status = "okay";

		qcom,kpdbl1 {
			label = "kpdbl";
			linux,name = "kpdbl-pwm-1";
			qcom,mode = <0>;
			qcom,pwm-channel = <8>;
			qcom,pwm-us = <1000>;
			qcom,id = <7>;
			qcom,max-current = <20>;
			qcom,row-id = <0>;
			qcom,row-src-en;
			qcom,always-on;
		};

		qcom,kpdbl2 {
			label = "kpdbl";
			linux,name = "kpdbl-lut-2";
			qcom,mode = <1>;
			qcom,pwm-channel = <9>;
			qcom,pwm-us = <1000>;
			qcom,start-idx = <1>;
			qcom,duty-pcts = [00 00 00 00 64
					64 00 00 00 00];
			qcom,id = <7>;
			qcom,max-current = <20>;
			qcom,row-id = <1>;
			qcom,row-src-en;
		};

	};