blob: b9bac1dac89e21345059abb895241ac52c81e76b [file] [log] [blame]
Amy Malochef3d5a062012-08-16 19:14:11 -07001Qualcomm QPNP Leds
2
3QPNP (Qualcomm Plug N Play) LEDs driver is used for
4controlling LEDs that are part of PMIC on Qualcomm reference
5platforms. The PMIC is connected to Host processor via
6SPMI bus. This driver supports various LED modules such as
Amy Malocheeea7b592012-10-03 15:59:36 -07007WLED (white LED), RGB LED and flash LED.
Amy Malochef3d5a062012-08-16 19:14:11 -07008
Amy Malochef3d5a062012-08-16 19:14:11 -07009Each LED module is represented as a node of "leds-qpnp". This
Amy Malochea5ca5552012-10-23 13:34:46 -070010node will further contain the type of LED supported and its
Amy Malochef9490c62012-11-27 19:26:04 -080011properties. At least one child node is required for each LED
12module. Each must have the required properties below, in addition
13to the properties for the LED type, WLED, Flash or RGB.
Amy Malochef3d5a062012-08-16 19:14:11 -070014
Amy Malochef9490c62012-11-27 19:26:04 -080015Required properties for each child node, WLED, Flash and RGB:
16- compatible : should be "qcom,leds-qpnp"
Amy Malochef3d5a062012-08-16 19:14:11 -070017- qcom,id : must be one of values supported in enum qpnp_led
Amy Malochea5ca5552012-10-23 13:34:46 -070018- label : type of led that will be used, ie "wled"
Amy Malochef3d5a062012-08-16 19:14:11 -070019- qcom,max-current : maximum current that the LED can sustain
Amy Malochea5ca5552012-10-23 13:34:46 -070020- linux,name : name of the led that is used in led framework
Amy Malochef3d5a062012-08-16 19:14:11 -070021
22WLED is primarily used as display backlight. Display subsystem uses
23LED triggers for WLED to control the brightness as needed.
24
25Optional properties for WLED:
26- qcom,num-strings: number of wled strings supported
Amy Malochea7b68a32012-11-08 11:18:07 -080027- qcom,ovp-val: over voltage protection threshold,
Amy Malochef3d5a062012-08-16 19:14:11 -070028 follows enum wled_ovp_threshold
Amy Malochea7b68a32012-11-08 11:18:07 -080029- qcom,boost-curr-lim: boot currnet limit, follows enum wled_current_bost_limit
30- qcom,ctrl-delay-us: delay in activation of led
31- qcom,dig-mod-gen-en: digital module generator
32- qcom,cs-out-en: current sink output enable
33- qcom,op-fdbck: selection of output as feedback for the boost
34- qcom,cp-select: high pole capacitance
Amy Malochef3d5a062012-08-16 19:14:11 -070035- linux,default-trigger: trigger the led from external modules such as display
36- qcom,default-state: default state of the led, should be "on" or "off"
37
Amy Maloche864a6d52012-10-03 15:58:12 -070038Flash is used primarily as a camera or video flash.
39
40Optional properties for flash:
41- qcom,headroom: headroom to use, mV
42- qcom,duration: duration of the flash, ms
43- qcom,clamp-curr: current to clamp at, mA
44- qcom,startup-dly: delay before flashing after flash executed, us
45- qcom,saftey-timer: include for safety timer use, otherwise watchdog timer will be used
46- linux,default-trigger: trigger the led from external modules such as display
47- qcom,default-state: default state of the led, should be "on" or "off"
48
Amy Malocheeea7b592012-10-03 15:59:36 -070049RGB Led is a tri-colored led, Red, Blue & Green.
50
51Required properties for RGB led:
52- qcom,mode: mode the led should operate in, options 0 = PWM, 1 = LPG
53- qcom,pwm-channel: pwm channel the led will operate on
54- qcom,pwm-us: time the pwm device will modulate at (us)
55
56Required properties for LPG mode only:
57- qcom,duty-ms: duty cycle time the led will operate at (ms)
58- qcom,duty-pcts: array of values for duty cycle to go through
59- qcom,start-idx: starting point duty-pcts array
60
61Optional properties for RGB led:
62- linux,default-trigger: trigger the led from external modules such as display
63- qcom,default-state: default state of the led, should be "on" or "off"
Asaf Penso55ac8472013-01-21 21:17:37 +020064- 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".
Amy Malocheeea7b592012-10-03 15:59:36 -070065
Amy Malochef3d5a062012-08-16 19:14:11 -070066Example:
67
Amy Malocheeea7b592012-10-03 15:59:36 -070068 qcom,leds@d000 {
69 status = "okay";
70 qcom,rgb_pwm {
71 label = "rgb";
72 linux,name = "led:rgb_red";
73 qcom,mode = <0>;
74 qcom,pwm-channel = <6>;
75 qcom,pwm-us = <1000>;
76 qcom,duty-ms = <20>;
77 qcom,start-idx = <1>;
78 qcom,idx-len = <10>;
79 qcom,duty-pcts = [00 19 32 4B 64
80 64 4B 32 19 00];
81 qcom,max-current = <12>;
82 qcom,default-state = "off";
83 qcom,id = <3>;
84 linux,default-trigger =
85 "battery-charging";
86 };
87
88 qcom,rgb_lpg {
89 label = "rgb";
90 linux,name = "led:rgb_blue";
91 qcom,mode = <1>;
92 qcom,pwm-channel = <4>;
93 qcom,pwm-us = <1000>;
94 qcom,duty-ms = <20>;
95 qcom,start-idx = <1>;
96 qcom,idx-len = <10>;
97 qcom,duty-pcts = [00 19 32 4B 64
98 64 4B 32 19 00];
99 qcom,max-current = <12>;
Asaf Penso55ac8472013-01-21 21:17:37 +0200100 qcom,default-state = "on";
101 qcom,turn-off-delay-ms = <500>;
Amy Malocheeea7b592012-10-03 15:59:36 -0700102 qcom,id = <5>;
103 linux,default-trigger = "none";
104 };
Amy Malochea5ca5552012-10-23 13:34:46 -0700105 };
106
Amy Maloche864a6d52012-10-03 15:58:12 -0700107 qcom,leds@d300 {
108 compatible = "qcom,leds-qpnp";
109 status = "okay";
110 qcom,flash_0 {
111 qcom,max-current = <1000>;
112 qcom,default-state = "off";
113 qcom,headroom = <0>;
114 qcom,duration = <200>;
115 qcom,clamp-curr = <200>;
116 qcom,startup-dly = <1>;
117 qcom,safety-timer;
118 label = "flash";
119 linux,default-trigger =
120 "flash0_trigger";
121 linux,name = "led:flash_0";
122 qcom,current = <625>;
123 qcom,id = <1>;
124 };
125 };
Amy Malocheeea7b592012-10-03 15:59:36 -0700126
127 qcom,leds@d800 {
128 compatible = "qcom,leds-qpnp";
129 status = "okay";
130 qcom,wled_0 {
131 linux,default-trigger = "bkl-trigger"
132 label = "wled";
133 qcom,cs-out-en;
134 qcom,op-fdbck;
135 qcom,default-state "off";
136 qcom,max-current = <25>;
137 qcom,ctrl-delay-us = <0>;
138 qcom,boost-curr-lim = <3>;
139 qcom,cp-sel = <0>;
140 qcom,switch-freq = <2>;
141 qcom,ovp-val = <2>;
142 qcom,num-strings = <1>;
143 qcom,id = <0>;
144 linux,name = "led:wled_backlight";
145 };
146 };