diff options
author | Ketut Putu Kumajaya <ketut.kumajaya@gmail.com> | 2013-09-19 14:37:30 +0700 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2015-04-11 20:24:52 +0200 |
commit | 20d3b80bbd277f11363ca6eaa4c1a2fb12dadf8c (patch) | |
tree | 7db3b5f5d86d5dbcb3cde87975facbb6482f22c1 | |
parent | 933f7c54d837ebb23b0eefdb3e6567844e7c1785 (diff) | |
download | device_samsung_tuna-20d3b80bbd277f11363ca6eaa4c1a2fb12dadf8c.zip device_samsung_tuna-20d3b80bbd277f11363ca6eaa4c1a2fb12dadf8c.tar.gz device_samsung_tuna-20d3b80bbd277f11363ca6eaa4c1a2fb12dadf8c.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
-rwxr-xr-x | pvr-source/services4/system/omap4/sgxfreq.c | 22 |
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 100755 --- 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); |