blob: 812a895323cd50a5de418c926b1f49c2fad36770 [file] [log] [blame]
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
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
- 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"
RGB Led is a tri-colored led, Red, Blue & Green.
Required properties for RGB led:
- qcom,mode: mode the led should operate in, options 0 = PWM, 1 = 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
- 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".
Example:
qcom,leds@d000 {
status = "okay";
qcom,rgb_pwm {
label = "rgb";
linux,name = "led:rgb_red";
qcom,mode = <0>;
qcom,pwm-channel = <6>;
qcom,pwm-us = <1000>;
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_lpg {
label = "rgb";
linux,name = "led:rgb_blue";
qcom,mode = <1>;
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,leds@d300 {
compatible = "qcom,leds-qpnp";
status = "okay";
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;
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";
};
};