summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorJoseph Lehrer <jlehrer@nvidia.com>2011-08-19 15:36:13 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:48:33 -0800
commita29e0c742740a296ecc27b20bed8dc4550412bee (patch)
tree50abf07270d70e5d5eeff5288cf6b0e492d7af57 /arch/arm
parent0689b2bc77c85b39c6e398c3dab250f0fb279694 (diff)
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 <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> Rebase-Id: R1adb1ca832e0f63f1e5b7e405f4c87c4a8a7aabe
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c5
-rw-r--r--arch/arm/mach-tegra/edp.c20
-rw-r--r--arch/arm/mach-tegra/include/mach/edp.h3
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 a37edd781352..2f3fcc8de945 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -103,6 +103,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 */