summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/powergate-t12x.c
diff options
context:
space:
mode:
authorChao Xu <cxu@nvidia.com>2014-03-18 11:28:01 -0700
committerChao Xu <cxu@nvidia.com>2014-03-20 15:59:13 -0700
commit579fb04630174cbde32634244c9a04aa027094bf (patch)
tree0273b5a8d3fb6692520019d2c70861613c9bd1ea /arch/arm/mach-tegra/powergate-t12x.c
parent4583c0ce73d68bddb92e38ab10e6e358473c404a (diff)
ARM: tegra: powergate: Remove DISA and DISB dependencies
DISA and DISB power domains have no dependencies on each other anymore so remove the dependencies. Bug 1482942 Change-Id: I83c40363ccb8ec1e5e08636c36e0634b3e582df0 Signed-off-by: Chao Xu <cxu@nvidia.com> Reviewed-on: http://git-master/r/383266 Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/powergate-t12x.c')
-rw-r--r--arch/arm/mach-tegra/powergate-t12x.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/arch/arm/mach-tegra/powergate-t12x.c b/arch/arm/mach-tegra/powergate-t12x.c
index ef41c670781e..4998e2cd24a9 100644
--- a/arch/arm/mach-tegra/powergate-t12x.c
+++ b/arch/arm/mach-tegra/powergate-t12x.c
@@ -545,8 +545,13 @@ static int tegra12x_disp_powergate(int id)
mutex_lock(&tegra12x_powergate_disp_lock);
if (id == TEGRA_POWERGATE_DISA) {
- ref_counta = atomic_dec_return(&ref_count_dispa);
- WARN_ONCE(ref_counta < 0, "DISPA ref count underflow");
+ if (ref_counta > 0)
+ ref_counta = atomic_dec_return(&ref_count_dispa);
+ if ((ref_counta <= 0) &&
+ tegra12x_powergate(TEGRA_POWERGATE_DISA)) {
+ ret = -EBUSY;
+ goto error_out;
+ }
} else if (id == TEGRA_POWERGATE_DISB) {
if (ref_countb > 0)
ref_countb = atomic_dec_return(&ref_count_dispb);
@@ -558,8 +563,7 @@ static int tegra12x_disp_powergate(int id)
}
if ((ref_counta <= 0) && (ref_countb <= 0) && (ref_countve <= 0)) {
- if (tegra12x_powergate(TEGRA_POWERGATE_SOR) ||
- tegra12x_powergate(TEGRA_POWERGATE_DISA)) {
+ if (tegra12x_powergate(TEGRA_POWERGATE_SOR)) {
ret = -EBUSY;
goto error_out;
}
@@ -575,19 +579,18 @@ static int tegra12x_disp_unpowergate(int id)
int ret = 0;
mutex_lock(&tegra12x_powergate_disp_lock);
- /* always unpowergate dispA and SOR partition */
- if (tegra12x_unpowergate(TEGRA_POWERGATE_DISA) ||
- tegra12x_unpowergate(TEGRA_POWERGATE_SOR)) {
- ret = -EBUSY;
- goto error_out;
+ /* always unpowergate SOR partition */
+ if (tegra12x_unpowergate(TEGRA_POWERGATE_SOR)) {
+ ret = -EBUSY;
+ goto error_out;
}
if (id == TEGRA_POWERGATE_DISA)
atomic_inc(&ref_count_dispa);
- else if (id == TEGRA_POWERGATE_DISB) {
+ else if (id == TEGRA_POWERGATE_DISB)
atomic_inc(&ref_count_dispb);
- ret = tegra12x_unpowergate(TEGRA_POWERGATE_DISB);
- }
+ ret = tegra12x_unpowergate(id);
+
error_out:
mutex_unlock(&tegra12x_powergate_disp_lock);
return ret;