summaryrefslogtreecommitdiffstats
path: root/pvr-source/services4/system/omap4/sgxfreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'pvr-source/services4/system/omap4/sgxfreq.c')
-rw-r--r--pvr-source/services4/system/omap4/sgxfreq.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/pvr-source/services4/system/omap4/sgxfreq.c b/pvr-source/services4/system/omap4/sgxfreq.c
index 7e8e8fd..65543a5 100644
--- a/pvr-source/services4/system/omap4/sgxfreq.c
+++ b/pvr-source/services4/system/omap4/sgxfreq.c
@@ -107,6 +107,26 @@ static ssize_t show_frequency_limit(struct device *dev,
return sprintf(buf, "%lu\n", sfd.freq_limit);
}
+/*
+ * sysfs interface to store sgxfreq frequency limit
+ * author: ketut.kumajaya@gmail.com
+*/
+static ssize_t store_frequency_limit(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ unsigned long freq_limit;
+
+ if (kstrtoul(buf, 0, &freq_limit)) {
+ pr_err("sgxfreq: failed storing frequency_limit\n");
+ return -EINVAL;
+ }
+
+ freq_limit = sgxfreq_set_freq_limit(freq_limit);
+ pr_info("sgxfreq: frequency_limit=%lu\n", freq_limit);
+ return count;
+}
+
static ssize_t show_frequency(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -169,7 +189,7 @@ static ssize_t store_governor(struct device *dev,
static DEVICE_ATTR(frequency_list, 0444, show_frequency_list, NULL);
static DEVICE_ATTR(frequency_request, 0444, show_frequency_request, NULL);
-static DEVICE_ATTR(frequency_limit, 0444, show_frequency_limit, NULL);
+static DEVICE_ATTR(frequency_limit, 0644, show_frequency_limit, store_frequency_limit);
static DEVICE_ATTR(frequency, 0444, show_frequency, NULL);
static DEVICE_ATTR(governor_list, 0444, show_governor_list, NULL);
static DEVICE_ATTR(governor, 0644, show_governor, store_governor);