From 76a153a66c8122fe13a84f8eac5392dae13c2dc0 Mon Sep 17 00:00:00 2001 From: Pawit Pornkitprasan Date: Sun, 30 Sep 2012 18:24:57 +0700 Subject: [PATCH] Power HAL: Remove sampling rate change Sampling rate change causes stutter while playing music. Stutter appears randomly, but has a higher chance of appearing when the screen goes from off to on. Change-Id: I9b23212165203c7ff7ef65021be09fd366e55770 --- exynos3/s5pc110/power/power.c | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/exynos3/s5pc110/power/power.c b/exynos3/s5pc110/power/power.c index d4185628..78a9f1ec 100644 --- a/exynos3/s5pc110/power/power.c +++ b/exynos3/s5pc110/power/power.c @@ -28,40 +28,14 @@ #include #define BOOSTPULSE_PATH "/sys/devices/system/cpu/cpufreq/ondemand/boostpulse" -#define SAMPLING_RATE_ONDEMAND "/sys/devices/system/cpu/cpufreq/ondemand/sampling_rate" -#define SAMPLING_RATE_SCREEN_ON "40000" -#define SAMPLING_RATE_SCREEN_OFF "400000" struct s5pc110_power_module { struct power_module base; pthread_mutex_t lock; int boostpulse_fd; int boostpulse_warned; - char sampling_rate_screen_on[PROPERTY_VALUE_MAX]; - char sampling_rate_screen_off[PROPERTY_VALUE_MAX]; }; -static void sysfs_write(char *path, char *s) -{ - char buf[80]; - int len; - int fd = open(path, O_WRONLY); - - if (fd < 0) { - strerror_r(errno, buf, sizeof(buf)); - ALOGE("Error opening %s: %s\n", path, buf); - return; - } - - len = write(fd, s, strlen(s)); - if (len < 0) { - strerror_r(errno, buf, sizeof(buf)); - ALOGE("Error writing to %s: %s\n", path, buf); - } - - close(fd); -} - static int boostpulse_open(struct s5pc110_power_module *s5pc110) { char buf[80]; @@ -119,17 +93,12 @@ static void s5pc110_power_hint(struct power_module *module, power_hint_t hint, static void s5pc110_power_set_interactive(struct power_module *module, int on) { - struct s5pc110_power_module *s5pc110 = (struct s5pc110_power_module *) module; - sysfs_write(SAMPLING_RATE_ONDEMAND, - on ? s5pc110->sampling_rate_screen_on : s5pc110->sampling_rate_screen_off); + return; } static void s5pc110_power_init(struct power_module *module) { - struct s5pc110_power_module *s5pc110 = (struct s5pc110_power_module *) module; - property_get("ro.sys.sampling_rate_on", s5pc110->sampling_rate_screen_on, SAMPLING_RATE_SCREEN_ON); - property_get("ro.sys.sampling_rate_off", s5pc110->sampling_rate_screen_off, SAMPLING_RATE_SCREEN_OFF); - sysfs_write(SAMPLING_RATE_ONDEMAND, s5pc110->sampling_rate_screen_on); + return; } static struct hw_module_methods_t power_module_methods = {