summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalimochoAz <calimochoazucarado@gmail.com>2011-12-10 07:30:16 +0100
committerKalimochoAz <calimochoazucarado@gmail.com>2011-12-10 07:30:16 +0100
commit231c7d49058781d5d362304452ff8a2a7d5509b3 (patch)
tree5d9f2565ef734a61dfafa036195eec4cebc6de73
parent668cf2c9469a144bdfd9289728e6b88e611a8a96 (diff)
downloaddevice_samsung_crespo-231c7d49058781d5d362304452ff8a2a7d5509b3.zip
device_samsung_crespo-231c7d49058781d5d362304452ff8a2a7d5509b3.tar.gz
device_samsung_crespo-231c7d49058781d5d362304452ff8a2a7d5509b3.tar.bz2
Revert liblight extra settings for blink
Since now kernel won't allow more blink, this part has no more sense to be there. Change-Id: I4acbae72de3af5fe0b015fb10f53e054e96e19bd
-rwxr-xr-xliblight/lights.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/liblight/lights.c b/liblight/lights.c
index 28b7599..470c217 100755
--- a/liblight/lights.c
+++ b/liblight/lights.c
@@ -56,32 +56,6 @@ static int write_int(char const *path, int value)
}
}
-static int read_int(char const *path)
-{
- int fd;
- static int already_warned = 0;
-
- LOGV("read_int: path %s", path);
- fd = open(path, O_RDWR);
-
- if (fd >= 0) {
- char cValor;
- int amt = read(fd, &cValor, 1);
- close(fd);
- if (amt == -1 )
- return -errno;
- else
- return atoi(&cValor);
- return amt == -1 ? -errno : 0;
- } else {
- if (already_warned == 0) {
- LOGE("read_int failed to open %s\n", path);
- already_warned = 1;
- }
- return -errno;
- }
-}
-
static int rgb_to_brightness(struct light_state_t const *state)
{
int color = state->color & 0x00ffffff;
@@ -96,7 +70,6 @@ static int set_light_notifications(struct light_device_t* dev,
int brightness = rgb_to_brightness(state);
int v = 0;
int ret = 0;
- int iAct;
pthread_mutex_lock(&g_lock);
if (brightness+state->color == 0 || brightness > 100) {
@@ -104,13 +77,9 @@ static int set_light_notifications(struct light_device_t* dev,
v = 1;
} else
v = 0;
- iAct = read_int(LED_FILE);
- LOGI("color %u fm %u status %u is lit %u brightness iAct: %d", state->color, state->flashMode, v, (state->color & 0x00ffffff), brightness, iAct);
- if ( iAct == 2 && v == 1 )
- v = 2;
+ LOGI("color %u fm %u status %u is lit %u brightness", state->color, state->flashMode, v, (state->color & 0x00ffffff), brightness);
ret = write_int(LED_FILE, v);
pthread_mutex_unlock(&g_lock);
-
return ret;
}