summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-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 */