summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/edp.c
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2013-10-16 18:50:08 -0700
committerYu-Huan Hsu <yhsu@nvidia.com>2013-10-28 12:27:58 -0700
commit51321d1df95178d56799b17a665f1cd3f1740f31 (patch)
treed3385edc7adf532c0994a3513e0665b95c6c266a /arch/arm/mach-tegra/edp.c
parenteac8ece1897c63d898922a2914c43a21683cb824 (diff)
ARM: tegra: power: Add dynamic CPU regulator mode control
Operational mode of CPU voltage regulator depends on load current. Commonly on Tegra platforms this dependency was handled by regulator h/w itself. There are exceptions, however, introduced on some Tegra12 designs that requires s/w control of the mode. In order to dynamically control regulator mode based on load, s/w has to (a) estimate load based on CPU frequency, number of on-line CPU cores, and temperature (b) compare load estimation with regulator specific threshold whenever any of the above factors changes (c) change regulator mode when the respective threshold is crossed This commit adds layer (b) in cpu-tegra driver. It expects existing Tegra CPU load calculator in EDP driver to implement (a), and provide look-up table of frequency thresholds for each combination of on-line CPU cores and temperature ranges. When the respective threshold is crossed standard regulator mode change interface is called to carry on (c). Only switching between IDLE and NORMAL regulator modes is supported. The respective EDP calculator functions are just stubbed, for now. Bug 1302884 Change-Id: Iaea42a101aaea239643c0c80a7ad165ece3b1e36 Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/301520 Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/edp.c')
-rw-r--r--arch/arm/mach-tegra/edp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/edp.c b/arch/arm/mach-tegra/edp.c
index 8435a915a5a7..83bd03be36a2 100644
--- a/arch/arm/mach-tegra/edp.c
+++ b/arch/arm/mach-tegra/edp.c
@@ -42,6 +42,8 @@ static unsigned int regulator_cur;
/* Value to subtract from regulator current limit */
static unsigned int edp_reg_override_mA = OVERRIDE_DEFAULT;
+static struct tegra_edp_limits *reg_mode_limits;
+
static const unsigned int *system_edp_limits;
static struct tegra_system_edp_entry *power_edp_limits;
@@ -507,6 +509,18 @@ void tegra_get_cpu_edp_limits(const struct tegra_edp_limits **limits, int *size)
*size = edp_limits_size;
}
+void __init tegra_init_cpu_reg_mode_limits(unsigned int regulator_mA,
+ unsigned int mode)
+{
+}
+
+void tegra_get_cpu_reg_mode_limits(const struct tegra_edp_limits **limits,
+ int *size, unsigned int mode)
+{
+ *limits = reg_mode_limits;
+ *size = edp_limits_size;
+}
+
void tegra_get_system_edp_limits(const unsigned int **limits)
{
*limits = system_edp_limits;