summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2014-06-30 00:20:34 +0200
committerPaul Kocialkowski <contact@paulk.fr>2014-06-30 00:20:34 +0200
commitec61b9642c84449328487bc3cea00d54164e49e7 (patch)
treec1e68924e87bc4e5c3b6ba88162606af41263cb1
parenteec0d833d918145db1c81c28cd624b9cfc2b18f7 (diff)
downloaddevice_samsung_tuna-replicant-4.2-0003.zip
device_samsung_tuna-replicant-4.2-0003.tar.gz
device_samsung_tuna-replicant-4.2-0003.tar.bz2
Revert "liblight: Blank/unblank framebuffer on screen off/on"replicant-4.2-0004replicant-4.2-0003replicant-4.2-0002replicant-4.2
This reverts commit eec0d833d918145db1c81c28cd624b9cfc2b18f7.
-rw-r--r--liblight/lights.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/liblight/lights.c b/liblight/lights.c
index 776b7d7..1dfcd8b 100644
--- a/liblight/lights.c
+++ b/liblight/lights.c
@@ -25,11 +25,9 @@
#include <sys/types.h>
#include <hardware/lights.h>
#include <linux/leds-an30259a.h>
-#include <linux/fb.h>
static pthread_once_t g_init = PTHREAD_ONCE_INIT;
static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
-static int g_blanked = 0;
char const *const LCD_FILE = "/sys/class/backlight/s6e8aa0/brightness";
char const *const LED_FILE = "/dev/an30259a_leds";
@@ -82,39 +80,6 @@ static int rgb_to_brightness(struct light_state_t const *state)
+ (150*((color>>8) & 0x00ff)) + (29*(color & 0x00ff))) >> 8;
}
-static int fb_blank(int blank)
-{
- int fd = -1;
- int rc;
-
- fd = open("/dev/graphics/fb0", O_RDWR);
- if (fd < 0) {
- ALOGE("Opening framebuffer failed");
- goto error;
- }
-
- if (blank)
- rc = ioctl(fd, FBIOBLANK, FB_BLANK_POWERDOWN);
- else
- rc = ioctl(fd, FBIOBLANK, FB_BLANK_UNBLANK);
- if (rc < 0) {
- ALOGE("Blanking framebuffer failed");
- goto error;
- }
-
- rc = 0;
- goto complete;
-
-error:
- rc = -1;
-
-complete:
- if (fd >= 0)
- close(fd);
-
- return rc;
-}
-
static int set_light_backlight(struct light_device_t *dev,
struct light_state_t const *state)
{
@@ -124,16 +89,6 @@ static int set_light_backlight(struct light_device_t *dev,
pthread_mutex_lock(&g_lock);
err = write_int(LCD_FILE, brightness);
- if (brightness == 0) {
- err |= fb_blank(1);
- ALOGD("Blanked frambuffer");
- g_blanked = 1;
- } else if (g_blanked) {
- err |= fb_blank(0);
- ALOGD("Unblanked frambuffer");
- g_blanked = 0;
- }
-
pthread_mutex_unlock(&g_lock);
return err;
}