[RFC][PATCH 1/1] DSPBRIDGE: workaround for SR with inappropriate OPP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx>

It seems that we have had some cases where SR may not work with some
OPP level. This patch will introduce a workaround to turn off SR with
specific OPP, in this case it's OPP2. With this patch, we can use all
OPP but can disable SR on problematic OPP2 case. It seems that this
will get the advantage of SR/DVFS at most, working around the
problematic combination(SR + OPP2).

Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx>
---
 arch/arm/mach-omap2/dspbridge.c   |   24 +++++++++++++++++++++++-
 arch/arm/mach-omap2/smartreflex.c |    2 ++
 2 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/dspbridge.c b/arch/arm/mach-omap2/dspbridge.c
index 43283c9..3657de7 100644
--- a/arch/arm/mach-omap2/dspbridge.c
+++ b/arch/arm/mach-omap2/dspbridge.c
@@ -14,13 +14,35 @@
 #include <linux/platform_device.h>
 
 #include <mach/omap-pm.h>
+#include <mach/resource.h>
 
 #include <dspbridge/host_os.h>
 
+#include "smartreflex.h"
+
 static struct platform_device *dspbridge_pdev;
 
+#ifdef CONFIG_OMAP_SMARTREFLEX
+/* workaround for SR with inappropriate OPP */
+static void __omap_pm_dsp_set_min_opp(u8 opp_id)
+{
+	switch (opp_id) {
+	case 2:
+		disable_smartreflex(SR1);
+		omap_pm_dsp_set_min_opp(opp_id);
+		break;
+	default:
+		omap_pm_dsp_set_min_opp(opp_id);
+		enable_smartreflex(SR1);
+		break;
+	}
+}
+#else
+#define __omap_pm_dsp_set_min_opp omap_pm_dsp_set_min_opp
+#endif
+
 static struct dspbridge_platform_data dspbridge_pdata __initdata = {
-	.dsp_set_min_opp = omap_pm_dsp_set_min_opp,
+	.dsp_set_min_opp = __omap_pm_dsp_set_min_opp,
 	.dsp_get_opp	 = omap_pm_dsp_get_opp,
 	.cpu_set_freq	 = omap_pm_cpu_set_freq,
 	.cpu_get_freq	 = omap_pm_cpu_get_freq,
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index f35e2e6..4057aef 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -636,6 +636,7 @@ void enable_smartreflex(int srid)
 		}
 	}
 }
+EXPORT_SYMBOL(enable_smartreflex);
 
 void disable_smartreflex(int srid)
 {
@@ -674,6 +675,7 @@ void disable_smartreflex(int srid)
 		}
 	}
 }
+EXPORT_SYMBOL(disable_smartreflex);
 
 /* Voltage Scaling using SR VCBYPASS */
 int sr_voltagescale_vcbypass(u32 target_opp, u32 current_opp,
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux