summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKetut Putu Kumajaya <ketut.kumajaya@gmail.com>2013-09-19 14:37:30 +0700
committerDániel Járai <jaraidaniel@gmail.com>2015-10-18 11:06:49 -0700
commit5f7c7837ef09d4c5c0c443b7cc542aa25ec79bab (patch)
treea852aced86a13df1dba5d7935a639e71f7137404
parentfd72df818db74c65825b8c46ab7dd9b236b95d4e (diff)
downloadhardware_ti_omap4-5f7c7837ef09d4c5c0c443b7cc542aa25ec79bab.zip
hardware_ti_omap4-5f7c7837ef09d4c5c0c443b7cc542aa25ec79bab.tar.gz
hardware_ti_omap4-5f7c7837ef09d4c5c0c443b7cc542aa25ec79bab.tar.bz2
sgxfreq: add sysfs interface to store frequency limit
Utilize all in kernel GPU frequencies but we can limit it to spesific value. Replacement for the old in kernel gpu_oc sysfs interface to verclock the GPU, have no harm to non-overclocked kernel Change-Id: I2d9d1f05b0306de074ffdd327e9bf2a23c9d973f (cherry picked from commit b401521a4f1f8fad4daf3e261c27177873346cf4)
-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);