summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 */