ca492fa95eba9db9208828be77d069800e9e4c3f
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-3.0 / pm-wip / voltdm / 0128-OMAP3-VP-cleanup-move-VP-instance-into-voltdm-misc.-.patch
1 From 01a2c40556e32f58671943d04de9acd1bcd850e0 Mon Sep 17 00:00:00 2001
2 From: Kevin Hilman <khilman@ti.com>
3 Date: Mon, 4 Apr 2011 15:25:07 -0700
4 Subject: [PATCH 128/149] OMAP3+: VP: cleanup: move VP instance into voltdm, misc. renames
6 - move VP instance struct from vdd_info into struct voltage domain
7 - remove _data suffix from structure name
8 - rename vp_ prefix from vp_common field: accesses are now vp->common
9 - move vp_enabled bool from vdd_info into VP instance
10 - remove remaining references to omap_vdd_info
12 No functional changes.
14 Signed-off-by: Kevin Hilman <khilman@ti.com>
15 ---
16 arch/arm/mach-omap2/vc.c | 11 +--
17 arch/arm/mach-omap2/voltage.c | 4 +-
18 arch/arm/mach-omap2/voltage.h | 6 +--
19 arch/arm/mach-omap2/voltagedomains3xxx_data.c | 10 +--
20 arch/arm/mach-omap2/voltagedomains44xx_data.c | 15 ++---
21 arch/arm/mach-omap2/vp.c | 88 ++++++++++++-------------
22 arch/arm/mach-omap2/vp.h | 24 ++++---
23 arch/arm/mach-omap2/vp3xxx_data.c | 10 ++--
24 arch/arm/mach-omap2/vp44xx_data.c | 14 ++--
25 9 files changed, 83 insertions(+), 99 deletions(-)
27 diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c
28 index cee8fba..7058585 100644
29 --- a/arch/arm/mach-omap2/vc.c
30 +++ b/arch/arm/mach-omap2/vc.c
31 @@ -98,11 +98,8 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
32 struct omap_vc_channel *vc = voltdm->vc;
33 struct omap_vdd_info *vdd = voltdm->vdd;
34 struct omap_volt_data *volt_data;
35 - const struct omap_vp_common_data *vp_common;
36 u32 vc_cmdval, vp_errgain_val;
38 - vp_common = vdd->vp_data->vp_common;
39 -
40 /* Check if sufficient pmic info is available for this vdd */
41 if (!voltdm->pmic) {
42 pr_err("%s: Insufficient pmic info to scale the vdd_%s\n",
43 @@ -139,12 +136,12 @@ int omap_vc_pre_scale(struct voltagedomain *voltdm,
45 /* Setting vp errorgain based on the voltage */
46 if (volt_data) {
47 - vp_errgain_val = voltdm->read(vdd->vp_data->vpconfig);
48 + vp_errgain_val = voltdm->read(voltdm->vp->vpconfig);
49 vdd->vp_rt_data.vpconfig_errorgain = volt_data->vp_errgain;
50 - vp_errgain_val &= ~vp_common->vpconfig_errorgain_mask;
51 + vp_errgain_val &= voltdm->vp->common->vpconfig_errorgain_mask;
52 vp_errgain_val |= vdd->vp_rt_data.vpconfig_errorgain <<
53 - vp_common->vpconfig_errorgain_shift;
54 - voltdm->write(vp_errgain_val, vdd->vp_data->vpconfig);
55 + voltdm->vp->common->vpconfig_errorgain_shift;
56 + voltdm->write(vp_errgain_val, voltdm->vp->vpconfig);
57 }
59 return 0;
60 diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
61 index 94f7fc4..c22b53c 100644
62 --- a/arch/arm/mach-omap2/voltage.c
63 +++ b/arch/arm/mach-omap2/voltage.c
64 @@ -81,11 +81,11 @@ static int __init _config_common_vdd_data(struct voltagedomain *voltdm)
66 /* Generic voltage parameters */
67 vdd->volt_scale = omap_vp_forceupdate_scale;
68 - vdd->vp_enabled = false;
69 + voltdm->vp->enabled = false;
71 vdd->vp_rt_data.vpconfig_erroroffset =
72 (voltdm->pmic->vp_erroroffset <<
73 - vdd->vp_data->vp_common->vpconfig_erroroffset_shift);
74 + voltdm->vp->common->vpconfig_erroroffset_shift);
76 timeout_val = (sys_clk_speed * voltdm->pmic->vp_timeout_us) / 1000;
77 vdd->vp_rt_data.vlimitto_timeout = timeout_val;
78 diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
79 index a0ae5c6..65f94c7 100644
80 --- a/arch/arm/mach-omap2/voltage.h
81 +++ b/arch/arm/mach-omap2/voltage.h
82 @@ -68,6 +68,7 @@ struct voltagedomain {
83 struct list_head pwrdm_list;
84 struct omap_vc_channel *vc;
85 const struct omap_vfsm_instance *vfsm;
86 + struct omap_vp_instance *vp;
87 struct omap_voltdm_pmic *pmic;
89 /* VC/VP register access functions: SoC specific */
90 @@ -134,21 +135,16 @@ struct omap_voltdm_pmic {
91 *
92 * @volt_data : voltage table having the distinct voltages supported
93 * by the domain and other associated per voltage data.
94 - * @vp_data : the register values, shifts, masks for various
95 - * vp registers
96 * @vp_rt_data : VP data derived at runtime, not predefined
97 * @debug_dir : debug directory for this voltage domain.
98 * @curr_volt : current voltage for this vdd.
99 - * @vp_enabled : flag to keep track of whether vp is enabled or not
100 * @volt_scale : API to scale the voltage of the vdd.
101 */
102 struct omap_vdd_info {
103 struct omap_volt_data *volt_data;
104 - struct omap_vp_instance_data *vp_data;
105 struct omap_vp_runtime_data vp_rt_data;
106 struct dentry *debug_dir;
107 u32 curr_volt;
108 - bool vp_enabled;
110 int (*volt_scale) (struct voltagedomain *voltdm,
111 unsigned long target_volt);
112 diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
113 index 4ea9a7b..4db2c6c 100644
114 --- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
115 +++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
116 @@ -37,9 +37,7 @@ static const struct omap_vfsm_instance omap3_vdd1_vfsm = {
117 .voltsetup_mask = OMAP3430_SETUP_TIME1_MASK,
118 };
120 -static struct omap_vdd_info omap3_vdd1_info = {
121 - .vp_data = &omap3_vp1_data,
122 -};
123 +static struct omap_vdd_info omap3_vdd1_info;
125 static const struct omap_vfsm_instance omap3_vdd2_vfsm = {
126 .voltsetup_reg = OMAP3_PRM_VOLTSETUP1_OFFSET,
127 @@ -47,9 +45,7 @@ static const struct omap_vfsm_instance omap3_vdd2_vfsm = {
128 .voltsetup_mask = OMAP3430_SETUP_TIME2_MASK,
129 };
131 -static struct omap_vdd_info omap3_vdd2_info = {
132 - .vp_data = &omap3_vp2_data,
133 -};
134 +static struct omap_vdd_info omap3_vdd2_info;
136 static struct voltagedomain omap3_voltdm_mpu = {
137 .name = "mpu_iva",
138 @@ -59,6 +55,7 @@ static struct voltagedomain omap3_voltdm_mpu = {
139 .rmw = omap3_prm_vcvp_rmw,
140 .vc = &omap3_vc_mpu,
141 .vfsm = &omap3_vdd1_vfsm,
142 + .vp = &omap3_vp_mpu,
143 .vdd = &omap3_vdd1_info,
144 };
146 @@ -70,6 +67,7 @@ static struct voltagedomain omap3_voltdm_core = {
147 .rmw = omap3_prm_vcvp_rmw,
148 .vc = &omap3_vc_core,
149 .vfsm = &omap3_vdd2_vfsm,
150 + .vp = &omap3_vp_core,
151 .vdd = &omap3_vdd2_info,
152 };
154 diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c
155 index dd4bd22..3e7cb4e 100644
156 --- a/arch/arm/mach-omap2/voltagedomains44xx_data.c
157 +++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c
158 @@ -36,25 +36,19 @@ static const struct omap_vfsm_instance omap4_vdd_mpu_vfsm = {
159 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET,
160 };
162 -static struct omap_vdd_info omap4_vdd_mpu_info = {
163 - .vp_data = &omap4_vp_mpu_data,
164 -};
165 +static struct omap_vdd_info omap4_vdd_mpu_info;
167 static const struct omap_vfsm_instance omap4_vdd_iva_vfsm = {
168 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_IVA_RET_SLEEP_OFFSET,
169 };
171 -static struct omap_vdd_info omap4_vdd_iva_info = {
172 - .vp_data = &omap4_vp_iva_data,
173 -};
174 +static struct omap_vdd_info omap4_vdd_iva_info;
176 static const struct omap_vfsm_instance omap4_vdd_core_vfsm = {
177 .voltsetup_reg = OMAP4_PRM_VOLTSETUP_CORE_RET_SLEEP_OFFSET,
178 };
180 -static struct omap_vdd_info omap4_vdd_core_info = {
181 - .vp_data = &omap4_vp_core_data,
182 -};
183 +static struct omap_vdd_info omap4_vdd_core_info;
185 static struct voltagedomain omap4_voltdm_mpu = {
186 .name = "mpu",
187 @@ -64,6 +58,7 @@ static struct voltagedomain omap4_voltdm_mpu = {
188 .rmw = omap4_prm_vcvp_rmw,
189 .vc = &omap4_vc_mpu,
190 .vfsm = &omap4_vdd_mpu_vfsm,
191 + .vp = &omap4_vp_mpu,
192 .vdd = &omap4_vdd_mpu_info,
193 };
195 @@ -75,6 +70,7 @@ static struct voltagedomain omap4_voltdm_iva = {
196 .rmw = omap4_prm_vcvp_rmw,
197 .vc = &omap4_vc_iva,
198 .vfsm = &omap4_vdd_iva_vfsm,
199 + .vp = &omap4_vp_iva,
200 .vdd = &omap4_vdd_iva_info,
201 };
203 @@ -86,6 +82,7 @@ static struct voltagedomain omap4_voltdm_core = {
204 .rmw = omap4_prm_vcvp_rmw,
205 .vc = &omap4_vc_core,
206 .vfsm = &omap4_vdd_core_vfsm,
207 + .vp = &omap4_vp_core,
208 .vdd = &omap4_vdd_core_info,
209 };
211 diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
212 index a3afcbe..53d6018 100644
213 --- a/arch/arm/mach-omap2/vp.c
214 +++ b/arch/arm/mach-omap2/vp.c
215 @@ -14,7 +14,7 @@ static void __init vp_debugfs_init(struct voltagedomain *voltdm);
217 static void vp_latch_vsel(struct voltagedomain *voltdm)
218 {
219 - struct omap_vp_instance_data *vp = voltdm->vdd->vp_data;
220 + struct omap_vp_instance *vp = voltdm->vp;
221 u32 vpconfig;
222 unsigned long uvdc;
223 char vsel;
224 @@ -35,14 +35,14 @@ static void vp_latch_vsel(struct voltagedomain *voltdm)
225 vsel = voltdm->pmic->uv_to_vsel(uvdc);
227 vpconfig = voltdm->read(vp->vpconfig);
228 - vpconfig &= ~(vp->vp_common->vpconfig_initvoltage_mask |
229 - vp->vp_common->vpconfig_initvdd);
230 - vpconfig |= vsel << vp->vp_common->vpconfig_initvoltage_shift;
231 + vpconfig &= ~(vp->common->vpconfig_initvoltage_mask |
232 + vp->common->vpconfig_initvdd);
233 + vpconfig |= vsel << vp->common->vpconfig_initvoltage_shift;
235 voltdm->write(vpconfig, vp->vpconfig);
237 /* Trigger initVDD value copy to voltage processor */
238 - voltdm->write((vpconfig | vp->vp_common->vpconfig_initvdd),
239 + voltdm->write((vpconfig | vp->common->vpconfig_initvdd),
240 vp->vpconfig);
242 /* Clear initVDD copy trigger bit */
243 @@ -52,7 +52,7 @@ static void vp_latch_vsel(struct voltagedomain *voltdm)
244 /* Generic voltage init functions */
245 void __init omap_vp_init(struct voltagedomain *voltdm)
246 {
247 - struct omap_vp_instance_data *vp = voltdm->vdd->vp_data;
248 + struct omap_vp_instance *vp = voltdm->vp;
249 struct omap_vdd_info *vdd = voltdm->vdd;
250 u32 vp_val;
252 @@ -64,28 +64,28 @@ void __init omap_vp_init(struct voltagedomain *voltdm)
254 vp_val = vdd->vp_rt_data.vpconfig_erroroffset |
255 (vdd->vp_rt_data.vpconfig_errorgain <<
256 - vp->vp_common->vpconfig_errorgain_shift) |
257 - vp->vp_common->vpconfig_timeouten;
258 + vp->common->vpconfig_errorgain_shift) |
259 + vp->common->vpconfig_timeouten;
260 voltdm->write(vp_val, vp->vpconfig);
262 vp_val = ((vdd->vp_rt_data.vstepmin_smpswaittimemin <<
263 - vp->vp_common->vstepmin_smpswaittimemin_shift) |
264 + vp->common->vstepmin_smpswaittimemin_shift) |
265 (vdd->vp_rt_data.vstepmin_stepmin <<
266 - vp->vp_common->vstepmin_stepmin_shift));
267 + vp->common->vstepmin_stepmin_shift));
268 voltdm->write(vp_val, vp->vstepmin);
270 vp_val = ((vdd->vp_rt_data.vstepmax_smpswaittimemax <<
271 - vp->vp_common->vstepmax_smpswaittimemax_shift) |
272 + vp->common->vstepmax_smpswaittimemax_shift) |
273 (vdd->vp_rt_data.vstepmax_stepmax <<
274 - vp->vp_common->vstepmax_stepmax_shift));
275 + vp->common->vstepmax_stepmax_shift));
276 voltdm->write(vp_val, vp->vstepmax);
278 vp_val = ((vdd->vp_rt_data.vlimitto_vddmax <<
279 - vp->vp_common->vlimitto_vddmax_shift) |
280 + vp->common->vlimitto_vddmax_shift) |
281 (vdd->vp_rt_data.vlimitto_vddmin <<
282 - vp->vp_common->vlimitto_vddmin_shift) |
283 + vp->common->vlimitto_vddmin_shift) |
284 (vdd->vp_rt_data.vlimitto_timeout <<
285 - vp->vp_common->vlimitto_timeout_shift));
286 + vp->common->vlimitto_timeout_shift));
287 voltdm->write(vp_val, vp->vlimitto);
289 vp_debugfs_init(voltdm);
290 @@ -95,7 +95,7 @@ void __init omap_vp_init(struct voltagedomain *voltdm)
291 int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
292 unsigned long target_volt)
293 {
294 - struct omap_vp_instance_data *vp = voltdm->vdd->vp_data;
295 + struct omap_vp_instance *vp = voltdm->vp;
296 u32 vpconfig;
297 u8 target_vsel, current_vsel;
298 int ret, timeout = 0;
299 @@ -109,8 +109,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
300 * is <3us
301 */
302 while (timeout++ < VP_TRANXDONE_TIMEOUT) {
303 - vp->vp_common->ops->clear_txdone(vp->id);
304 - if (!vp->vp_common->ops->check_txdone(vp->id))
305 + vp->common->ops->clear_txdone(vp->id);
306 + if (!vp->common->ops->check_txdone(vp->id))
307 break;
308 udelay(1);
309 }
310 @@ -122,19 +122,19 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
312 /* Configure for VP-Force Update */
313 vpconfig = voltdm->read(vp->vpconfig);
314 - vpconfig &= ~(vp->vp_common->vpconfig_initvdd |
315 - vp->vp_common->vpconfig_forceupdate |
316 - vp->vp_common->vpconfig_initvoltage_mask);
317 + vpconfig &= ~(vp->common->vpconfig_initvdd |
318 + vp->common->vpconfig_forceupdate |
319 + vp->common->vpconfig_initvoltage_mask);
320 vpconfig |= ((target_vsel <<
321 - vp->vp_common->vpconfig_initvoltage_shift));
322 + vp->common->vpconfig_initvoltage_shift));
323 voltdm->write(vpconfig, vp->vpconfig);
325 /* Trigger initVDD value copy to voltage processor */
326 - vpconfig |= vp->vp_common->vpconfig_initvdd;
327 + vpconfig |= vp->common->vpconfig_initvdd;
328 voltdm->write(vpconfig, vp->vpconfig);
330 /* Force update of voltage */
331 - vpconfig |= vp->vp_common->vpconfig_forceupdate;
332 + vpconfig |= vp->common->vpconfig_forceupdate;
333 voltdm->write(vpconfig, vp->vpconfig);
335 /*
336 @@ -142,7 +142,7 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
337 * Depends on SMPSWAITTIMEMIN/MAX and voltage change
338 */
339 timeout = 0;
340 - omap_test_timeout(vp->vp_common->ops->check_txdone(vp->id),
341 + omap_test_timeout(vp->common->ops->check_txdone(vp->id),
342 VP_TRANXDONE_TIMEOUT, timeout);
343 if (timeout >= VP_TRANXDONE_TIMEOUT)
344 pr_err("%s: vdd_%s TRANXDONE timeout exceeded."
345 @@ -157,8 +157,8 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
346 */
347 timeout = 0;
348 while (timeout++ < VP_TRANXDONE_TIMEOUT) {
349 - vp->vp_common->ops->clear_txdone(vp->id);
350 - if (!vp->vp_common->ops->check_txdone(vp->id))
351 + vp->common->ops->clear_txdone(vp->id);
352 + if (!vp->common->ops->check_txdone(vp->id))
353 break;
354 udelay(1);
355 }
356 @@ -170,10 +170,10 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
358 vpconfig = voltdm->read(vp->vpconfig);
359 /* Clear initVDD copy trigger bit */
360 - vpconfig &= ~vp->vp_common->vpconfig_initvdd;
361 + vpconfig &= ~vp->common->vpconfig_initvdd;
362 voltdm->write(vpconfig, vp->vpconfig);
363 /* Clear force bit */
364 - vpconfig &= ~vp->vp_common->vpconfig_forceupdate;
365 + vpconfig &= ~vp->common->vpconfig_forceupdate;
366 voltdm->write(vpconfig, vp->vpconfig);
368 return 0;
369 @@ -187,8 +187,7 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm,
370 */
371 unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm)
372 {
373 - struct omap_vp_instance_data *vp = voltdm->vdd->vp_data;
374 - struct omap_vdd_info *vdd;
375 + struct omap_vp_instance *vp = voltdm->vp;
376 u8 curr_vsel;
378 if (!voltdm || IS_ERR(voltdm)) {
379 @@ -196,7 +195,6 @@ unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm)
380 return 0;
381 }
383 - vdd = voltdm->vdd;
384 if (!voltdm->read) {
385 pr_err("%s: No read API for reading vdd_%s regs\n",
386 __func__, voltdm->name);
387 @@ -223,8 +221,7 @@ unsigned long omap_vp_get_curr_volt(struct voltagedomain *voltdm)
388 */
389 void omap_vp_enable(struct voltagedomain *voltdm)
390 {
391 - struct omap_vp_instance_data *vp;
392 - struct omap_vdd_info *vdd;
393 + struct omap_vp_instance *vp;
394 u32 vpconfig;
396 if (!voltdm || IS_ERR(voltdm)) {
397 @@ -232,8 +229,7 @@ void omap_vp_enable(struct voltagedomain *voltdm)
398 return;
399 }
401 - vdd = voltdm->vdd;
402 - vp = voltdm->vdd->vp_data;
403 + vp = voltdm->vp;
404 if (!voltdm->read || !voltdm->write) {
405 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
406 __func__, voltdm->name);
407 @@ -241,16 +237,16 @@ void omap_vp_enable(struct voltagedomain *voltdm)
408 }
410 /* If VP is already enabled, do nothing. Return */
411 - if (vdd->vp_enabled)
412 + if (vp->enabled)
413 return;
415 vp_latch_vsel(voltdm);
417 /* Enable VP */
418 vpconfig = voltdm->read(vp->vpconfig);
419 - vpconfig |= vp->vp_common->vpconfig_vpenable;
420 + vpconfig |= vp->common->vpconfig_vpenable;
421 voltdm->write(vpconfig, vp->vpconfig);
422 - vdd->vp_enabled = true;
423 + vp->enabled = true;
424 }
426 /**
427 @@ -262,8 +258,7 @@ void omap_vp_enable(struct voltagedomain *voltdm)
428 */
429 void omap_vp_disable(struct voltagedomain *voltdm)
430 {
431 - struct omap_vp_instance_data *vp;
432 - struct omap_vdd_info *vdd;
433 + struct omap_vp_instance *vp;
434 u32 vpconfig;
435 int timeout;
437 @@ -272,8 +267,7 @@ void omap_vp_disable(struct voltagedomain *voltdm)
438 return;
439 }
441 - vdd = voltdm->vdd;
442 - vp = voltdm->vdd->vp_data;
443 + vp = voltdm->vp;
444 if (!voltdm->read || !voltdm->write) {
445 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
446 __func__, voltdm->name);
447 @@ -281,7 +275,7 @@ void omap_vp_disable(struct voltagedomain *voltdm)
448 }
450 /* If VP is already disabled, do nothing. Return */
451 - if (!vdd->vp_enabled) {
452 + if (!vp->enabled) {
453 pr_warning("%s: Trying to disable VP for vdd_%s when"
454 "it is already disabled\n", __func__, voltdm->name);
455 return;
456 @@ -289,7 +283,7 @@ void omap_vp_disable(struct voltagedomain *voltdm)
458 /* Disable VP */
459 vpconfig = voltdm->read(vp->vpconfig);
460 - vpconfig &= ~vp->vp_common->vpconfig_vpenable;
461 + vpconfig &= ~vp->common->vpconfig_vpenable;
462 voltdm->write(vpconfig, vp->vpconfig);
464 /*
465 @@ -302,7 +296,7 @@ void omap_vp_disable(struct voltagedomain *voltdm)
466 pr_warning("%s: vdd_%s idle timedout\n",
467 __func__, voltdm->name);
469 - vdd->vp_enabled = false;
470 + vp->enabled = false;
472 return;
473 }
474 @@ -311,7 +305,7 @@ void omap_vp_disable(struct voltagedomain *voltdm)
475 static int vp_volt_debug_get(void *data, u64 *val)
476 {
477 struct voltagedomain *voltdm = (struct voltagedomain *)data;
478 - struct omap_vp_instance_data *vp = voltdm->vdd->vp_data;
479 + struct omap_vp_instance *vp = voltdm->vp;
480 struct omap_vdd_info *vdd = voltdm->vdd;
481 u8 vsel;
483 diff --git a/arch/arm/mach-omap2/vp.h b/arch/arm/mach-omap2/vp.h
484 index 79aa8d3..1d63960 100644
485 --- a/arch/arm/mach-omap2/vp.h
486 +++ b/arch/arm/mach-omap2/vp.h
487 @@ -45,7 +45,7 @@ struct omap_vp_ops {
488 };
490 /**
491 - * struct omap_vp_common_data - register data common to all VDDs
492 + * struct omap_vp_common - register data common to all VDDs
493 * @vpconfig_errorgain_mask: ERRORGAIN bitmask in the PRM_VP*_CONFIG reg
494 * @vpconfig_initvoltage_mask: INITVOLTAGE bitmask in the PRM_VP*_CONFIG reg
495 * @vpconfig_timeouten_mask: TIMEOUT bitmask in the PRM_VP*_CONFIG reg
496 @@ -67,7 +67,7 @@ struct omap_vp_ops {
497 * bitfield - remove one
498 * XXX Many of these fields are wrongly named -- e.g., vpconfig_smps* -- fix!
499 */
500 -struct omap_vp_common_data {
501 +struct omap_vp_common {
502 u32 vpconfig_errorgain_mask;
503 u32 vpconfig_initvoltage_mask;
504 u32 vpconfig_timeouten;
505 @@ -89,18 +89,19 @@ struct omap_vp_common_data {
506 };
508 /**
509 - * struct omap_vp_instance_data - VP register offsets (per-VDD)
510 - * @vp_common: pointer to struct omap_vp_common_data * for this SoC
511 + * struct omap_vp_instance - VP register offsets (per-VDD)
512 + * @common: pointer to struct omap_vp_common * for this SoC
513 * @vpconfig: PRM_VP*_CONFIG reg offset from PRM start
514 * @vstepmin: PRM_VP*_VSTEPMIN reg offset from PRM start
515 * @vlimitto: PRM_VP*_VLIMITTO reg offset from PRM start
516 * @vstatus: PRM_VP*_VSTATUS reg offset from PRM start
517 * @voltage: PRM_VP*_VOLTAGE reg offset from PRM start
518 + * @enabled: flag to keep track of whether vp is enabled or not
519 *
520 * XXX vp_common is probably not needed since it is per-SoC
521 */
522 -struct omap_vp_instance_data {
523 - const struct omap_vp_common_data *vp_common;
524 +struct omap_vp_instance {
525 + const struct omap_vp_common *common;
526 u8 vpconfig;
527 u8 vstepmin;
528 u8 vstepmax;
529 @@ -108,6 +109,7 @@ struct omap_vp_instance_data {
530 u8 vstatus;
531 u8 voltage;
532 u8 id;
533 + bool enabled;
534 };
536 /**
537 @@ -139,12 +141,12 @@ struct omap_vp_runtime_data {
538 u8 vlimitto_vddmax;
539 };
541 -extern struct omap_vp_instance_data omap3_vp1_data;
542 -extern struct omap_vp_instance_data omap3_vp2_data;
543 +extern struct omap_vp_instance omap3_vp_mpu;
544 +extern struct omap_vp_instance omap3_vp_core;
546 -extern struct omap_vp_instance_data omap4_vp_mpu_data;
547 -extern struct omap_vp_instance_data omap4_vp_iva_data;
548 -extern struct omap_vp_instance_data omap4_vp_core_data;
549 +extern struct omap_vp_instance omap4_vp_mpu;
550 +extern struct omap_vp_instance omap4_vp_iva;
551 +extern struct omap_vp_instance omap4_vp_core;
553 void omap_vp_init(struct voltagedomain *voltdm);
554 void omap_vp_enable(struct voltagedomain *voltdm);
555 diff --git a/arch/arm/mach-omap2/vp3xxx_data.c b/arch/arm/mach-omap2/vp3xxx_data.c
556 index b01d333..79c3df9 100644
557 --- a/arch/arm/mach-omap2/vp3xxx_data.c
558 +++ b/arch/arm/mach-omap2/vp3xxx_data.c
559 @@ -36,7 +36,7 @@ static const struct omap_vp_ops omap3_vp_ops = {
560 * VP data common to 34xx/36xx chips
561 * XXX This stuff presumably belongs in the vp3xxx.c or vp.c file.
562 */
563 -static const struct omap_vp_common_data omap3_vp_common = {
564 +static const struct omap_vp_common omap3_vp_common = {
565 .vpconfig_erroroffset_shift = OMAP3430_ERROROFFSET_SHIFT,
566 .vpconfig_errorgain_mask = OMAP3430_ERRORGAIN_MASK,
567 .vpconfig_errorgain_shift = OMAP3430_ERRORGAIN_SHIFT,
568 @@ -56,9 +56,9 @@ static const struct omap_vp_common_data omap3_vp_common = {
569 .ops = &omap3_vp_ops,
570 };
572 -struct omap_vp_instance_data omap3_vp1_data = {
573 +struct omap_vp_instance omap3_vp_mpu = {
574 .id = OMAP3_VP_VDD_MPU_ID,
575 - .vp_common = &omap3_vp_common,
576 + .common = &omap3_vp_common,
577 .vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET,
578 .vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET,
579 .vstepmax = OMAP3_PRM_VP1_VSTEPMAX_OFFSET,
580 @@ -67,9 +67,9 @@ struct omap_vp_instance_data omap3_vp1_data = {
581 .voltage = OMAP3_PRM_VP1_VOLTAGE_OFFSET,
582 };
584 -struct omap_vp_instance_data omap3_vp2_data = {
585 +struct omap_vp_instance omap3_vp_core = {
586 .id = OMAP3_VP_VDD_CORE_ID,
587 - .vp_common = &omap3_vp_common,
588 + .common = &omap3_vp_common,
589 .vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET,
590 .vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET,
591 .vstepmax = OMAP3_PRM_VP2_VSTEPMAX_OFFSET,
592 diff --git a/arch/arm/mach-omap2/vp44xx_data.c b/arch/arm/mach-omap2/vp44xx_data.c
593 index 9704c7b..8f75cd9 100644
594 --- a/arch/arm/mach-omap2/vp44xx_data.c
595 +++ b/arch/arm/mach-omap2/vp44xx_data.c
596 @@ -36,7 +36,7 @@ static const struct omap_vp_ops omap4_vp_ops = {
597 * VP data common to 44xx chips
598 * XXX This stuff presumably belongs in the vp44xx.c or vp.c file.
599 */
600 -static const struct omap_vp_common_data omap4_vp_common = {
601 +static const struct omap_vp_common omap4_vp_common = {
602 .vpconfig_erroroffset_shift = OMAP4430_ERROROFFSET_SHIFT,
603 .vpconfig_errorgain_mask = OMAP4430_ERRORGAIN_MASK,
604 .vpconfig_errorgain_shift = OMAP4430_ERRORGAIN_SHIFT,
605 @@ -56,9 +56,9 @@ static const struct omap_vp_common_data omap4_vp_common = {
606 .ops = &omap4_vp_ops,
607 };
609 -struct omap_vp_instance_data omap4_vp_mpu_data = {
610 +struct omap_vp_instance omap4_vp_mpu = {
611 .id = OMAP4_VP_VDD_MPU_ID,
612 - .vp_common = &omap4_vp_common,
613 + .common = &omap4_vp_common,
614 .vpconfig = OMAP4_PRM_VP_MPU_CONFIG_OFFSET,
615 .vstepmin = OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET,
616 .vstepmax = OMAP4_PRM_VP_MPU_VSTEPMAX_OFFSET,
617 @@ -67,9 +67,9 @@ struct omap_vp_instance_data omap4_vp_mpu_data = {
618 .voltage = OMAP4_PRM_VP_MPU_VOLTAGE_OFFSET,
619 };
621 -struct omap_vp_instance_data omap4_vp_iva_data = {
622 +struct omap_vp_instance omap4_vp_iva = {
623 .id = OMAP4_VP_VDD_IVA_ID,
624 - .vp_common = &omap4_vp_common,
625 + .common = &omap4_vp_common,
626 .vpconfig = OMAP4_PRM_VP_IVA_CONFIG_OFFSET,
627 .vstepmin = OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET,
628 .vstepmax = OMAP4_PRM_VP_IVA_VSTEPMAX_OFFSET,
629 @@ -78,9 +78,9 @@ struct omap_vp_instance_data omap4_vp_iva_data = {
630 .voltage = OMAP4_PRM_VP_IVA_VOLTAGE_OFFSET,
631 };
633 -struct omap_vp_instance_data omap4_vp_core_data = {
634 +struct omap_vp_instance omap4_vp_core = {
635 .id = OMAP4_VP_VDD_CORE_ID,
636 - .vp_common = &omap4_vp_common,
637 + .common = &omap4_vp_common,
638 .vpconfig = OMAP4_PRM_VP_CORE_CONFIG_OFFSET,
639 .vstepmin = OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET,
640 .vstepmax = OMAP4_PRM_VP_CORE_VSTEPMAX_OFFSET,
641 --
642 1.6.6.1