Merge "soc: qcom: qcom_stats: Add support for deep sleep exit time"
This commit is contained in:
commit
35c7b7bd03
2 changed files with 38 additions and 0 deletions
|
|
@ -149,6 +149,7 @@ struct stats_drvdata {
|
|||
};
|
||||
|
||||
static struct stats_drvdata *drv;
|
||||
static u64 deep_sleep_last_exited_time;
|
||||
|
||||
struct sleep_stats {
|
||||
u32 stat_type;
|
||||
|
|
@ -275,6 +276,40 @@ static bool ddr_stats_is_freq_overtime(struct sleep_stats *data)
|
|||
return false;
|
||||
}
|
||||
|
||||
uint64_t get_aosd_sleep_exit_time(void)
|
||||
{
|
||||
int i;
|
||||
u64 last_exited_at;
|
||||
u32 count;
|
||||
static u32 saved_deep_sleep_count;
|
||||
u32 s_type = 0;
|
||||
char stat_type[5] = {0};
|
||||
|
||||
for (i = 0; i < drv->config->num_records; i++) {
|
||||
s_type = readl_relaxed(drv->d[i].base);
|
||||
memcpy(stat_type, &s_type, sizeof(u32));
|
||||
strim(stat_type);
|
||||
|
||||
if (!memcmp((const void *)stat_type, (const void *)"aosd", 4)) {
|
||||
count = readl_relaxed(drv->d[i].base + COUNT_OFFSET);
|
||||
|
||||
if (saved_deep_sleep_count == count)
|
||||
deep_sleep_last_exited_time = 0;
|
||||
else {
|
||||
saved_deep_sleep_count = count;
|
||||
last_exited_at = readq_relaxed(drv->d[i].base +
|
||||
LAST_EXITED_AT_OFFSET);
|
||||
deep_sleep_last_exited_time = last_exited_at;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return deep_sleep_last_exited_time;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(get_aosd_sleep_exit_time);
|
||||
|
||||
static u64 qcom_stats_fill_ddr_stats(void __iomem *reg, struct sleep_stats *data, u32 *entry_count)
|
||||
{
|
||||
u64 accumulated_duration = 0;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ void subsystem_sleep_debug_enable(bool enable);
|
|||
|
||||
int cx_stats_get_ss_vote_info(int ss_count,
|
||||
struct qcom_stats_cx_vote_info *vote_info);
|
||||
uint64_t get_aosd_sleep_exit_time(void);
|
||||
|
||||
#else
|
||||
|
||||
|
|
@ -62,6 +63,8 @@ void subsystem_sleep_debug_enable(bool enable)
|
|||
static inline int cx_stats_get_ss_vote_info(int ss_count,
|
||||
struct qcom_stats_cx_vote_info *vote_info)
|
||||
{ return -ENODEV; }
|
||||
uint64_t get_aosd_sleep_exit_time(void)
|
||||
{ return -ENODEV; }
|
||||
|
||||
#endif
|
||||
#endif /*__QCOM_STATS_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue