Fenglin Wu | 50b1eba | 2017-11-16 08:39:11 +0800 | [diff] [blame] | 1 | Qualcomm Technologies, Inc. LPG driver specific bindings |
| 2 | |
| 3 | This binding document describes the properties of LPG (Light Pulse Generator) |
| 4 | device module in Qualcomm Technologies, Inc. PMIC chips. |
| 5 | |
| 6 | - compatible: |
| 7 | Usage: required |
| 8 | Value type: <string> |
| 9 | Definition: Must be "qcom,pwm-lpg". |
| 10 | |
| 11 | - reg: |
| 12 | Usage: required |
| 13 | Value type: <prop-encoded-array> |
Fenglin Wu | 5e91552 | 2018-04-03 08:51:39 +0800 | [diff] [blame] | 14 | Definition: Register base and length for LPG and LUT modules. LPG size |
| 15 | or length available per channel varies depending on the |
| 16 | number of channels in PMIC. |
Fenglin Wu | 50b1eba | 2017-11-16 08:39:11 +0800 | [diff] [blame] | 17 | |
| 18 | - reg-names: |
| 19 | Usage: required |
| 20 | Value type: <string> |
| 21 | Definition: The name of the register defined in the reg property. |
Fenglin Wu | 5e91552 | 2018-04-03 08:51:39 +0800 | [diff] [blame] | 22 | It must have "lpg-base", "lut-base" is optional but |
| 23 | it's required if any LPG channels support LUT mode. |
Fenglin Wu | 50b1eba | 2017-11-16 08:39:11 +0800 | [diff] [blame] | 24 | |
| 25 | - #pwm-cells: |
| 26 | Usage: required |
| 27 | Value type: <u32> |
Fenglin Wu | 5e91552 | 2018-04-03 08:51:39 +0800 | [diff] [blame] | 28 | Definition: The number of cells in "pwms" property specified in |
| 29 | PWM user nodes. It should be 2. The first cell is |
| 30 | the PWM channel ID indexed from 0, and the second |
| 31 | cell is the PWM default period in nanoseconds. |
Fenglin Wu | 50b1eba | 2017-11-16 08:39:11 +0800 | [diff] [blame] | 32 | |
Fenglin Wu | 5e91552 | 2018-04-03 08:51:39 +0800 | [diff] [blame] | 33 | - qcom,lut-patterns: |
| 34 | Usage: optional |
| 35 | Value type: <prop-encoded-array> |
| 36 | Definition: Duty ratios in percentages for LPG working at LUT mode. |
| 37 | These duty ratios will be translated into PWM values |
| 38 | and stored in LUT module. The LUT module has resource |
| 39 | to store 47 PWM values at max and shared for all LPG |
| 40 | channels. This property is required if any LPG channels |
| 41 | support LUT mode. |
| 42 | |
| 43 | Subnode is optional if LUT mode is not required, it's required if any LPG |
| 44 | channels expected to be supported in LUT mode. |
| 45 | |
| 46 | Subnode properties: |
| 47 | Subnodes for each LPG channel (lpg@X) can be defined if any of the following |
| 48 | parameters needs to be configured for that channel. |
| 49 | |
| 50 | - qcom,lpg-chan-id: |
| 51 | Usage: required |
| 52 | Value type: <u32> |
| 53 | Definition: The LPG channel's hardware ID indexed from 1. Allowed |
| 54 | range is 1 - 8. Maximum value depends on the number of |
| 55 | channels supported on PMIC. |
| 56 | |
| 57 | - qcom,ramp-step-ms: |
| 58 | Usage: required |
| 59 | Value type: <u32> |
| 60 | Definition: The step duration in milliseconds for LPG staying at each |
| 61 | duty specified in the LUT pattern. Allowed range is |
| 62 | 1 - 511. |
| 63 | |
| 64 | - qcom,ramp-high-index: |
| 65 | Usage: required |
| 66 | Value type: <u32> |
| 67 | Definition: The high index of the LUT pattern where LPG ends up |
| 68 | ramping to. Allowed range is 1 - 47. |
| 69 | |
| 70 | - qcom,ramp-low-index: |
| 71 | Usage: required |
| 72 | Value type: <u32> |
| 73 | Definition: The low index of the LUT pattern from where LPG begins |
| 74 | ramping from. Allowed range is 0 - 46. |
| 75 | |
| 76 | - qcom,ramp-from-low-to-high: |
| 77 | Usage: optional |
| 78 | Value type: <empty> |
| 79 | Definition: The flag to specify the LPG ramping direction. The ramping |
| 80 | direction is from low index to high index of the LUT |
| 81 | pattern if it's specified. |
| 82 | |
| 83 | - qcom,ramp-pattern-repeat: |
| 84 | Usage: optional |
| 85 | Value type: <empty> |
| 86 | Definition: The flag to specify if LPG would be ramping with the LUT |
| 87 | pattern repeatedly. |
| 88 | |
| 89 | - qcom,ramp-toggle: |
| 90 | Usage: optional |
| 91 | Value type: <empty> |
| 92 | Definition: The flag to specify if LPG would toggle the LUT pattern |
| 93 | in ramping. If toggling enabled, LPG would return to the |
| 94 | low index when high index is reached, or return to the high |
| 95 | index when low index is reached. |
| 96 | |
| 97 | - qcom,ramp-pause-hi-count: |
| 98 | Usage: optional |
| 99 | Value type: <u32> |
| 100 | Definition: The step count that LPG stop the output when it ramped up |
| 101 | to the high index of the LUT. |
| 102 | |
| 103 | - qcom,ramp-pause-lo-count: |
| 104 | Usage: optional |
| 105 | Value type: <u32> |
| 106 | Definition: The step count that LPG stop the output when it ramped up |
| 107 | to the low index of the LUT. |
Fenglin Wu | 50b1eba | 2017-11-16 08:39:11 +0800 | [diff] [blame] | 108 | Example: |
| 109 | |
| 110 | pmi8998_lpg: lpg@b100 { |
| 111 | compatible = "qcom,pwm-lpg"; |
Fenglin Wu | 5e91552 | 2018-04-03 08:51:39 +0800 | [diff] [blame] | 112 | reg = <0xb100 0x600>, <0xb000 0x100>; |
| 113 | reg-names = "lpg-base", "lut-base"; |
Fenglin Wu | 50b1eba | 2017-11-16 08:39:11 +0800 | [diff] [blame] | 114 | #pwm-cells = <2>; |
Fenglin Wu | 5e91552 | 2018-04-03 08:51:39 +0800 | [diff] [blame] | 115 | qcom,lut-patterns = <0 14 28 42 56 70 84 100 |
| 116 | 100 84 70 56 42 28 14 0>; |
| 117 | lpg@3 { |
| 118 | qcom,lpg-chan-id = <3>; |
| 119 | qcom,ramp-step-ms = <200>; |
| 120 | qcom,ramp-pause-hi-count = <10>; |
| 121 | qcom,ramp-pause-lo-count = <10>; |
| 122 | qcom,ramp-low-index = <0>; |
| 123 | qcom,ramp-high-index = <15>; |
| 124 | qcom,ramp-from-low-to-high; |
| 125 | qcom,ramp-pattern-repeat; |
| 126 | }; |
| 127 | lpg@4 { |
| 128 | qcom,lpg-chan-id = <4>; |
| 129 | qcom,ramp-step-ms = <200>; |
| 130 | qcom,ramp-pause-hi-count = <10>; |
| 131 | qcom,ramp-pause-lo-count = <10>; |
| 132 | qcom,ramp-low-index = <0>; |
| 133 | qcom,ramp-high-index = <15>; |
| 134 | qcom,ramp-from-low-to-high; |
| 135 | qcom,ramp-pattern-repeat; |
| 136 | }; |
| 137 | lpg@5 { |
| 138 | qcom,lpg-chan-id = <5>; |
| 139 | qcom,ramp-step-ms = <200>; |
| 140 | qcom,ramp-pause-hi-count = <10>; |
| 141 | qcom,ramp-pause-lo-count = <10>; |
| 142 | qcom,ramp-low-index = <0>; |
| 143 | qcom,ramp-high-index = <15>; |
| 144 | qcom,ramp-from-low-to-high; |
| 145 | qcom,ramp-pattern-repeat; |
| 146 | }; |
Fenglin Wu | 50b1eba | 2017-11-16 08:39:11 +0800 | [diff] [blame] | 147 | }; |