From a29e0c742740a296ecc27b20bed8dc4550412bee Mon Sep 17 00:00:00 2001 From: Joseph Lehrer Date: Fri, 19 Aug 2011 15:36:13 -0700 Subject: arm: tegra: add edp limit to debugfs bug 865842 Original-Change-Id: I54dcf3e2e968692746f1d8b17bdf912305f547a2 (cherry picked from commit 5b9dce25485824036f86db093b28a45a3cd86c76) Reviewed-on: http://git-master/r/48257 Reviewed-by: Joseph Lehrer Reviewed-by: Bharat Nihalani Tested-by: Bharat Nihalani Reviewed-by: Diwakar Tundlam Reviewed-by: Scott Williams Rebase-Id: R1adb1ca832e0f63f1e5b7e405f4c87c4a8a7aabe --- arch/arm/mach-tegra/edp.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-tegra/edp.c') diff --git a/arch/arm/mach-tegra/edp.c b/arch/arm/mach-tegra/edp.c index a8514488dc65..be1dd331e22f 100644 --- a/arch/arm/mach-tegra/edp.c +++ b/arch/arm/mach-tegra/edp.c @@ -26,7 +26,6 @@ #include "fuse.h" - static const struct tegra_edp_limits *edp_limits; static int edp_limits_size; @@ -180,6 +179,11 @@ void tegra_get_cpu_edp_limits(const struct tegra_edp_limits **limits, int *size) #ifdef CONFIG_DEBUG_FS +static int edp_limit_debugfs_show(struct seq_file *s, void *data) +{ + seq_printf(s, "%u\n", tegra_get_edp_limit()); +} + static int edp_debugfs_show(struct seq_file *s, void *data) { int i; @@ -207,6 +211,11 @@ static int edp_debugfs_open(struct inode *inode, struct file *file) return single_open(file, edp_debugfs_show, inode->i_private); } +static int edp_limit_debugfs_open(struct inode *inode, struct file *file) +{ + return single_open(file, edp_limit_debugfs_show, inode->i_private); +} + static const struct file_operations edp_debugfs_fops = { .open = edp_debugfs_open, @@ -215,6 +224,12 @@ static const struct file_operations edp_debugfs_fops = { .release = single_release, }; +static const struct file_operations edp_limit_debugfs_fops = { + .open = edp_limit_debugfs_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; static int __init tegra_edp_debugfs_init() { @@ -225,6 +240,9 @@ static int __init tegra_edp_debugfs_init() if (!d) return -ENOMEM; + d = debugfs_create_file("edp_limit", S_IRUGO, NULL, NULL, + &edp_limit_debugfs_fops); + return 0; } -- cgit v1.2.3