Commit 61927135 authored by Colin Cross's avatar Colin Cross Committed by Kukjin Kim

ARM: SAMSUNG: call clk_get_rate for debugfs rate files

c->rate is rarely set, call clk_get_rate on the clock to print
the value in /d/clock/.../rate.
Signed-off-by: default avatarColin Cross <ccross@android.com>
Signed-off-by: default avatarJonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 52569e2f
...@@ -447,6 +447,14 @@ static const struct file_operations clock_tree_fops = { ...@@ -447,6 +447,14 @@ static const struct file_operations clock_tree_fops = {
.release = single_release, .release = single_release,
}; };
static int clock_rate_show(void *data, u64 *val)
{
struct clk *c = data;
*val = clk_get_rate(c);
return 0;
}
DEFINE_SIMPLE_ATTRIBUTE(clock_rate_fops, clock_rate_show, NULL, "%llu\n");
static int clk_debugfs_register_one(struct clk *c) static int clk_debugfs_register_one(struct clk *c)
{ {
int err; int err;
...@@ -469,7 +477,7 @@ static int clk_debugfs_register_one(struct clk *c) ...@@ -469,7 +477,7 @@ static int clk_debugfs_register_one(struct clk *c)
goto err_out; goto err_out;
} }
d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate); d = debugfs_create_file("rate", S_IRUGO, c->dent, c, &clock_rate_fops);
if (!d) { if (!d) {
err = -ENOMEM; err = -ENOMEM;
goto err_out; goto err_out;
......
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