Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9b1975f authored by Taniya Das's avatar Taniya Das
Browse files

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: default avatarTaniya Das <tdas@codeaurora.org>
parent dba9af81
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -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);
+4 −0
Original line number Diff line number Diff line
@@ -20,6 +20,10 @@ struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec,
struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id,
			     const char *con_id);
void __clk_free_clk(struct clk *clk);

/* Debugfs API to print the enabled clocks */
void clock_debug_print_enabled(void);

#else
/* All these casts to avoid ifdefs in clkdev... */
static inline struct clk *