bb730f8752d9c712da60f4efcddc6a95271d9950
[15.05/openwrt.git] / target / linux / ipq806x / patches-3.18 / 122-mfd-devicetree-bindings-Add-Qualcomm-RPM-DT-binding.patch
1 From aa0c4b815045420ea54d5ae5362f5a0190609d46 Mon Sep 17 00:00:00 2001
2 From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
3 Date: Wed, 26 Nov 2014 13:50:59 -0800
4 Subject: [PATCH] mfd: devicetree: bindings: Add Qualcomm RPM DT binding
5
6 Add binding for the Qualcomm Resource Power Manager (RPM) found in 8660,
7 8960 and 8064 based devices.
8
9 Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
10 Signed-off-by: Lee Jones <lee.jones@linaro.org>
11 ---
12  Documentation/devicetree/bindings/mfd/qcom-rpm.txt |  70 ++++++++++
13  include/dt-bindings/mfd/qcom-rpm.h                 | 154 +++++++++++++++++++++
14  2 files changed, 224 insertions(+)
15  create mode 100644 Documentation/devicetree/bindings/mfd/qcom-rpm.txt
16  create mode 100644 include/dt-bindings/mfd/qcom-rpm.h
17
18 diff --git a/Documentation/devicetree/bindings/mfd/qcom-rpm.txt b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
19 new file mode 100644
20 index 0000000..85e3198
21 --- /dev/null
22 +++ b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
23 @@ -0,0 +1,70 @@
24 +Qualcomm Resource Power Manager (RPM)
25 +
26 +This driver is used to interface with the Resource Power Manager (RPM) found in
27 +various Qualcomm platforms. The RPM allows each component in the system to vote
28 +for state of the system resources, such as clocks, regulators and bus
29 +frequencies.
30 +
31 +- compatible:
32 +       Usage: required
33 +       Value type: <string>
34 +       Definition: must be one of:
35 +                   "qcom,rpm-apq8064"
36 +                   "qcom,rpm-msm8660"
37 +                   "qcom,rpm-msm8960"
38 +
39 +- reg:
40 +       Usage: required
41 +       Value type: <prop-encoded-array>
42 +       Definition: base address and size of the RPM's message ram
43 +
44 +- interrupts:
45 +       Usage: required
46 +       Value type: <prop-encoded-array>
47 +       Definition: three entries specifying the RPM's:
48 +                   1. acknowledgement interrupt
49 +                   2. error interrupt
50 +                   3. wakeup interrupt
51 +
52 +- interrupt-names:
53 +       Usage: required
54 +       Value type: <string-array>
55 +       Definition: must be the three strings "ack", "err" and "wakeup", in order
56 +
57 +- #address-cells:
58 +       Usage: required
59 +       Value type: <u32>
60 +       Definition: must be 1
61 +
62 +- #size-cells:
63 +       Usage: required
64 +       Value type: <u32>
65 +       Definition: must be 0
66 +
67 +- qcom,ipc:
68 +       Usage: required
69 +       Value type: <prop-encoded-array>
70 +
71 +       Definition: three entries specifying the outgoing ipc bit used for
72 +                   signaling the RPM:
73 +                   - phandle to a syscon node representing the apcs registers
74 +                   - u32 representing offset to the register within the syscon
75 +                   - u32 representing the ipc bit within the register
76 +
77 +
78 += EXAMPLE
79 +
80 +       #include <dt-bindings/mfd/qcom-rpm.h>
81 +
82 +       rpm@108000 {
83 +               compatible = "qcom,rpm-msm8960";
84 +               reg = <0x108000 0x1000>;
85 +               qcom,ipc = <&apcs 0x8 2>;
86 +
87 +               interrupts = <0 19 0>, <0 21 0>, <0 22 0>;
88 +               interrupt-names = "ack", "err", "wakeup";
89 +
90 +               #address-cells = <1>;
91 +               #size-cells = <0>;
92 +       };
93 +
94 diff --git a/include/dt-bindings/mfd/qcom-rpm.h b/include/dt-bindings/mfd/qcom-rpm.h
95 new file mode 100644
96 index 0000000..388a6f3
97 --- /dev/null
98 +++ b/include/dt-bindings/mfd/qcom-rpm.h
99 @@ -0,0 +1,154 @@
100 +/*
101 + * This header provides constants for the Qualcomm RPM bindings.
102 + */
103 +
104 +#ifndef _DT_BINDINGS_MFD_QCOM_RPM_H
105 +#define _DT_BINDINGS_MFD_QCOM_RPM_H
106 +
107 +/*
108 + * Constants use to identify individual resources in the RPM.
109 + */
110 +#define QCOM_RPM_APPS_FABRIC_ARB               1
111 +#define QCOM_RPM_APPS_FABRIC_CLK               2
112 +#define QCOM_RPM_APPS_FABRIC_HALT              3
113 +#define QCOM_RPM_APPS_FABRIC_IOCTL             4
114 +#define QCOM_RPM_APPS_FABRIC_MODE              5
115 +#define QCOM_RPM_APPS_L2_CACHE_CTL             6
116 +#define QCOM_RPM_CFPB_CLK                      7
117 +#define QCOM_RPM_CXO_BUFFERS                   8
118 +#define QCOM_RPM_CXO_CLK                       9
119 +#define QCOM_RPM_DAYTONA_FABRIC_CLK            10
120 +#define QCOM_RPM_DDR_DMM                       11
121 +#define QCOM_RPM_EBI1_CLK                      12
122 +#define QCOM_RPM_HDMI_SWITCH                   13
123 +#define QCOM_RPM_MMFPB_CLK                     14
124 +#define QCOM_RPM_MM_FABRIC_ARB                 15
125 +#define QCOM_RPM_MM_FABRIC_CLK                 16
126 +#define QCOM_RPM_MM_FABRIC_HALT                        17
127 +#define QCOM_RPM_MM_FABRIC_IOCTL               18
128 +#define QCOM_RPM_MM_FABRIC_MODE                        19
129 +#define QCOM_RPM_PLL_4                         20
130 +#define QCOM_RPM_PM8058_LDO0                   21
131 +#define QCOM_RPM_PM8058_LDO1                   22
132 +#define QCOM_RPM_PM8058_LDO2                   23
133 +#define QCOM_RPM_PM8058_LDO3                   24
134 +#define QCOM_RPM_PM8058_LDO4                   25
135 +#define QCOM_RPM_PM8058_LDO5                   26
136 +#define QCOM_RPM_PM8058_LDO6                   27
137 +#define QCOM_RPM_PM8058_LDO7                   28
138 +#define QCOM_RPM_PM8058_LDO8                   29
139 +#define QCOM_RPM_PM8058_LDO9                   30
140 +#define QCOM_RPM_PM8058_LDO10                  31
141 +#define QCOM_RPM_PM8058_LDO11                  32
142 +#define QCOM_RPM_PM8058_LDO12                  33
143 +#define QCOM_RPM_PM8058_LDO13                  34
144 +#define QCOM_RPM_PM8058_LDO14                  35
145 +#define QCOM_RPM_PM8058_LDO15                  36
146 +#define QCOM_RPM_PM8058_LDO16                  37
147 +#define QCOM_RPM_PM8058_LDO17                  38
148 +#define QCOM_RPM_PM8058_LDO18                  39
149 +#define QCOM_RPM_PM8058_LDO19                  40
150 +#define QCOM_RPM_PM8058_LDO20                  41
151 +#define QCOM_RPM_PM8058_LDO21                  42
152 +#define QCOM_RPM_PM8058_LDO22                  43
153 +#define QCOM_RPM_PM8058_LDO23                  44
154 +#define QCOM_RPM_PM8058_LDO24                  45
155 +#define QCOM_RPM_PM8058_LDO25                  46
156 +#define QCOM_RPM_PM8058_LVS0                   47
157 +#define QCOM_RPM_PM8058_LVS1                   48
158 +#define QCOM_RPM_PM8058_NCP                    49
159 +#define QCOM_RPM_PM8058_SMPS0                  50
160 +#define QCOM_RPM_PM8058_SMPS1                  51
161 +#define QCOM_RPM_PM8058_SMPS2                  52
162 +#define QCOM_RPM_PM8058_SMPS3                  53
163 +#define QCOM_RPM_PM8058_SMPS4                  54
164 +#define QCOM_RPM_PM8821_LDO1                   55
165 +#define QCOM_RPM_PM8821_SMPS1                  56
166 +#define QCOM_RPM_PM8821_SMPS2                  57
167 +#define QCOM_RPM_PM8901_LDO0                   58
168 +#define QCOM_RPM_PM8901_LDO1                   59
169 +#define QCOM_RPM_PM8901_LDO2                   60
170 +#define QCOM_RPM_PM8901_LDO3                   61
171 +#define QCOM_RPM_PM8901_LDO4                   62
172 +#define QCOM_RPM_PM8901_LDO5                   63
173 +#define QCOM_RPM_PM8901_LDO6                   64
174 +#define QCOM_RPM_PM8901_LVS0                   65
175 +#define QCOM_RPM_PM8901_LVS1                   66
176 +#define QCOM_RPM_PM8901_LVS2                   67
177 +#define QCOM_RPM_PM8901_LVS3                   68
178 +#define QCOM_RPM_PM8901_MVS                    69
179 +#define QCOM_RPM_PM8901_SMPS0                  70
180 +#define QCOM_RPM_PM8901_SMPS1                  71
181 +#define QCOM_RPM_PM8901_SMPS2                  72
182 +#define QCOM_RPM_PM8901_SMPS3                  73
183 +#define QCOM_RPM_PM8901_SMPS4                  74
184 +#define QCOM_RPM_PM8921_CLK1                   75
185 +#define QCOM_RPM_PM8921_CLK2                   76
186 +#define QCOM_RPM_PM8921_LDO1                   77
187 +#define QCOM_RPM_PM8921_LDO2                   78
188 +#define QCOM_RPM_PM8921_LDO3                   79
189 +#define QCOM_RPM_PM8921_LDO4                   80
190 +#define QCOM_RPM_PM8921_LDO5                   81
191 +#define QCOM_RPM_PM8921_LDO6                   82
192 +#define QCOM_RPM_PM8921_LDO7                   83
193 +#define QCOM_RPM_PM8921_LDO8                   84
194 +#define QCOM_RPM_PM8921_LDO9                   85
195 +#define QCOM_RPM_PM8921_LDO10                  86
196 +#define QCOM_RPM_PM8921_LDO11                  87
197 +#define QCOM_RPM_PM8921_LDO12                  88
198 +#define QCOM_RPM_PM8921_LDO13                  89
199 +#define QCOM_RPM_PM8921_LDO14                  90
200 +#define QCOM_RPM_PM8921_LDO15                  91
201 +#define QCOM_RPM_PM8921_LDO16                  92
202 +#define QCOM_RPM_PM8921_LDO17                  93
203 +#define QCOM_RPM_PM8921_LDO18                  94
204 +#define QCOM_RPM_PM8921_LDO19                  95
205 +#define QCOM_RPM_PM8921_LDO20                  96
206 +#define QCOM_RPM_PM8921_LDO21                  97
207 +#define QCOM_RPM_PM8921_LDO22                  98
208 +#define QCOM_RPM_PM8921_LDO23                  99
209 +#define QCOM_RPM_PM8921_LDO24                  100
210 +#define QCOM_RPM_PM8921_LDO25                  101
211 +#define QCOM_RPM_PM8921_LDO26                  102
212 +#define QCOM_RPM_PM8921_LDO27                  103
213 +#define QCOM_RPM_PM8921_LDO28                  104
214 +#define QCOM_RPM_PM8921_LDO29                  105
215 +#define QCOM_RPM_PM8921_LVS1                   106
216 +#define QCOM_RPM_PM8921_LVS2                   107
217 +#define QCOM_RPM_PM8921_LVS3                   108
218 +#define QCOM_RPM_PM8921_LVS4                   109
219 +#define QCOM_RPM_PM8921_LVS5                   110
220 +#define QCOM_RPM_PM8921_LVS6                   111
221 +#define QCOM_RPM_PM8921_LVS7                   112
222 +#define QCOM_RPM_PM8921_MVS                    113
223 +#define QCOM_RPM_PM8921_NCP                    114
224 +#define QCOM_RPM_PM8921_SMPS1                  115
225 +#define QCOM_RPM_PM8921_SMPS2                  116
226 +#define QCOM_RPM_PM8921_SMPS3                  117
227 +#define QCOM_RPM_PM8921_SMPS4                  118
228 +#define QCOM_RPM_PM8921_SMPS5                  119
229 +#define QCOM_RPM_PM8921_SMPS6                  120
230 +#define QCOM_RPM_PM8921_SMPS7                  121
231 +#define QCOM_RPM_PM8921_SMPS8                  122
232 +#define QCOM_RPM_PXO_CLK                       123
233 +#define QCOM_RPM_QDSS_CLK                      124
234 +#define QCOM_RPM_SFPB_CLK                      125
235 +#define QCOM_RPM_SMI_CLK                       126
236 +#define QCOM_RPM_SYS_FABRIC_ARB                        127
237 +#define QCOM_RPM_SYS_FABRIC_CLK                        128
238 +#define QCOM_RPM_SYS_FABRIC_HALT               129
239 +#define QCOM_RPM_SYS_FABRIC_IOCTL              130
240 +#define QCOM_RPM_SYS_FABRIC_MODE               131
241 +#define QCOM_RPM_USB_OTG_SWITCH                        132
242 +#define QCOM_RPM_VDDMIN_GPIO                   133
243 +
244 +/*
245 + * Constants used to select force mode for regulators.
246 + */
247 +#define QCOM_RPM_FORCE_MODE_NONE               0
248 +#define QCOM_RPM_FORCE_MODE_LPM                        1
249 +#define QCOM_RPM_FORCE_MODE_HPM                        2
250 +#define QCOM_RPM_FORCE_MODE_AUTO               3
251 +#define QCOM_RPM_FORCE_MODE_BYPASS             4
252 +
253 +#endif
254 -- 
255 2.1.4
256