summaryrefslogtreecommitdiff
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
authorTaniya Das <tdas@codeaurora.org>2016-11-07 10:08:30 +0530
committerTaniya Das <tdas@codeaurora.org>2016-11-16 09:16:52 +0530
commitb9b1975fe3f2d0ea767be06a494a8e5983cab911 (patch)
tree70b3dd4dd6a1b21e0062e76a84845f2dcf4b83a2 /drivers/clk/clk.c
parentdba9af81b8765aa65fed6488b29eb4bbfe90267d (diff)
clk: Add support to allow client to print all enabled clocks
The clock api clock_debug_print_enabled would allow any client like low power driver to print all the enabled clocks which include the prepare_count/enable_count/rate/rate max vote. Change-Id: I936496e553bc958c10e743fd8a225ffc7fbc0f79 Signed-off-by: Taniya Das <tdas@codeaurora.org>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index deb935ce6a11..25ab30063072 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2267,6 +2267,7 @@ EXPORT_SYMBOL_GPL(clk_set_flags);
static struct dentry *rootdir;
static int inited = 0;
+static u32 debug_suspend;
static DEFINE_MUTEX(clk_debug_lock);
static HLIST_HEAD(clk_debug_list);
@@ -2854,6 +2855,19 @@ struct dentry *clk_debugfs_add_file(struct clk_hw *hw, char *name, umode_t mode,
}
EXPORT_SYMBOL_GPL(clk_debugfs_add_file);
+/*
+ * Print the names of all enabled clocks and their parents if
+ * debug_suspend is set from debugfs.
+ */
+void clock_debug_print_enabled(void)
+{
+ if (likely(!debug_suspend))
+ return;
+
+ clock_debug_print_enabled_clocks(NULL);
+}
+EXPORT_SYMBOL_GPL(clock_debug_print_enabled);
+
/**
* clk_debug_init - lazily populate the debugfs clk directory
*
@@ -2898,6 +2912,12 @@ static int __init clk_debug_init(void)
if (!d)
return -ENOMEM;
+
+ d = debugfs_create_u32("debug_suspend", S_IRUGO | S_IWUSR,
+ rootdir, &debug_suspend);
+ if (!d)
+ return -ENOMEM;
+
mutex_lock(&clk_debug_lock);
hlist_for_each_entry(core, &clk_debug_list, debug_node)
clk_debug_create_one(core, rootdir);