diff options
| -rw-r--r-- | arch/arm/plat-omap/clock.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index c9122dd6ee8d..156b27dd5817 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
| @@ -475,8 +475,41 @@ int __init clk_init(struct clk_functions * custom_clocks) | |||
| 475 | /* | 475 | /* |
| 476 | * debugfs support to trace clock tree hierarchy and attributes | 476 | * debugfs support to trace clock tree hierarchy and attributes |
| 477 | */ | 477 | */ |
| 478 | |||
| 479 | #include <linux/debugfs.h> | ||
| 480 | #include <linux/seq_file.h> | ||
| 481 | |||
| 478 | static struct dentry *clk_debugfs_root; | 482 | static struct dentry *clk_debugfs_root; |
| 479 | 483 | ||
| 484 | static int clk_dbg_show_summary(struct seq_file *s, void *unused) | ||
| 485 | { | ||
| 486 | struct clk *c; | ||
| 487 | struct clk *pa; | ||
| 488 | |||
| 489 | seq_printf(s, "%-30s %-30s %-10s %s\n", | ||
| 490 | "clock-name", "parent-name", "rate", "use-count"); | ||
| 491 | |||
| 492 | list_for_each_entry(c, &clocks, node) { | ||
| 493 | pa = c->parent; | ||
| 494 | seq_printf(s, "%-30s %-30s %-10lu %d\n", | ||
| 495 | c->name, pa ? pa->name : "none", c->rate, c->usecount); | ||
| 496 | } | ||
| 497 | |||
| 498 | return 0; | ||
| 499 | } | ||
| 500 | |||
| 501 | static int clk_dbg_open(struct inode *inode, struct file *file) | ||
| 502 | { | ||
| 503 | return single_open(file, clk_dbg_show_summary, inode->i_private); | ||
| 504 | } | ||
| 505 | |||
| 506 | static const struct file_operations debug_clock_fops = { | ||
| 507 | .open = clk_dbg_open, | ||
| 508 | .read = seq_read, | ||
| 509 | .llseek = seq_lseek, | ||
| 510 | .release = single_release, | ||
| 511 | }; | ||
| 512 | |||
| 480 | static int clk_debugfs_register_one(struct clk *c) | 513 | static int clk_debugfs_register_one(struct clk *c) |
| 481 | { | 514 | { |
| 482 | int err; | 515 | int err; |
| @@ -551,6 +584,12 @@ static int __init clk_debugfs_init(void) | |||
| 551 | if (err) | 584 | if (err) |
| 552 | goto err_out; | 585 | goto err_out; |
| 553 | } | 586 | } |
| 587 | |||
| 588 | d = debugfs_create_file("summary", S_IRUGO, | ||
| 589 | d, NULL, &debug_clock_fops); | ||
| 590 | if (!d) | ||
| 591 | return -ENOMEM; | ||
| 592 | |||
| 554 | return 0; | 593 | return 0; |
| 555 | err_out: | 594 | err_out: |
| 556 | debugfs_remove_recursive(clk_debugfs_root); | 595 | debugfs_remove_recursive(clk_debugfs_root); |
