22 #include <linux/kernel.h>
23 #include <linux/sched.h>
27 #include <linux/module.h>
28 #include <linux/slab.h>
30 #include <plat/clock.h>
42 #ifdef CONFIG_DEBUG_FS
46 static int pm_dbg_init_done;
48 static int pm_dbg_init(
void);
51 DEBUG_FILE_COUNTERS = 0,
66 if (!pm_dbg_init_done)
72 pwrdm->state_timer[
prev] += t - pwrdm->timer;
77 static int clkdm_dbg_show_counter(
struct clockdomain *clkdm,
void *
user)
94 static int pwrdm_dbg_show_counter(
struct powerdomain *pwrdm,
void *user)
109 pwrdm_state_names[pwrdm->
state]);
115 for (i = 0; i < pwrdm->
banks; i++)
124 static int pwrdm_dbg_show_timer(
struct powerdomain *pwrdm,
void *user)
137 pwrdm_state_names[pwrdm->
state]);
139 for (i = 0; i < 4; i++)
140 seq_printf(s,
",%s:%lld", pwrdm_state_names[i],
141 pwrdm->state_timer[i]);
164 case DEBUG_FILE_COUNTERS:
167 case DEBUG_FILE_TIMERS:
181 static int pwrdm_suspend_get(
void *
data,
u64 *
val)
194 static int pwrdm_suspend_set(
void *data,
u64 val)
203 pwrdm_suspend_set,
"%llu\n");
213 for (i = 0; i < 4; i++)
214 pwrdm->state_timer[i] = 0;
222 if (!(IS_ERR_OR_NULL(d)))
224 (
void *)pwrdm, &pwrdm_suspend_fops);
229 static int option_get(
void *data,
u64 *val)
238 static int option_set(
void *data,
u64 val)
258 static int __init pm_dbg_init(
void)
262 if (pm_dbg_init_done)
266 if (IS_ERR_OR_NULL(d))
270 d, (
void *)DEBUG_FILE_COUNTERS, &debug_fops);
272 d, (
void *)DEBUG_FILE_TIMERS, &debug_fops);
278 pm_dbg_init_done = 1;