blob: ddd90e134a1664c58822120fe3f74a50ec3b2534 [file] [log] [blame]
Fenglin Wu50b1eba2017-11-16 08:39:11 +08001Qualcomm Technologies, Inc. LPG driver specific bindings
2
3This binding document describes the properties of LPG (Light Pulse Generator)
4device 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 Wu5e915522018-04-03 08:51:39 +080014 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 Wu50b1eba2017-11-16 08:39:11 +080017
18- reg-names:
19 Usage: required
20 Value type: <string>
21 Definition: The name of the register defined in the reg property.
Fenglin Wu5e915522018-04-03 08:51:39 +080022 It must have "lpg-base", "lut-base" is optional but
23 it's required if any LPG channels support LUT mode.
Fenglin Wu50b1eba2017-11-16 08:39:11 +080024
25- #pwm-cells:
26 Usage: required
27 Value type: <u32>
Fenglin Wu5e915522018-04-03 08:51:39 +080028 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 Wu50b1eba2017-11-16 08:39:11 +080032
Fenglin Wu5e915522018-04-03 08:51:39 +080033- 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
43Subnode is optional if LUT mode is not required, it's required if any LPG
44channels expected to be supported in LUT mode.
45
46Subnode properties:
47Subnodes for each LPG channel (lpg@X) can be defined if any of the following
48parameters 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 Wu50b1eba2017-11-16 08:39:11 +0800108Example:
109
110 pmi8998_lpg: lpg@b100 {
111 compatible = "qcom,pwm-lpg";
Fenglin Wu5e915522018-04-03 08:51:39 +0800112 reg = <0xb100 0x600>, <0xb000 0x100>;
113 reg-names = "lpg-base", "lut-base";
Fenglin Wu50b1eba2017-11-16 08:39:11 +0800114 #pwm-cells = <2>;
Fenglin Wu5e915522018-04-03 08:51:39 +0800115 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 Wu50b1eba2017-11-16 08:39:11 +0800147 };