diff options
author | Sam Mortimer <sam@mortimer.me.uk> | 2012-07-01 22:46:59 -0700 |
---|---|---|
committer | Sam Mortimer <sam@mortimer.me.uk> | 2012-07-02 11:06:09 -0700 |
commit | 4c88bee69d0ccca502c6de8c0c536fa096e597c0 (patch) | |
tree | 36f3ddaf36b4f1991a376d661d60b24cfd32b280 /exynos4 | |
parent | b20c5367514dc976afbc7f074ad5b8a49bbc592b (diff) | |
download | hardware_samsung-4c88bee69d0ccca502c6de8c0c536fa096e597c0.zip hardware_samsung-4c88bee69d0ccca502c6de8c0c536fa096e597c0.tar.gz hardware_samsung-4c88bee69d0ccca502c6de8c0c536fa096e597c0.tar.bz2 |
exynos4212 liblights: fix keypad lighting up when screen backlight auto-adjusts
clone of http://review.cyanogenmod.com/#/c/18372/
becomes relevant when these are applied:
smdk4210 kernel: cypress touchkey led_timeout functionality (1/2)
http://review.cyanogenmod.com/#/c/18357/
galaxys2/i777: configurable touchkey backlight timeout (2/2)
http://review.cyanogenmod.com/#/c/18431/
Change-Id: I3d4df6574cdd3c6317199a884ef7ac72cb4c71a3
Diffstat (limited to 'exynos4')
-rw-r--r-- | exynos4/exynos4210/liblights/lights.c | 9 |
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); |