static int pm_dbg_show_counters(struct seq_file *s, void *unused) { pwrdm_for_each(pwrdm_dbg_show_counter, s); clkdm_for_each(clkdm_dbg_show_counter, s); return 0; }
static int voltdm_dbg_show_counters(struct voltagedomain *voltdm, void *user) { struct seq_file *s = user; seq_printf(s, "%s : %d\n", voltdm->name, atomic_read(&voltdm->usecount)); parent_voltdm = voltdm; pwrdm_for_each(voltdm_child_show, s); return 0; }
static int __init pm_dbg_init(void) { struct dentry *d; if (pm_dbg_init_done) return 0; d = debugfs_create_dir("pm_debug", NULL); if (IS_ERR_OR_NULL(d)) return PTR_ERR(d); (void) debugfs_create_file("count", S_IRUGO, d, (void *)DEBUG_FILE_COUNTERS, &debug_fops); (void) debugfs_create_file("time", S_IRUGO, d, (void *)DEBUG_FILE_TIMERS, &debug_fops); pwrdm_for_each(pwrdms_setup, (void *)d); (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d, &enable_off_mode, &pm_dbg_option_fops); if (cpu_is_omap44xx() || cpu_is_omap54xx()) (void) debugfs_create_file("enable_oswr_mode", S_IRUGO | S_IWUSR, d, &enable_oswr_mode, &pm_dbg_option_fops); if (cpu_is_omap34xx()) off_mode_enable_func = omap3_pm_off_mode_enable; if (cpu_is_omap44xx()) off_mode_enable_func = omap4_pm_off_mode_enable; pm_dbg_init_done = 1; return 0; }
static int __init pm_dbg_init(void) { struct dentry *d; if (pm_dbg_init_done) return 0; d = debugfs_create_dir("pm_debug", NULL); if (!d) return -EINVAL; (void) debugfs_create_file("count", S_IRUGO, d, (void *)DEBUG_FILE_COUNTERS, &debug_fops); (void) debugfs_create_file("time", S_IRUGO, d, (void *)DEBUG_FILE_TIMERS, &debug_fops); pwrdm_for_each(pwrdms_setup, (void *)d); (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d, &enable_off_mode, &pm_dbg_option_fops); pm_dbg_init_done = 1; return 0; }