diff options
author | Alex Frid <afrid@nvidia.com> | 2013-10-30 13:38:19 -0700 |
---|---|---|
committer | Yu-Huan Hsu <yhsu@nvidia.com> | 2013-11-04 11:44:21 -0800 |
commit | 29398abbc8eb7f95bb7d9bb0021f723a6bc9cde4 (patch) | |
tree | 3ad0ab485d2bd00e2a6f7fe37eb693eaa844544b /arch/arm/mach-tegra/dvfs.h | |
parent | c9946a79f856a95fa6c8faf33ca2d97962e4ba56 (diff) |
ARM: tegra: dvfs: Add deferred override option
Added an option to defer aggregation of module peak voltage into core
override floor after DVFS initialization. This way the peak voltage can
be determined based on board specific maximum rate rather than using
maximum chip capability. Provided interface to specify deferred maximum
rates, and platform specific call-back to adjust DVFS tables (when
necessary) after final override floor is resolved. Override floor is
reported equal to nominal voltage (i.e., zero override range) until
all deferred limits are known.
Bug 1372817
Change-Id: Iaee091a3dd95f1cbdb93efae71cbe6fa1048a895
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/323712
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/dvfs.h')
-rw-r--r-- | arch/arm/mach-tegra/dvfs.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/arm/mach-tegra/dvfs.h b/arch/arm/mach-tegra/dvfs.h index 6508d9791f63..d203d2807444 100644 --- a/arch/arm/mach-tegra/dvfs.h +++ b/arch/arm/mach-tegra/dvfs.h @@ -72,6 +72,8 @@ struct dvfs_rail { int fixed_millivolts; int override_millivolts; int min_override_millivolts; + int override_unresolved; + int (*resolve_override)(int mv); const int *therm_mv_floors; int therm_mv_floors_num; @@ -149,6 +151,7 @@ struct dvfs { struct dvfs_rail *dvfs_rail; bool auto_dvfs; bool can_override; + bool defer_override; /* Filled in by tegra_dvfs_init */ int max_millivolts; @@ -270,6 +273,16 @@ int tegra_dvfs_init_thermal_dvfs_voltages(int *millivolts, int *peak_millivolts, int freqs_num, int ranges_num, struct dvfs *d); int tegra_dvfs_rail_dfll_mode_set_cold(struct dvfs_rail *rail); +#ifdef CONFIG_TEGRA_VDD_CORE_OVERRIDE +int tegra_dvfs_resolve_override(struct clk *c, unsigned long max_rate); +int tegra_dvfs_rail_get_override_floor(struct dvfs_rail *rail); +#else +static inline int tegra_dvfs_resolve_override(struct clk *c, unsigned long rate) +{ return 0; } +static inline int tegra_dvfs_rail_get_override_floor(struct dvfs_rail *rail) +{ return 0; } +#endif + #ifndef CONFIG_ARCH_TEGRA_2x_SOC int tegra_dvfs_rail_disable_prepare(struct dvfs_rail *rail); int tegra_dvfs_rail_post_enable(struct dvfs_rail *rail); @@ -352,13 +365,6 @@ static inline int tegra_dvfs_rail_get_thermal_floor(struct dvfs_rail *rail) return 0; } -static inline int tegra_dvfs_rail_get_override_floor(struct dvfs_rail *rail) -{ - if (rail) - return rail->min_override_millivolts; - return -ENOENT; -} - static inline bool tegra_dvfs_is_dfll_bypass(void) { #ifdef CONFIG_REGULATOR_TEGRA_DFLL_BYPASS |