7f7e88f6207bd695c1e1255bd7c978f0d2565387
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-3.0 / pm-wip / voltdm / 0135-OMAP3-VP-move-voltage-scale-function-pointer-into-st.patch
1 From 4558767d780fc1b8a08e8aabb30ec278a425efc5 Mon Sep 17 00:00:00 2001
2 From: Kevin Hilman <khilman@ti.com>
3 Date: Thu, 14 Jul 2011 11:12:32 -0700
4 Subject: [PATCH 135/149] OMAP3+: VP: move voltage scale function pointer into struct voltagedomain
6 Function pointer used for actual voltage scaling (e.g. VP force update
7 or VC bypass) is moved from omap_vdd_info into struct voltagedomain,
8 resulting in renames s/vdd->volt_scale/voltdm->scale/
10 No functional changes.
12 Signed-off-by: Kevin Hilman <khilman@ti.com>
13 ---
14 arch/arm/mach-omap2/voltage.c | 24 +++++++-----------------
15 arch/arm/mach-omap2/voltage.h | 8 ++++----
16 2 files changed, 11 insertions(+), 21 deletions(-)
18 diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
19 index 4a15668..32f0873 100644
20 --- a/arch/arm/mach-omap2/voltage.c
21 +++ b/arch/arm/mach-omap2/voltage.c
22 @@ -45,10 +45,8 @@ static LIST_HEAD(voltdm_list);
24 static int __init _config_common_vdd_data(struct voltagedomain *voltdm)
25 {
26 - struct omap_vdd_info *vdd = voltdm->vdd;
27 -
28 /* Generic voltage parameters */
29 - vdd->volt_scale = omap_vp_forceupdate_scale;
30 + voltdm->scale = omap_vp_forceupdate_scale;
32 return 0;
33 }
34 @@ -107,22 +105,18 @@ unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm)
35 int omap_voltage_scale_vdd(struct voltagedomain *voltdm,
36 unsigned long target_volt)
37 {
38 - struct omap_vdd_info *vdd;
39 -
40 if (!voltdm || IS_ERR(voltdm)) {
41 pr_warning("%s: VDD specified does not exist!\n", __func__);
42 return -EINVAL;
43 }
45 - vdd = voltdm->vdd;
46 -
47 - if (!vdd->volt_scale) {
48 + if (!voltdm->scale) {
49 pr_err("%s: No voltage scale API registered for vdd_%s\n",
50 __func__, voltdm->name);
51 return -ENODATA;
52 }
54 - return vdd->volt_scale(voltdm, target_volt);
55 + return voltdm->scale(voltdm, target_volt);
56 }
58 /**
59 @@ -258,23 +252,19 @@ int omap_voltage_register_pmic(struct voltagedomain *voltdm,
60 * defined in voltage.h
61 */
62 void omap_change_voltscale_method(struct voltagedomain *voltdm,
63 - int voltscale_method)
64 + int voltscale_method)
65 {
66 - struct omap_vdd_info *vdd;
67 -
68 if (!voltdm || IS_ERR(voltdm)) {
69 pr_warning("%s: VDD specified does not exist!\n", __func__);
70 return;
71 }
73 - vdd = voltdm->vdd;
74 -
75 switch (voltscale_method) {
76 case VOLTSCALE_VPFORCEUPDATE:
77 - vdd->volt_scale = omap_vp_forceupdate_scale;
78 + voltdm->scale = omap_vp_forceupdate_scale;
79 return;
80 case VOLTSCALE_VCBYPASS:
81 - vdd->volt_scale = omap_vc_bypass_scale;
82 + voltdm->scale = omap_vc_bypass_scale;
83 return;
84 default:
85 pr_warning("%s: Trying to change the method of voltage scaling"
86 @@ -315,7 +305,7 @@ int __init omap_voltage_late_init(void)
87 clk_put(sys_ck);
89 if (voltdm->vc) {
90 - voltdm->vdd->volt_scale = omap_vc_bypass_scale;
91 + voltdm->scale = omap_vc_bypass_scale;
92 omap_vc_init_channel(voltdm);
93 }
95 diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h
96 index 5235eec..d2a0c24 100644
97 --- a/arch/arm/mach-omap2/voltage.h
98 +++ b/arch/arm/mach-omap2/voltage.h
99 @@ -60,6 +60,7 @@ struct omap_vfsm_instance {
100 * @pwrdm_node: list_head linking all powerdomains in this voltagedomain
101 * @vdd: to be removed
102 * @pwrdms: powerdomains in this voltagedomain
103 + * @scale: function used to scale the voltage of the voltagedomain
104 */
105 struct voltagedomain {
106 char *name;
107 @@ -81,6 +82,9 @@ struct voltagedomain {
108 u32 rate;
109 } sys_clk;
111 + int (*scale) (struct voltagedomain *voltdm,
112 + unsigned long target_volt);
113 +
114 struct omap_vdd_info *vdd;
115 };
117 @@ -141,14 +145,10 @@ struct omap_voltdm_pmic {
118 * @volt_data : voltage table having the distinct voltages supported
119 * by the domain and other associated per voltage data.
120 * @curr_volt : current voltage for this vdd.
121 - * @volt_scale : API to scale the voltage of the vdd.
122 */
123 struct omap_vdd_info {
124 struct omap_volt_data *volt_data;
125 u32 curr_volt;
126 -
127 - int (*volt_scale) (struct voltagedomain *voltdm,
128 - unsigned long target_volt);
129 };
131 int omap_voltage_scale_vdd(struct voltagedomain *voltdm,
132 --
133 1.6.6.1