diff options
author | Joseph Lehrer <jlehrer@nvidia.com> | 2011-08-19 15:36:13 -0700 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2011-08-24 23:26:12 -0700 |
commit | f14747e9362783cddfc75fa33a8ea06cfd38b139 (patch) | |
tree | 8d473b5a1b67da0f5dbb0c3e90137c2445bda1d5 /arch | |
parent | 933f305e68d5a256b0de9d388fc9f12448c862c4 (diff) |
arm: tegra: add edp limit to debugfs
bug 865842
Change-Id: I54dcf3e2e968692746f1d8b17bdf912305f547a2
(cherry picked from commit 5b9dce25485824036f86db093b28a45a3cd86c76)
Reviewed-on: http://git-master/r/48257
Reviewed-by: Joseph Lehrer <jlehrer@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/cpu-tegra.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-tegra/edp.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-tegra/include/mach/edp.h | 3 |
3 files changed, 27 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c index bd791aae13d5..af505aae9ff3 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c @@ -105,6 +105,11 @@ static int edp_thermal_index; static cpumask_t edp_cpumask; static unsigned int edp_limit; +unsigned int tegra_get_edp_limit(void) +{ + return edp_limit; +} + static void edp_update_limit(void) { unsigned int limit = cpumask_weight(&edp_cpumask); 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; } diff --git a/arch/arm/mach-tegra/include/mach/edp.h b/arch/arm/mach-tegra/include/mach/edp.h index 1af8d9e55a95..8cba6da8b1e9 100644 --- a/arch/arm/mach-tegra/include/mach/edp.h +++ b/arch/arm/mach-tegra/include/mach/edp.h @@ -42,6 +42,7 @@ struct tegra_edp_limits { int tegra_edp_update_thermal_zone(int temperature); void tegra_init_cpu_edp_limits(unsigned int regulator_mA); void tegra_get_cpu_edp_limits(const struct tegra_edp_limits **limits, int *size); +unsigned int tegra_get_edp_limit(void); #else static inline void tegra_init_cpu_edp_limits(int regulator_mA) @@ -51,6 +52,8 @@ static inline int tegra_edp_update_thermal_zone(int temperature) static inline void tegra_get_cpu_edp_limits(struct tegra_edp_limits **limits, int *size) {} +static inline unsigned int tegra_get_edp_limit(void) +{ return -1; } #endif #endif /* __MACH_EDP_H */ |