diff mbox

[2/3] omap3: pm: removes hardcoded VDD1/2 OPP values and make threshold generic

Message ID E0D41E29EB0DAC4E9F3FF173962E9E940254330A64@dbde02.ent.ti.com (mailing list archive)
State Changes Requested
Delegated to: Kevin Hilman
Headers show

Commit Message

G.N, Vijayakumar Nov. 19, 2009, 11:25 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/resource34xx.c b/arch/arm/mach-omap2/resource34xx.c
index cc85601..3bdb1f9 100644
--- a/arch/arm/mach-omap2/resource34xx.c
+++ b/arch/arm/mach-omap2/resource34xx.c
@@ -372,7 +372,7 @@  int set_opp(struct shared_resource *resp, u32 target_level)
 	int ind;
 
 	if (resp == vdd1_resp) {
-		if (target_level < 3)
+		if (target_level < MAX_VDD2_OPP)
 			resource_release("vdd2_opp", &vdd2_dev);
 
 		resource_set_opp_level(VDD1_OPP, target_level, 0);
@@ -381,7 +381,7 @@  int set_opp(struct shared_resource *resp, u32 target_level)
 		 * is at 100Mhz or above.
 		 * throughput in KiB/s for 100 Mhz = 100 * 1000 * 4.
 		 */
-		if (target_level >= 3)
+		if (target_level > MIN_VDD2_OPP)
 			resource_request("vdd2_opp", &vdd2_dev,
 				(4 * (l3_opps + MAX_VDD2_OPP)->rate / 1000));
 
@@ -391,7 +391,7 @@  int set_opp(struct shared_resource *resp, u32 target_level)
 		/* Convert the tput in KiB/s to Bus frequency in MHz */
 		req_l3_freq = (tput * 1000)/4;
 
-		for (ind = 2; ind <= MAX_VDD2_OPP; ind++)
+		for (ind = MIN_VDD2_OPP; ind <= MAX_VDD2_OPP; ind++)
 			if ((l3_opps + ind)->rate >= req_l3_freq) {
 				target_level = ind;
 				break;