summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMisael Lopez Cruz <misael.lopez@ti.com>2010-11-18 15:41:39 +0100
committerMargarita Olaya Cabrera <magi.olaya@ti.com>2010-11-23 12:31:52 -0600
commit50b841acb808fc6865dedc1f55f614301c5a053b (patch)
treef999638a20d85040a7c55758b8b6ec501e214ef3 /arch
parent6236a7201636cee3836c30cadbcb472b28c1f32e (diff)
OPP framework: HACK for correct clock selection for ABE
Today OPP framework is not able to select different frequencies if the voltage level is the same. This patch is a HACK for ABE testing purpose. Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/opp44xx_data.c2
-rw-r--r--arch/arm/mach-omap2/voltage.c14
-rw-r--r--arch/arm/plat-omap/include/plat/opp.h6
-rw-r--r--arch/arm/plat-omap/include/plat/voltage.h3
-rw-r--r--arch/arm/plat-omap/omap_device.c2
-rw-r--r--arch/arm/plat-omap/opp.c14
6 files changed, 30 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/opp44xx_data.c b/arch/arm/mach-omap2/opp44xx_data.c
index 7fe524f7fed5..11567f8c501f 100644
--- a/arch/arm/mach-omap2/opp44xx_data.c
+++ b/arch/arm/mach-omap2/opp44xx_data.c
@@ -62,6 +62,8 @@ static struct omap_opp_def __initdata omap44xx_pre_es2_1_opp_def_list[] = {
OMAP_OPP_DEF("dsp", true, 465600000, 1100000),
/* DSP OPP3 - OPPTB */
OMAP_OPP_DEF("dsp", false, 498000000, 1260000),
+ /* ABE OPP1 - OPP25 */
+ OMAP_OPP_DEF("omap-aess-audio", true, 49150000, 930000),
/* ABE OPP1 - OPP50 */
OMAP_OPP_DEF("omap-aess-audio", true, 98300000, 930000),
/* ABE OPP2 - OPP100 */
diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
index 0489874cf312..2e14c474e47a 100644
--- a/arch/arm/mach-omap2/voltage.c
+++ b/arch/arm/mach-omap2/voltage.c
@@ -1305,7 +1305,7 @@ static int scale_dep_vdd(struct omap_vdd_info *main_vdd)
for (i = 0; i < main_vdd->nr_dep_vdd; i++)
omap_voltage_scale(dep_vdds[i].voltdm,
- dep_vdds[i].cur_dep_volt);
+ dep_vdds[i].cur_dep_volt, 0);
return 0;
}
@@ -1793,7 +1793,8 @@ struct voltagedomain *omap_voltage_domain_get(char *name)
* the voltage domain voltage to the new value. Returns 0 on success
* else the error value.
*/
-int omap_voltage_scale(struct voltagedomain *voltdm, unsigned long volt)
+int omap_voltage_scale(struct voltagedomain *voltdm, unsigned long volt,
+ unsigned long hack_freq)
{
unsigned long curr_volt;
int is_volt_scaled = 0, i;
@@ -1835,9 +1836,14 @@ int omap_voltage_scale(struct voltagedomain *voltdm, unsigned long volt)
for (i = 0; i < vdd->dev_count; i++) {
struct omap_opp *opp;
- unsigned long freq;
+ unsigned long freq = 0;
- opp = opp_find_voltage(vdd->dev_list[i], volt);
+ if (!strcmp(dev_driver_string(vdd->dev_list[i]), "omap-aess-audio")) {
+ freq = hack_freq;
+ printk(KERN_ERR "hacking freq for aess -> %ld\n", freq);
+ }
+
+ opp = opp_find_voltage(vdd->dev_list[i], volt, freq);
if (IS_ERR(opp)) {
dev_err(vdd->dev_list[i], "%s: Unable to find OPP for"
"volt%ld\n", __func__, volt);
diff --git a/arch/arm/plat-omap/include/plat/opp.h b/arch/arm/plat-omap/include/plat/opp.h
index de1e8662f2a5..09beb8c252ed 100644
--- a/arch/arm/plat-omap/include/plat/opp.h
+++ b/arch/arm/plat-omap/include/plat/opp.h
@@ -77,7 +77,8 @@ struct omap_opp *opp_find_freq_floor(struct device *dev, unsigned long *freq);
struct omap_opp *opp_find_freq_ceil(struct device *dev, unsigned long *freq);
-struct omap_opp *opp_find_voltage(struct device *dev, unsigned long volt);
+struct omap_opp *opp_find_voltage(struct device *dev, unsigned long volt,
+ unsigned long hack_freq);
int opp_set_rate(struct device *dev, unsigned long freq);
@@ -138,7 +139,8 @@ static inline struct omap_opp *opp_find_freq_ceil(struct device *dev,
}
static inline struct omap_opp *opp_find_voltage(struct device *dev,
- unsigned long volt)
+ unsigned long volt,
+ unsigned long hack_freq)
{
return ERR_PTR(-EINVAL);
}
diff --git a/arch/arm/plat-omap/include/plat/voltage.h b/arch/arm/plat-omap/include/plat/voltage.h
index 563d5bae448d..19d67b2c3d83 100644
--- a/arch/arm/plat-omap/include/plat/voltage.h
+++ b/arch/arm/plat-omap/include/plat/voltage.h
@@ -151,7 +151,8 @@ void omap_voltage_register_pmic(struct omap_volt_pmic_info *pmic_info);
unsigned long omap_voltage_get_nom_volt(struct voltagedomain *voltdm);
int omap_voltage_add_userreq(struct voltagedomain *voltdm, struct device *dev,
unsigned long *volt);
-int omap_voltage_scale(struct voltagedomain *voltdm, unsigned long volt);
+int omap_voltage_scale(struct voltagedomain *voltdm, unsigned long volt,
+ unsigned long hack_freq);
#ifdef CONFIG_PM
void omap_voltage_init_vc(struct omap_volt_vc_data *setup_vc);
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index a8052847cac5..41015ab6cafb 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -937,7 +937,7 @@ int omap_device_set_rate(struct device *req_dev, struct device *dev,
}
/* Do the actual scaling */
- return omap_voltage_scale(voltdm, volt);
+ return omap_voltage_scale(voltdm, volt, freq);
}
EXPORT_SYMBOL(omap_device_set_rate);
diff --git a/arch/arm/plat-omap/opp.c b/arch/arm/plat-omap/opp.c
index 1e2e21bb48ff..d0de2e412cbc 100644
--- a/arch/arm/plat-omap/opp.c
+++ b/arch/arm/plat-omap/opp.c
@@ -329,7 +329,8 @@ struct omap_opp *opp_find_freq_floor(struct device *dev, unsigned long *freq)
* opp if found, else returns ERR_PTR in case of error and should be handled
* using IS_ERR.
*/
-struct omap_opp *opp_find_voltage(struct device *dev, unsigned long volt)
+struct omap_opp *opp_find_voltage(struct device *dev, unsigned long volt,
+ unsigned long hack_freq)
{
struct device_opp *dev_opp;
struct omap_opp *temp_opp, *opp = ERR_PTR(-ENODEV);
@@ -340,8 +341,15 @@ struct omap_opp *opp_find_voltage(struct device *dev, unsigned long volt)
list_for_each_entry(temp_opp, &dev_opp->opp_list, node) {
if (temp_opp->enabled && temp_opp->u_volt == volt) {
- opp = temp_opp;
- break;
+ if (hack_freq) {
+ if (hack_freq == temp_opp->rate) {
+ opp = temp_opp;
+ break;
+ }
+ } else {
+ opp = temp_opp;
+ break;
+ }
}
}