Skip to content

Commit 021dbec

Browse files
committed
opp: Expose of-node's name in debugfs
It is difficult to find which OPPs are active at the moment, specially if there are multiple OPPs with same frequency available in the device tree (controlled by supported hardware feature). Expose name of the DT node to find out the exact OPP. While at it, also expose level field. Reported-by: Leo Yan <leo.yan@linaro.org> Tested-by: Leo Yan <leo.yan@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent e783362 commit 021dbec

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/opp/debugfs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/debugfs.h>
1111
#include <linux/device.h>
1212
#include <linux/err.h>
13+
#include <linux/of.h>
1314
#include <linux/init.h>
1415
#include <linux/limits.h>
1516
#include <linux/slab.h>
@@ -131,9 +132,13 @@ void opp_debug_create_one(struct dev_pm_opp *opp, struct opp_table *opp_table)
131132
debugfs_create_bool("suspend", S_IRUGO, d, &opp->suspend);
132133
debugfs_create_u32("performance_state", S_IRUGO, d, &opp->pstate);
133134
debugfs_create_ulong("rate_hz", S_IRUGO, d, &opp->rate);
135+
debugfs_create_u32("level", S_IRUGO, d, &opp->level);
134136
debugfs_create_ulong("clock_latency_ns", S_IRUGO, d,
135137
&opp->clock_latency_ns);
136138

139+
opp->of_name = of_node_full_name(opp->np);
140+
debugfs_create_str("of_name", S_IRUGO, d, (char **)&opp->of_name);
141+
137142
opp_debug_create_supplies(opp, opp_table, d);
138143
opp_debug_create_bw(opp, opp_table, d);
139144

drivers/opp/opp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ struct dev_pm_opp {
9696

9797
#ifdef CONFIG_DEBUG_FS
9898
struct dentry *dentry;
99+
const char *of_name;
99100
#endif
100101
};
101102

0 commit comments

Comments
 (0)