summaryrefslogtreecommitdiffstats
path: root/exynos4
diff options
context:
space:
mode:
authorDaniel Hillenbrand <codeworkx@cyanogenmod.com>2012-07-09 14:14:28 +0400
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-07-09 14:14:28 +0400
commit8ada6ea604a1d76b9d9f392147727b4a173a39b2 (patch)
tree0be59e40560f374b26f58be1823d618cbe408e51 /exynos4
parent86d0895f82ca01b07da6e0d1e5e37d26f5114333 (diff)
parent4c88bee69d0ccca502c6de8c0c536fa096e597c0 (diff)
downloadhardware_samsung-8ada6ea604a1d76b9d9f392147727b4a173a39b2.zip
hardware_samsung-8ada6ea604a1d76b9d9f392147727b4a173a39b2.tar.gz
hardware_samsung-8ada6ea604a1d76b9d9f392147727b4a173a39b2.tar.bz2
Merge "exynos4212 liblights: fix keypad lighting up when screen backlight auto-adjusts" into ics
Diffstat (limited to 'exynos4')
-rw-r--r--exynos4/exynos4210/liblights/lights.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/exynos4/exynos4210/liblights/lights.c b/exynos4/exynos4210/liblights/lights.c
index c328f8b..6498eda 100644
--- a/exynos4/exynos4210/liblights/lights.c
+++ b/exynos4/exynos4210/liblights/lights.c
@@ -231,17 +231,18 @@ static int
set_light_backlight(struct light_device_t* dev,
struct light_state_t const* state)
{
- load_settings();
-
int err = 0;
+ static int s_previous_brightness = -1;
int brightness = rgb_to_brightness(state);
pthread_mutex_lock(&g_lock);
err = write_int(PANEL_FILE, brightness);
#ifndef EXYNOS4210_TABLET
- if (g_enable_touchlight == -1 || g_enable_touchlight > 0)
- err = write_int(BUTTON_FILE, brightness > 0 ? 1 : 0);
+ if (!s_previous_brightness && (brightness > 0)) {
+ err = write_int(BUTTON_FILE, brightness > 0 ? 1 : 2);
+ s_previous_brightness = brightness;
+ }
#endif
pthread_mutex_unlock(&g_lock);