msm: mdss: enforce bimc smmu gdsc power sequence

Fix the power on/off sequence based on the
hw recommendation, where bimc smmu gdsc is
powered off after mdss gdsc; and for the
power on sequence the bimc smmu gdsc is
enabled before the mdss gdsc.

Change-Id: Iad005082bcdb07f5529cd5eafd6ecd9c250c9665
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
This commit is contained in:
Ingrid Gallardo 2017-01-23 12:43:58 -08:00
parent e51702e4dd
commit a1c43be00a
2 changed files with 19 additions and 17 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -281,7 +281,7 @@ struct mdss_data_type {
u32 mdp_rev;
struct clk *mdp_clk[MDSS_MAX_CLK];
struct regulator *fs;
struct regulator *venus;
struct regulator *core_gdsc;
struct regulator *vdd_cx;
u32 vdd_cx_min_uv;
u32 vdd_cx_max_uv;

View file

@ -1739,11 +1739,13 @@ static int mdss_mdp_irq_clk_setup(struct mdss_data_type *mdata)
return -EINVAL;
}
mdata->venus = devm_regulator_get_optional(&mdata->pdev->dev,
"gdsc-venus");
if (IS_ERR_OR_NULL(mdata->venus)) {
mdata->venus = NULL;
pr_debug("unable to get venus gdsc regulator\n");
mdata->core_gdsc = devm_regulator_get_optional(&mdata->pdev->dev,
"gdsc-core");
if (IS_ERR_OR_NULL(mdata->core_gdsc)) {
mdata->core_gdsc = NULL;
pr_err("unable to get core gdsc regulator\n");
} else {
pr_debug("core gdsc regulator found\n");
}
mdata->fs_ena = false;
@ -2274,10 +2276,10 @@ void mdss_mdp_footswitch_ctrl_splash(int on)
if (on) {
mdata->handoff_pending = true;
pr_debug("Enable MDP FS for splash.\n");
if (mdata->venus) {
ret = regulator_enable(mdata->venus);
if (mdata->core_gdsc) {
ret = regulator_enable(mdata->core_gdsc);
if (ret)
pr_err("venus failed to enable\n");
pr_err("core_gdsc failed to enable\n");
}
ret = regulator_enable(mdata->fs);
@ -2291,8 +2293,8 @@ void mdss_mdp_footswitch_ctrl_splash(int on)
mdss_bus_bandwidth_ctrl(false);
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
regulator_disable(mdata->fs);
if (mdata->venus)
regulator_disable(mdata->venus);
if (mdata->core_gdsc)
regulator_disable(mdata->core_gdsc);
mdata->handoff_pending = false;
}
} else {
@ -4915,10 +4917,10 @@ static void mdss_mdp_footswitch_ctrl(struct mdss_data_type *mdata, int on)
if (on) {
if (!mdata->fs_ena) {
pr_debug("Enable MDP FS\n");
if (mdata->venus) {
ret = regulator_enable(mdata->venus);
if (mdata->core_gdsc) {
ret = regulator_enable(mdata->core_gdsc);
if (ret)
pr_err("venus failed to enable\n");
pr_err("core_gdsc failed to enable\n");
}
/*
@ -4969,8 +4971,8 @@ static void mdss_mdp_footswitch_ctrl(struct mdss_data_type *mdata, int on)
if (mdata->en_svs_high)
mdss_mdp_config_cx_voltage(mdata, false);
regulator_disable(mdata->fs);
if (mdata->venus)
regulator_disable(mdata->venus);
if (mdata->core_gdsc)
regulator_disable(mdata->core_gdsc);
if (footswitch_suspend) {
/*