summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/cpu-tegra.h
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/cpu-tegra.h
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/cpu-tegra.h')
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.h b/arch/arm/mach-tegra/cpu-tegra.h
index 84504bb0ccc1..cd11c249b17c 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-2013, NVIDIA Corporation.
+ * Copyright (c) 2011-2013, NVIDIA Corporation. 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 as published by
@@ -65,4 +65,14 @@ static inline int tegra_suspended_target(unsigned int target_freq)
{ return -ENOSYS; }
#endif
+#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_TEGRA_EDP_LIMITS)
+int tegra_update_cpu_edp_limits(void);
+int tegra_cpu_reg_mode_force_normal(bool force);
+#else
+static inline int tegra_update_cpu_edp_limits(void)
+{ return 0; }
+static inline int tegra_cpu_reg_mode_force_normal(bool force)
+{ return 0; }
+#endif
+
#endif /* __MACH_TEGRA_CPU_TEGRA_H */