summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2012-02-28 13:52:58 -0800
committerVarun Colbert <vcolbert@nvidia.com>2012-03-14 16:37:16 -0700
commit34a53b7d1756e2141ac4fd816b172779dec4786d (patch)
tree7c34285cf8fbfbaaf7e50fff72d18eae708453b7 /arch
parent29944d7b0128700fa369f0a3ab5cd6c24896f974 (diff)
ARM: tegra: power: Boost CPU rate before device resume
Boost CPU frequency in tegra platform resume finish phase, just before driver resume. Boost level is specified by platform suspend data (ignored if 0). Bug 946301 Signed-off-by: Alex Frid <afrid@nvidia.com> (cherry picked from commit eaedf228861e4456454ca13f0958ed97e799fc59) Change-Id: Ica0cff28f9651e38787ec98f54563d95d876d79e Reviewed-on: http://git-master/r/89353 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c14
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.h9
-rw-r--r--arch/arm/mach-tegra/pm.c7
-rw-r--r--arch/arm/mach-tegra/pm.h3
4 files changed, 31 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index f182021aa067..4d9758670b60 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -581,6 +581,20 @@ int tegra_cpu_set_speed_cap(unsigned int *speed_cap)
return ret;
}
+int tegra_suspended_target(unsigned int target_freq)
+{
+ unsigned int new_speed = target_freq;
+
+ if (!is_suspended)
+ return -EBUSY;
+
+ /* apply only "hard" caps */
+ new_speed = tegra_throttle_governor_speed(new_speed);
+ new_speed = edp_governor_speed(new_speed);
+
+ return tegra_update_cpu_speed(new_speed);
+}
+
static int tegra_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
diff --git a/arch/arm/mach-tegra/cpu-tegra.h b/arch/arm/mach-tegra/cpu-tegra.h
index a89ccd32d463..2bba460514f3 100644
--- a/arch/arm/mach-tegra/cpu-tegra.h
+++ b/arch/arm/mach-tegra/cpu-tegra.h
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/cpu-tegra.h
*
- * Copyright (c) 2011, NVIDIA Corporation.
+ * Copyright (c) 2011-2012, NVIDIA Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -76,4 +76,11 @@ static inline bool tegra_cpu_edp_favor_down(unsigned int n, int mp_overhead)
{ return false; }
#endif
+#ifdef CONFIG_CPU_FREQ
+int tegra_suspended_target(unsigned int target_freq);
+#else
+static inline int tegra_suspended_target(unsigned int target_freq)
+{ return -ENOSYS; }
+#endif
+
#endif /* __MACH_TEGRA_CPU_TEGRA_H */
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c
index ffda657ecad9..45b70b895114 100644
--- a/arch/arm/mach-tegra/pm.c
+++ b/arch/arm/mach-tegra/pm.c
@@ -67,6 +67,7 @@
#include "sleep.h"
#include "timer.h"
#include "dvfs.h"
+#include "cpu-tegra.h"
struct suspend_context {
/*
@@ -949,6 +950,12 @@ static int tegra_suspend_prepare(void)
static void tegra_suspend_finish(void)
{
+ if (pdata && pdata->cpu_resume_boost) {
+ int ret = tegra_suspended_target(pdata->cpu_resume_boost);
+ pr_info("Tegra: resume CPU boost to %u KHz: %s (%d)\n",
+ pdata->cpu_resume_boost, ret ? "Failed" : "OK", ret);
+ }
+
if ((current_suspend_mode == TEGRA_SUSPEND_LP0) && tegra_deep_sleep)
tegra_deep_sleep(0);
}
diff --git a/arch/arm/mach-tegra/pm.h b/arch/arm/mach-tegra/pm.h
index 1a443ce13379..421b21ac9342 100644
--- a/arch/arm/mach-tegra/pm.h
+++ b/arch/arm/mach-tegra/pm.h
@@ -2,7 +2,7 @@
* arch/arm/mach-tegra/include/mach/pm.h
*
* Copyright (C) 2010 Google, Inc.
- * Copyright (C) 2010-2011 NVIDIA Corporation
+ * Copyright (C) 2010-2012 NVIDIA Corporation
*
* Author:
* Colin Cross <ccross@google.com>
@@ -64,6 +64,7 @@ struct tegra_suspend_platform_data {
void (*board_suspend)(int lp_state, enum suspend_stage stg);
/* lp_state = 0 for LP0 state, 1 for LP1 state, 2 for LP2 state */
void (*board_resume)(int lp_state, enum resume_stage stg);
+ unsigned int cpu_resume_boost; /* CPU frequency resume boost in kHz */
};
/* Tegra io dpd entry - for each supported driver */