Commit 152fe36e authored by Magnus Damm's avatar Magnus Damm Committed by Paul Mundt

sh: Show all clocks and their state in /proc/clocks

Show all clocks in /proc/clocks, and also show if they are enabled or
disabled. This is useful to show MSTPCR bits on SuperH Mobile processors.
Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 1312994c
...@@ -308,15 +308,11 @@ static int show_clocks(char *buf, char **start, off_t off, ...@@ -308,15 +308,11 @@ static int show_clocks(char *buf, char **start, off_t off,
list_for_each_entry_reverse(clk, &clock_list, node) { list_for_each_entry_reverse(clk, &clock_list, node) {
unsigned long rate = clk_get_rate(clk); unsigned long rate = clk_get_rate(clk);
/* p += sprintf(p, "%-12s\t: %ld.%02ldMHz\t%s\n", clk->name,
* Don't bother listing dummy clocks with no ancestry rate / 1000000, (rate % 1000000) / 10000,
* that only support enable and disable ops. ((clk->flags & CLK_ALWAYS_ENABLED) ||
*/ (atomic_read(&clk->kref.refcount) != 1)) ?
if (unlikely(!rate && !clk->parent)) "enabled" : "disabled");
continue;
p += sprintf(p, "%-12s\t: %ld.%02ldMHz\n", clk->name,
rate / 1000000, (rate % 1000000) / 10000);
} }
return p - buf; return p - buf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment