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

Commit cdabf854 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "clk: Add support to allow clients to print all the enabled clocks" into msm-4.8

parents 5b78c733 6c15e540
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -2278,6 +2278,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);

@@ -2865,6 +2866,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
 *
@@ -2909,6 +2923,11 @@ static int __init clk_debug_init(void)
	if (!d)
		return -ENOMEM;


	d = debugfs_create_u32("debug_suspend", 0644, 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 *