diff options
author | Alex Frid <afrid@nvidia.com> | 2011-11-19 17:28:31 -0800 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2011-12-15 12:06:15 +0530 |
commit | 051a0b2e40779eee1125308bac32e1957570ccd6 (patch) | |
tree | 543f5ff68118d020092e3b6c88d178810027a5b3 /arch/arm/mach-tegra/dvfs.h | |
parent | 7b6ad0c9924f567c8bd4dd7c2fbadf6ee8a960a8 (diff) |
ARM: tegra: dvfs: Add DVFS rails statistic
On Tegra3: complete account of in- and out-of-bound rails control.
On Tegra2: out-of-bound vdd_cpu control in LP2 state is not accounted.
Change-Id: Ib68cbbfe3e4f965e758aca17a0ba30277d530347
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/67340
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 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/dvfs.h b/arch/arm/mach-tegra/dvfs.h index 60f8d51c6f1a..462eef645a4f 100644 --- a/arch/arm/mach-tegra/dvfs.h +++ b/arch/arm/mach-tegra/dvfs.h @@ -22,6 +22,7 @@ #define _TEGRA_DVFS_H_ #define MAX_DVFS_FREQS 18 +#define DVFS_RAIL_STATS_TOP_BIN 40 struct clk; struct dvfs_rail; @@ -43,6 +44,13 @@ struct dvfs_relationship { bool solved_at_nominal; }; +struct rail_stats { + ktime_t time_at_mv[DVFS_RAIL_STATS_TOP_BIN + 1]; + ktime_t last_update; + int last_index; + bool off; +}; + struct dvfs_rail { const char *reg_id; int min_millivolts; @@ -62,6 +70,7 @@ struct dvfs_rail { int millivolts; int new_millivolts; bool suspended; + struct rail_stats stats; }; struct dvfs { @@ -88,6 +97,8 @@ struct dvfs { struct list_head reg_node; }; +extern struct dvfs_rail *tegra_cpu_rail; + #ifdef CONFIG_TEGRA_SILICON_PLATFORM void tegra_soc_init_dvfs(void); int tegra_enable_dvfs_on_clk(struct clk *c, struct dvfs *d); @@ -98,6 +109,9 @@ void tegra_dvfs_add_relationships(struct dvfs_relationship *rels, int n); void tegra_dvfs_rail_enable(struct dvfs_rail *rail); void tegra_dvfs_rail_disable(struct dvfs_rail *rail); bool tegra_dvfs_rail_updating(struct clk *clk); +void tegra_dvfs_rail_off(struct dvfs_rail *rail, ktime_t now); +void tegra_dvfs_rail_on(struct dvfs_rail *rail, ktime_t now); +void tegra_dvfs_rail_pause(struct dvfs_rail *rail, ktime_t delta, bool on); struct dvfs_rail *tegra_dvfs_get_rail_by_name(const char *reg_id); int tegra_dvfs_predict_millivolts(struct clk *c, unsigned long rate); void tegra_dvfs_core_cap_enable(bool enable); @@ -121,6 +135,13 @@ static inline void tegra_dvfs_rail_disable(struct dvfs_rail *rail) {} static inline bool tegra_dvfs_rail_updating(struct clk *clk) { return false; } +static inline void tegra_dvfs_rail_off(struct dvfs_rail *rail, ktime_t now) +{} +static inline void tegra_dvfs_rail_on(struct dvfs_rail *rail, ktime_t now) +{} +static inline void tegra_dvfs_rail_pause( + struct dvfs_rail *rail, ktime_t delta, bool on) +{} static inline struct dvfs_rail *tegra_dvfs_get_rail_by_name(const char *reg_id) { return NULL; } static inline int tegra_dvfs_predict_millivolts(struct clk *c, unsigned long rate) |