1 diff -urN kernel-power-2.6.28/arch/arm/mach-omap2/omap3-opp.h kernel-power-2.6.28.SR/arch/arm/mach-omap2/omap3-opp.h
2 --- kernel-power-2.6.28/arch/arm/mach-omap2/omap3-opp.h 2011-10-11 13:51:21.441301622 +0100
3 +++ kernel-power-2.6.28.SR/arch/arm/mach-omap2/omap3-opp.h 2011-10-22 16:31:45.291911000 +0100
5 #define S900M 900000000
6 #define S850M 850000000
7 #define S805M 805000000
8 -#define S750M 750000000
9 -#define S700M 700000000
10 +#define S720M 720000000
11 #define S600M 600000000
12 #define S550M 550000000
13 #define S500M 500000000
14 diff -urN kernel-power-2.6.28/arch/arm/mach-omap2/pm34xx.c kernel-power-2.6.28.SR/arch/arm/mach-omap2/pm34xx.c
15 --- kernel-power-2.6.28/arch/arm/mach-omap2/pm34xx.c 2011-10-11 13:51:19.475662264 +0100
16 +++ kernel-power-2.6.28.SR/arch/arm/mach-omap2/pm34xx.c 2011-11-14 17:06:15.733128000 +0000
18 * Only needed if we are going to enter retention.
20 if (mpu_next_state < PWRDM_POWER_ON)
21 - disable_smartreflex(SR1);
22 + disable_smartreflex(SR1,0);
23 if (core_next_state < PWRDM_POWER_ON)
24 - disable_smartreflex(SR2);
25 + disable_smartreflex(SR2,0);
28 if (core_next_state < PWRDM_POWER_ON) {
29 diff -urN kernel-power-2.6.28/arch/arm/mach-omap2/pm.c kernel-power-2.6.28.SR/arch/arm/mach-omap2/pm.c
30 --- kernel-power-2.6.28/arch/arm/mach-omap2/pm.c 2011-10-11 13:51:21.444897248 +0100
31 +++ kernel-power-2.6.28.SR/arch/arm/mach-omap2/pm.c 2011-11-12 13:33:08.600565000 +0000
34 struct omap_opp omap3_mpu_rate_table[] = {
44 + {S125M, VDD1_OPP1, 0x1E},
45 + {S250M, VDD1_OPP2, 0x26},
46 + {S500M, VDD1_OPP3, 0x30},
47 + {S550M, VDD1_OPP4, 0x36},
48 + {S600M, VDD1_OPP5, 0x3C},
59 + {S720M, VDD1_OPP6, 0x3C},
60 + {S805M, VDD1_OPP7, 0x3C},
61 + {S850M, VDD1_OPP8, 0x3C},
62 + {S900M, VDD1_OPP9, 0x3C},
63 + {S950M, VDD1_OPP10, 0x3C},
64 + {S1000M,VDD1_OPP11, 0x3C},
65 + {S1100M,VDD1_OPP12, 0x48},
66 + {S1150M,VDD1_OPP13, 0x48},
68 +EXPORT_SYMBOL(omap3_mpu_rate_table);
70 struct omap_opp omap3_l3_rate_table[] = {
74 struct omap_opp omap3_dsp_rate_table[] = {
84 + {S90M, VDD1_OPP1, 0x1E},
85 + {S180M, VDD1_OPP2, 0x26},
86 + {S360M, VDD1_OPP3, 0x30},
87 + {S400M, VDD1_OPP4, 0x36},
88 + {S430M, VDD1_OPP5, 0x3C},
92 - {S430M, 9, 0x3C},/*800MHz*/
99 + {S520M, VDD1_OPP6, 0x3C},
100 + {S520M, VDD1_OPP7, 0x3C},
101 + {S520M, VDD1_OPP8, 0x3C},
102 + {S520M, VDD1_OPP9, 0x3C},
103 + {S520M, VDD1_OPP10, 0x3C},
104 + {S520M, VDD1_OPP11, 0x3C},
105 + {S520M, VDD1_OPP12, 0x48},
106 + {S520M, VDD1_OPP13, 0x48},
108 +EXPORT_SYMBOL(omap3_dsp_rate_table);
110 unsigned short enable_dyn_sleep;
111 unsigned short clocks_off_while_idle;
112 @@ -342,13 +338,13 @@
115 if (attr == &vdd1_opp_attr) {
116 - if (value < 1 || value > 5) {
117 + if (value < MIN_VDD1_OPP || value > MAX_VDD1_OPP) {
118 printk(KERN_ERR "vdd_opp_store: Invalid value\n");
121 resource_set_opp_level(PRCM_VDD1, value, flags);
122 } else if (attr == &vdd2_opp_attr) {
123 - if (value < 1 || value > 3) {
124 + if (value < MIN_VDD2_OPP || value > MAX_VDD2_OPP) {
125 printk(KERN_ERR "vdd_opp_store: Invalid value\n");
128 diff -urN kernel-power-2.6.28/arch/arm/mach-omap2/resource34xx.c kernel-power-2.6.28.SR/arch/arm/mach-omap2/resource34xx.c
129 --- kernel-power-2.6.28/arch/arm/mach-omap2/resource34xx.c 2011-10-11 13:50:56.787174344 +0100
130 +++ kernel-power-2.6.28.SR/arch/arm/mach-omap2/resource34xx.c 2011-11-15 10:50:41.556771000 +0000
133 #ifdef CONFIG_OMAP_SMARTREFLEX
134 sr_status = sr_stop_vddautocomap((get_vdd(t_opp) == PRCM_VDD1) ?
136 + SR1 : SR2,opp[current_level].opp_id);
138 for (i = 0; i < 2; i++) {
140 diff -urN kernel-power-2.6.28/arch/arm/mach-omap2/smartreflex.c kernel-power-2.6.28.SR/arch/arm/mach-omap2/smartreflex.c
141 --- kernel-power-2.6.28/arch/arm/mach-omap2/smartreflex.c 2011-10-11 13:51:21.441301622 +0100
142 +++ kernel-power-2.6.28.SR/arch/arm/mach-omap2/smartreflex.c 2011-11-15 10:54:13.761220000 +0000
145 #include "smartreflex.h"
146 #include "prm-regbits-34xx.h"
147 +#include "omap3-opp.h"
150 * VP_TRANXDONE_TIMEOUT: maximum microseconds to wait for the VP to
153 #define SR_DISABLE_MAX_ATTEMPTS 4
155 +#define ACCURACY 100
156 +#define NDELTA_3430 (3.0 * ACCURACY)
157 +#define PDELTA_3430 (2.6 * ACCURACY)
158 +#define SR_NVALUE_ADJUST -150000
159 +#define SR_NVALUE_DSP_ADJUST 12500
166 u32 opp1_nvalue, opp2_nvalue, opp3_nvalue, opp4_nvalue;
168 + u32 opp6_nvalue, opp7_nvalue, opp8_nvalue, opp9_nvalue;
169 u32 senp_mod, senn_mod;
170 void __iomem *srbase_addr;
171 void __iomem *vpbase_addr;
174 reg_val = __raw_readl(SR_REGADDR(offset));
179 __raw_writel(reg_val, SR_REGADDR(offset));
180 @@ -211,6 +220,147 @@
184 +static u32 calculate_opp_nadj(u32 opp_value, u32 delta_n)
186 + u32 sen_ngain_fuse, sen_nrn_fuse;
188 + sen_ngain_fuse = (opp_value & 0x000F0000) >> 0x10;
189 + sen_nrn_fuse = (opp_value & 0x000000FF);
191 + return ((1 << (sen_ngain_fuse + 8)) / sen_nrn_fuse) + delta_n;
194 +static u32 calculate_opp_padj(u32 opp_value, u32 delta_p)
196 + u32 sen_pgain_fuse, sen_prn_fuse;
198 + sen_pgain_fuse = (opp_value & 0x000F00000) >> 0x14;
199 + sen_prn_fuse = (opp_value & 0x0000FF00) >> 8;
201 + return ((1 << (sen_pgain_fuse + 8)) / sen_prn_fuse) + delta_p;
204 +static u32 get_padj_for_freq(u32 opp0fuse,u32 opp1fuse, u32 freq)
206 + u32 padj_0=calculate_opp_padj(opp0fuse,0);
207 + u32 padj_1=calculate_opp_padj(opp1fuse,0);
208 + u32 p_slope_a=(1000*(padj_1-padj_0))/(250-125);
209 + u32 p_slope_b=1000*(padj_1-p_slope_a*250/1000);
211 + return (u32)(p_slope_a*freq+p_slope_b)/1000;
214 +static u32 get_nadj_for_freq(u32 opp0fuse,u32 opp1fuse, u32 freq)
216 + u32 nadj_0=calculate_opp_nadj(opp0fuse,0);
217 + u32 nadj_1=calculate_opp_nadj(opp1fuse,0);
218 + u32 n_slope_a=(1000*(nadj_1-nadj_0))/(250-125);
219 + u32 n_slope_b=1000*(nadj_1-n_slope_a*250/1000);
221 + return (u32)(n_slope_a*freq+n_slope_b)/1000;
224 +static u32 calculate_freq_efuse_value(u32 opp0fuse,u32 opp1fuse,u32 freq)
226 + u32 sen_nrn, sen_ngain, sen_prn, sen_pgain;
228 + cal_reciprocal(padj=get_padj_for_freq(opp0fuse,opp1fuse,freq), &sen_pgain, &sen_prn);
229 + cal_reciprocal(nadj=get_nadj_for_freq(opp0fuse,opp1fuse,freq), &sen_ngain, &sen_nrn);
231 + return (sen_pgain << 0x14) | (sen_ngain << 0x10)
232 + | (sen_prn << 0x08) | (sen_nrn);
236 + * recalc_with_margin() - helper to add margin to reciprocal and gain
237 + * @uv: voltage in uVolts to add.
238 + * @soc_delta: SoC specific delta base
239 + * @reci: Reciprocal for the sensor
240 + * @gain: Gain for the sensor
242 + * The algorithm computes an adjustment required to meet the delta voltage
243 + * to be added to a given sensor's reciprocal and gain. It then does a
244 + * search for maximum gain for valid reciprocal value. This forms the
245 + * new reciprocal and gain which incorporates the additional voltage
248 + * IMPORTANT: since it is not possible to ascertain the actual voltage from
249 + * ntarget value, the additional voltage will be accurate upto 1 additional
250 + * pmic step. The algorithm is optimized to adjust to higher end rather than
251 + * less than requested additional voltage as it could be unsafe to run at
252 + * voltage lower than requested level.
254 + * Example: if the PMIC step size is 12.5 and requested margin in 25mV(2 PMIC
255 + * steps). the actual voltage achieved can be original V achieved + 25mV upto
256 + * original V + 37.5mV(3 steps) - depending on where V was achieved.
258 +static __init int recalc_with_margin(long uv, int soc_delta, unsigned int *reci,
259 + unsigned int *gain)
264 + nadj = ((1 << (*gain + 8)) * ACCURACY) / (*reci) +
265 + soc_delta * uv / 1000;
267 + /* Linear search for the best reciprocal */
268 + for (g = 15; g >= 0; g--) {
269 + r = ((1 << (g + 8)) * ACCURACY) / nadj;
276 + /* Dont modify the input, just return error */
281 + * sr_ntarget_add_margin() - Modify h/w ntarget to add a s/w margin
282 + * @vdata: voltage data for the OPP to be modified with ntarget populated
283 + * @add_uv: voltate to add to nTarget in uVolts
285 + * Once the sr_device_init is complete and nTargets are populated, using this
286 + * function nTarget read from h/w efuse and stored in vdata is modified to add
287 + * a platform(board) specific additional voltage margin. Based on analysis,
288 + * we might need different margins to be added per vdata.
290 +int __init sr_ntarget_add_margin(u32 old_ntarget, ulong add_uv)
292 + u32 temp_senp_gain, temp_senp_reciprocal;
293 + u32 temp_senn_gain, temp_senn_reciprocal;
294 + int soc_p_delta, soc_n_delta;
297 + temp_senp_gain = (old_ntarget & 0x00F00000) >> 20;
298 + temp_senn_gain = (old_ntarget & 0x000F0000) >> 16;
299 + temp_senp_reciprocal = (old_ntarget & 0x0000FF00) >> 8;
300 + temp_senn_reciprocal = old_ntarget & 0x000000FF;
302 + soc_p_delta = PDELTA_3430;
303 + soc_n_delta = NDELTA_3430;
305 + r = recalc_with_margin(add_uv, soc_n_delta,
306 + &temp_senn_reciprocal, &temp_senn_gain);
308 + pr_err("%s: unable to add %ld uV to ntarget 0x%08x\n",
309 + __func__, add_uv, old_ntarget);
312 + r = recalc_with_margin(add_uv, soc_p_delta,
313 + &temp_senp_reciprocal, &temp_senp_gain);
315 + pr_err("%s: unable to add %ld uV to ntarget 0x%08x\n",
316 + __func__, add_uv, old_ntarget);
320 + /* Populate the new modified nTarget */
321 + return (temp_senp_gain << 20) | (temp_senn_gain << 16) |
322 + (temp_senp_reciprocal << 8) | temp_senn_reciprocal;
325 static void sr_set_efuse_nvalues(struct omap_sr *sr)
327 if (sr->srid == SR1) {
328 @@ -220,17 +370,24 @@
329 sr->senp_mod = (omap_ctrl_readl(OMAP343X_CONTROL_FUSE_SR) &
330 OMAP343X_SR1_SENPENABLE_MASK) >>
331 OMAP343X_SR1_SENPENABLE_SHIFT;
333 - sr->opp5_nvalue = omap_ctrl_readl(
334 - OMAP343X_CONTROL_FUSE_OPP5_VDD1);
335 - sr->opp4_nvalue = omap_ctrl_readl(
336 - OMAP343X_CONTROL_FUSE_OPP4_VDD1);
337 - sr->opp3_nvalue = omap_ctrl_readl(
338 - OMAP343X_CONTROL_FUSE_OPP3_VDD1);
339 - sr->opp2_nvalue = omap_ctrl_readl(
340 - OMAP343X_CONTROL_FUSE_OPP2_VDD1);
341 - sr->opp1_nvalue = omap_ctrl_readl(
342 - OMAP343X_CONTROL_FUSE_OPP1_VDD1);
343 + sr->opp1_nvalue = sr_ntarget_add_margin(omap_ctrl_readl(
344 + OMAP343X_CONTROL_FUSE_OPP1_VDD1),SR_NVALUE_ADJUST);
345 + sr->opp2_nvalue = sr_ntarget_add_margin(omap_ctrl_readl(
346 + OMAP343X_CONTROL_FUSE_OPP2_VDD1),SR_NVALUE_ADJUST);
348 + sr->opp3_nvalue = sr_ntarget_add_margin(sr->opp2_nvalue,212500);
350 + sr->opp4_nvalue = sr_ntarget_add_margin(sr->opp3_nvalue,50000);
352 + sr->opp5_nvalue = sr_ntarget_add_margin(sr->opp4_nvalue,50000);
354 + sr->opp6_nvalue = sr_ntarget_add_margin(sr->opp5_nvalue,100000);
356 + sr->opp7_nvalue = sr_ntarget_add_margin(sr->opp6_nvalue,75000);
358 + sr->opp8_nvalue = sr_ntarget_add_margin(sr->opp7_nvalue,50000);
360 + sr->opp9_nvalue = sr_ntarget_add_margin(sr->opp8_nvalue,55000);
361 } else if (sr->srid == SR2) {
362 sr->senn_mod = (omap_ctrl_readl(OMAP343X_CONTROL_FUSE_SR) &
363 OMAP343X_SR2_SENNENABLE_MASK) >>
365 sr->opp3_nvalue = cal_test_nvalue(0x85b + 0x200, 0x655 + 0x200);
366 sr->opp2_nvalue = cal_test_nvalue(0x506 + 0x1a0, 0x3be + 0x1a0);
367 sr->opp1_nvalue = cal_test_nvalue(0x373 + 0x100, 0x28c + 0x100);
368 + sr->opp6_nvalue = calculate_freq_efuse_value(sr->opp1_nvalue,sr->opp2_nvalue,
369 + mpu_opps[VDD1_OPP6].rate/1000000);
370 + sr->opp7_nvalue = calculate_freq_efuse_value(sr->opp1_nvalue,sr->opp2_nvalue,
371 + mpu_opps[VDD1_OPP7].rate/1000000);
372 + sr->opp8_nvalue = calculate_freq_efuse_value(sr->opp1_nvalue,sr->opp2_nvalue,
373 + mpu_opps[VDD1_OPP8].rate/1000000);
374 + sr->opp9_nvalue = calculate_freq_efuse_value(sr->opp1_nvalue,sr->opp2_nvalue,
375 + mpu_opps[VDD1_OPP9].rate/1000000);
376 } else if (sr->srid == SR2) {
383 -static int sr_reset_voltage(int srid)
384 +static int sr_reset_voltage(int srid,u32 curr_opp_no)
386 u32 target_opp_no, vsel = 0;
389 reg_addr = R_VDD1_SR_CONTROL;
390 prm_vp1_voltage = prm_read_mod_reg(OMAP3430_GR_MOD,
391 OMAP3_PRM_VP1_VOLTAGE_OFFSET);
392 + /* Store current calibrated voltage to be used next time preventing
393 + * overvoltage when calibration cycle starts. if cur_opp_no is 0 don't
394 + * store current voltage, we've been called from sram_idle().
395 + * Just in case add 1 to it, so we can start a little higher next time
398 + mpu_opps[curr_opp_no].vsel = min((u32)mpu_opps[curr_opp_no].vsel,
399 + prm_vp1_voltage+1);
400 t2_smps_steps = abs(vsel - prm_vp1_voltage);
401 errorgain = (target_opp_no > SR_MAX_LOW_OPP) ?
402 PRM_VP1_CONFIG_ERRORGAIN_HIGHOPP :
404 sr->req_opp_no = target_opp_no;
406 if (sr->srid == SR1) {
407 - switch (min(target_opp_no-1,5)) {
408 + switch (min(target_opp_no,(u32)PRCM_NO_VDD1_OPPS)) {
410 + nvalue_reciprocal = sr->opp9_nvalue;
413 + nvalue_reciprocal = sr->opp8_nvalue;
416 + nvalue_reciprocal = sr->opp7_nvalue;
419 + nvalue_reciprocal = sr->opp6_nvalue;
422 nvalue_reciprocal = sr->opp5_nvalue;
425 nvalue_reciprocal = sr->opp3_nvalue;
428 + /* give a little more just when DSP is overclocked */
429 + if(dsp_opps[target_opp_no].rate > S430M)
430 + nvalue_reciprocal = sr_ntarget_add_margin(nvalue_reciprocal,SR_NVALUE_DSP_ADJUST);
431 + if(dsp_opps[target_opp_no].rate > S520M)
432 + nvalue_reciprocal = sr_ntarget_add_margin(nvalue_reciprocal,SR_NVALUE_DSP_ADJUST);
434 switch (target_opp_no) {
441 sr_write_reg(sr, NVALUERECIPROCAL, nvalue_reciprocal);
443 /* Enable the interrupt */
446 EXPORT_SYMBOL(sr_start_vddautocomap);
448 -int sr_stop_vddautocomap(int srid)
449 +int sr_stop_vddautocomap(int srid,u32 cur_opp_no)
451 struct omap_sr *sr = NULL;
455 sr->is_autocomp_active = 0;
456 /* Reset the volatage for current OPP */
457 - sr_reset_voltage(srid);
458 + sr_reset_voltage(srid,cur_opp_no);
466 -void disable_smartreflex(int srid)
467 +void disable_smartreflex(int srid,u32 cur_opp_no)
469 struct omap_sr *sr = NULL;
474 /* Reset the volatage for current OPP */
475 - sr_reset_voltage(srid);
476 + sr_reset_voltage(srid,cur_opp_no);
480 @@ -953,22 +1142,22 @@
481 const char *buf, size_t n)
483 unsigned short value;
485 + u32 current_vdd1opp_no;
486 if (sscanf(buf, "%hu", &value) != 1 || (value > 1)) {
487 printk(KERN_ERR "sr_vdd1_autocomp: Invalid value\n");
491 mutex_lock(&dvfs_mutex);
492 + current_vdd1opp_no = resource_get_level("vdd1_opp");
493 + if (IS_ERR_VALUE(current_vdd1opp_no)) {
494 + mutex_unlock(&dvfs_mutex);
499 - sr_stop_vddautocomap(SR1);
500 + sr_stop_vddautocomap(SR1,current_vdd1opp_no);
502 - u32 current_vdd1opp_no = resource_get_level("vdd1_opp");
503 - if (IS_ERR_VALUE(current_vdd1opp_no)) {
504 - mutex_unlock(&dvfs_mutex);
507 sr_start_vddautocomap(SR1, current_vdd1opp_no);
510 @@ -1008,9 +1197,13 @@
511 mutex_lock(&dvfs_mutex);
513 current_vdd2opp_no = resource_get_level("vdd2_opp");
514 + if (IS_ERR_VALUE(current_vdd2opp_no)) {
515 + mutex_unlock(&dvfs_mutex);
520 - sr_stop_vddautocomap(SR2);
521 + sr_stop_vddautocomap(SR2, current_vdd2opp_no);
523 sr_start_vddautocomap(SR2, current_vdd2opp_no);
525 @@ -1028,23 +1221,87 @@
526 .store = omap_sr_vdd2_autocomp_store,
529 -static ssize_t omap_sr_opp1_efuse_show(struct kobject *kobj,
530 +static ssize_t omap_sr_efuse_vdd1_show(struct kobject *kobj,
531 struct kobj_attribute *attr,
534 - return sprintf(buf, "%08x\n%08x\n%08x\n%08x\n%08x\n", sr1.opp1_nvalue,
535 + return sprintf(buf, "%08x\n%08x\n%08x\n%08x\n%08x\n%08x\n%08x\n%08x\n%08x\n",
549 +static struct kobj_attribute sr_efuse_vdd1 = {
551 + .name = "efuse_vdd1",
554 + .show = omap_sr_efuse_vdd1_show,
557 +static ssize_t omap_sr_vdd1_voltage_show(struct kobject *kobj,
558 + struct kobj_attribute *attr,
561 + u32 prm_vp1_voltage;
562 + mutex_lock(&dvfs_mutex);
563 + prm_vp1_voltage = prm_read_mod_reg(OMAP3430_GR_MOD,
564 + OMAP3_PRM_VP1_VOLTAGE_OFFSET);
565 + mutex_unlock(&dvfs_mutex);
566 + return sprintf(buf,"%u\n",prm_vp1_voltage);
569 +static struct kobj_attribute sr_vdd1_voltage = {
571 + .name = "sr_vdd1_voltage",
574 + .show = omap_sr_vdd1_voltage_show,
577 +static ssize_t omap_sr_efuse_vdd2_show(struct kobject *kobj,
578 + struct kobj_attribute *attr,
581 + return sprintf(buf, "%08x\n%08x\n%08x\n", sr2.opp1_nvalue,
587 +static struct kobj_attribute sr_efuse_vdd2 = {
589 + .name = "efuse_vdd2",
592 + .show = omap_sr_efuse_vdd2_show,
595 +static ssize_t omap_sr_vdd2_voltage_show(struct kobject *kobj,
596 + struct kobj_attribute *attr,
599 + u32 prm_vp2_voltage;
600 + mutex_lock(&dvfs_mutex);
601 + prm_vp2_voltage = prm_read_mod_reg(OMAP3430_GR_MOD,
602 + OMAP3_PRM_VP2_VOLTAGE_OFFSET);
603 + mutex_unlock(&dvfs_mutex);
604 + return sprintf(buf,"%u\n",prm_vp2_voltage);
607 -static struct kobj_attribute sr_efuse = {
608 +static struct kobj_attribute sr_vdd2_voltage = {
611 + .name = "sr_vdd2_voltage",
614 - .show = omap_sr_opp1_efuse_show,
615 + .show = omap_sr_vdd2_voltage_show,
618 static int __init omap3_sr_init(void)
619 @@ -1084,10 +1341,21 @@
621 printk(KERN_ERR "sysfs_create_file failed: %d\n", ret);
623 - ret = sysfs_create_file(power_kobj, &sr_efuse.attr);
624 + ret = sysfs_create_file(power_kobj, &sr_efuse_vdd1.attr);
626 - printk(KERN_ERR "sysfs_create_file failed for OPP data: %d\n", ret);
627 + printk(KERN_ERR "sysfs_create_file failed for VDD1 efuse data: %d\n", ret);
629 + ret = sysfs_create_file(power_kobj, &sr_vdd1_voltage.attr);
631 + printk(KERN_ERR "sysfs_create_file failed for VDD1 voltage data: %d\n", ret);
633 + ret = sysfs_create_file(power_kobj, &sr_efuse_vdd2.attr);
635 + printk(KERN_ERR "sysfs_create_file failed for VDD2 efuse data: %d\n", ret);
637 + ret = sysfs_create_file(power_kobj, &sr_vdd2_voltage.attr);
639 + printk(KERN_ERR "sysfs_create_file failed for VDD2 voltage data: %d\n", ret);
643 diff -urN kernel-power-2.6.28/arch/arm/mach-omap2/smartreflex.h kernel-power-2.6.28.SR/arch/arm/mach-omap2/smartreflex.h
644 --- kernel-power-2.6.28/arch/arm/mach-omap2/smartreflex.h 2011-10-11 13:51:21.441301622 +0100
645 +++ kernel-power-2.6.28.SR/arch/arm/mach-omap2/smartreflex.h 2011-11-14 21:08:28.136636000 +0000
648 /* PRM_VP1_VSTEPMAX */
649 #define PRM_VP1_VSTEPMAX_SMPSWAITTIMEMAX (0x01F4 << 8)
650 -#define PRM_VP1_VSTEPMAX_VSTEPMAX (0x04 << 0)
651 +#define PRM_VP1_VSTEPMAX_VSTEPMAX (0x01 << 0)
653 /* PRM_VP1_VLIMITTO */
654 #define PRM_VP1_VLIMITTO_VDDMAX (0x3C << 24)
656 ID_VDD(PRCM_VDD1) | ID_OPP_NO(0x4))
657 #define PRCM_VDD1_OPP5 (OMAP(AT_3430_ES2) | OTHER_ID_TYPE(ID_OPP) | \
658 ID_VDD(PRCM_VDD1) | ID_OPP_NO(0x5))
659 -#define PRCM_NO_VDD1_OPPS 5
660 +#define PRCM_VDD1_OPP6 (OMAP(AT_3430_ES2) | OTHER_ID_TYPE(ID_OPP) | \
661 + ID_VDD(PRCM_VDD1) | ID_OPP_NO(0x6))
662 +#define PRCM_VDD1_OPP7 (OMAP(AT_3430_ES2) | OTHER_ID_TYPE(ID_OPP) | \
663 + ID_VDD(PRCM_VDD1) | ID_OPP_NO(0x7))
664 +#define PRCM_VDD1_OPP8 (OMAP(AT_3430_ES2) | OTHER_ID_TYPE(ID_OPP) | \
665 + ID_VDD(PRCM_VDD1) | ID_OPP_NO(0x8))
666 +#define PRCM_VDD1_OPP9 (OMAP(AT_3430_ES2) | OTHER_ID_TYPE(ID_OPP) | \
667 + ID_VDD(PRCM_VDD1) | ID_OPP_NO(0x9))
668 +#define PRCM_NO_VDD1_OPPS VDD1_OPP9
673 /* XXX: end remove/move */
675 /* SR_MAX_LOW_OPP: the highest of the "low OPPs", 1 and 2. */
676 -#define SR_MAX_LOW_OPP 3
677 +#define SR_MAX_LOW_OPP VDD1_OPP2
679 /* XXX: find more appropriate place for these once DVFS is in place */
680 extern u32 current_vdd1_opp;
681 @@ -273,10 +281,10 @@
683 #ifdef CONFIG_OMAP_SMARTREFLEX
684 void enable_smartreflex(int srid);
685 -void disable_smartreflex(int srid);
686 +void disable_smartreflex(int srid,u32 cur_opp_no);
687 int sr_voltagescale_vcbypass(u32 t_opp, u32 c_opp, u8 t_vsel, u8 c_vsel);
688 void sr_start_vddautocomap(int srid, u32 target_opp_no);
689 -int sr_stop_vddautocomap(int srid);
690 +int sr_stop_vddautocomap(int srid,u32 cur_opp_no);
692 static inline void enable_smartreflex(int srid) {}
693 static inline void disable_smartreflex(int srid) {}
694 diff -urN kernel-power-2.6.28/arch/arm/plat-omap/include/mach/omap34xx.h kernel-power-2.6.28.SR/arch/arm/plat-omap/include/mach/omap34xx.h
695 --- kernel-power-2.6.28/arch/arm/plat-omap/include/mach/omap34xx.h 2011-10-11 13:51:21.441301622 +0100
696 +++ kernel-power-2.6.28.SR/arch/arm/plat-omap/include/mach/omap34xx.h 2011-10-22 15:52:18.063235000 +0100
698 #define VDD1_OPP3 0x3
699 #define VDD1_OPP4 0x4
700 #define VDD1_OPP5 0x5
701 +#define VDD1_OPP6 0x6
\r
702 +#define VDD1_OPP7 0x7
\r
703 +#define VDD1_OPP8 0x8
\r
704 +#define VDD1_OPP9 0x9
\r
705 +#define VDD1_OPP10 0xA
\r
706 +#define VDD1_OPP11 0xB
\r
707 +#define VDD1_OPP12 0xC
\r
708 +#define VDD1_OPP13 0xD
\r
711 #define VDD2_OPP1 0x1
713 #define VDD2_OPP3 0x3
715 #define MIN_VDD1_OPP VDD1_OPP1
716 -/*#define MAX_VDD1_OPP VDD1_OPP5*/
717 -#define MAX_VDD1_OPP 15
718 +#define MAX_VDD1_OPP VDD1_OPP13
719 #define MIN_VDD2_OPP VDD2_OPP1
720 #define MAX_VDD2_OPP VDD2_OPP3