Amy Maloche | f3d5a06 | 2012-08-16 19:14:11 -0700 | [diff] [blame] | 1 | Qualcomm QPNP Leds |
| 2 | |
| 3 | QPNP (Qualcomm Plug N Play) LEDs driver is used for |
| 4 | controlling LEDs that are part of PMIC on Qualcomm reference |
| 5 | platforms. The PMIC is connected to Host processor via |
| 6 | SPMI bus. This driver supports various LED modules such as |
Amy Maloche | eea7b59 | 2012-10-03 15:59:36 -0700 | [diff] [blame] | 7 | WLED (white LED), RGB LED and flash LED. |
Amy Maloche | f3d5a06 | 2012-08-16 19:14:11 -0700 | [diff] [blame] | 8 | |
Amy Maloche | f3d5a06 | 2012-08-16 19:14:11 -0700 | [diff] [blame] | 9 | Each LED module is represented as a node of "leds-qpnp". This |
Amy Maloche | a5ca555 | 2012-10-23 13:34:46 -0700 | [diff] [blame] | 10 | node will further contain the type of LED supported and its |
Amy Maloche | f9490c6 | 2012-11-27 19:26:04 -0800 | [diff] [blame] | 11 | properties. At least one child node is required for each LED |
| 12 | module. Each must have the required properties below, in addition |
| 13 | to the properties for the LED type, WLED, Flash or RGB. |
Amy Maloche | f3d5a06 | 2012-08-16 19:14:11 -0700 | [diff] [blame] | 14 | |
Amy Maloche | f9490c6 | 2012-11-27 19:26:04 -0800 | [diff] [blame] | 15 | Required properties for each child node, WLED, Flash and RGB: |
| 16 | - compatible : should be "qcom,leds-qpnp" |
Amy Maloche | f3d5a06 | 2012-08-16 19:14:11 -0700 | [diff] [blame] | 17 | - qcom,id : must be one of values supported in enum qpnp_led |
Amy Maloche | a5ca555 | 2012-10-23 13:34:46 -0700 | [diff] [blame] | 18 | - label : type of led that will be used, ie "wled" |
Amy Maloche | f3d5a06 | 2012-08-16 19:14:11 -0700 | [diff] [blame] | 19 | - qcom,max-current : maximum current that the LED can sustain |
Amy Maloche | a5ca555 | 2012-10-23 13:34:46 -0700 | [diff] [blame] | 20 | - linux,name : name of the led that is used in led framework |
Amy Maloche | f3d5a06 | 2012-08-16 19:14:11 -0700 | [diff] [blame] | 21 | |
| 22 | WLED is primarily used as display backlight. Display subsystem uses |
| 23 | LED triggers for WLED to control the brightness as needed. |
| 24 | |
| 25 | Optional properties for WLED: |
| 26 | - qcom,num-strings: number of wled strings supported |
Amy Maloche | a7b68a3 | 2012-11-08 11:18:07 -0800 | [diff] [blame] | 27 | - qcom,ovp-val: over voltage protection threshold, |
Amy Maloche | f3d5a06 | 2012-08-16 19:14:11 -0700 | [diff] [blame] | 28 | follows enum wled_ovp_threshold |
Amy Maloche | a7b68a3 | 2012-11-08 11:18:07 -0800 | [diff] [blame] | 29 | - 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 Maloche | f3d5a06 | 2012-08-16 19:14:11 -0700 | [diff] [blame] | 35 | - 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 Maloche | 864a6d5 | 2012-10-03 15:58:12 -0700 | [diff] [blame] | 38 | Flash is used primarily as a camera or video flash. |
| 39 | |
| 40 | Optional 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 Maloche | eea7b59 | 2012-10-03 15:59:36 -0700 | [diff] [blame] | 49 | RGB Led is a tri-colored led, Red, Blue & Green. |
| 50 | |
| 51 | Required 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 | |
| 56 | Required 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 | |
| 61 | Optional 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 Penso | 55ac847 | 2013-01-21 21:17:37 +0200 | [diff] [blame] | 64 | - 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 Maloche | eea7b59 | 2012-10-03 15:59:36 -0700 | [diff] [blame] | 65 | |
Amy Maloche | f3d5a06 | 2012-08-16 19:14:11 -0700 | [diff] [blame] | 66 | Example: |
| 67 | |
Amy Maloche | eea7b59 | 2012-10-03 15:59:36 -0700 | [diff] [blame] | 68 | 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 Penso | 55ac847 | 2013-01-21 21:17:37 +0200 | [diff] [blame] | 100 | qcom,default-state = "on"; |
| 101 | qcom,turn-off-delay-ms = <500>; |
Amy Maloche | eea7b59 | 2012-10-03 15:59:36 -0700 | [diff] [blame] | 102 | qcom,id = <5>; |
| 103 | linux,default-trigger = "none"; |
| 104 | }; |
Amy Maloche | a5ca555 | 2012-10-23 13:34:46 -0700 | [diff] [blame] | 105 | }; |
| 106 | |
Amy Maloche | 864a6d5 | 2012-10-03 15:58:12 -0700 | [diff] [blame] | 107 | 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 Maloche | eea7b59 | 2012-10-03 15:59:36 -0700 | [diff] [blame] | 126 | |
| 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 | }; |