mirror of
https://github.com/team-infusion-developers/android_hardware_samsung.git
synced 2024-11-06 21:55:41 +00:00
exynos4x12: lower brightness on battery light
Change-Id: Ic3cd8f9bac985e09d7f7df0521cbaadfc9640f11
This commit is contained in:
parent
61bb8c4def
commit
3c04c0d0a8
1 changed files with 7 additions and 0 deletions
|
@ -46,6 +46,7 @@ char const*const LED_RED = "/sys/class/sec/led/led_r";
|
|||
char const*const LED_GREEN = "/sys/class/sec/led/led_g";
|
||||
char const*const LED_BLUE = "/sys/class/sec/led/led_b";
|
||||
char const*const LED_BLINK = "/sys/class/sec/led/led_blink";
|
||||
char const*const LED_BRIGHTNESS = "/sys/class/sec/led/led_br_lev";
|
||||
|
||||
#define MAX_WRITE_CMD 25
|
||||
|
||||
|
@ -53,6 +54,7 @@ struct led_config {
|
|||
int red;
|
||||
int green;
|
||||
int blue;
|
||||
char brightness[MAX_WRITE_CMD];
|
||||
char blink[MAX_WRITE_CMD];
|
||||
};
|
||||
|
||||
|
@ -151,6 +153,7 @@ static int write_leds(struct led_config led)
|
|||
err = write_int(LED_RED, led.red);
|
||||
err = write_int(LED_GREEN, led.green);
|
||||
err = write_int(LED_BLUE, led.blue);
|
||||
err = write_str(LED_BRIGHTNESS, led.brightness);
|
||||
err = write_str(LED_BLINK, led.blink);
|
||||
pthread_mutex_unlock(&g_lock);
|
||||
|
||||
|
@ -169,6 +172,7 @@ static int set_light_leds(struct light_state_t const *state, int type)
|
|||
led.red = 0;
|
||||
led.green = 0;
|
||||
led.blue = 0;
|
||||
snprintf(led.brightness, MAX_WRITE_CMD, "0x00");
|
||||
snprintf(led.blink, MAX_WRITE_CMD, "0x000000 0 0");
|
||||
break;
|
||||
case LIGHT_FLASH_TIMED:
|
||||
|
@ -176,6 +180,7 @@ static int set_light_leds(struct light_state_t const *state, int type)
|
|||
led.red = (colorRGB >> 16) & 0xFF;
|
||||
led.green = (colorRGB >> 8) & 0xFF;
|
||||
led.blue = colorRGB & 0xFF;
|
||||
snprintf(led.brightness, MAX_WRITE_CMD, "0xFF");
|
||||
snprintf(led.blink, MAX_WRITE_CMD, "0x%x %d %d", colorRGB, state->flashOnMS, state->flashOffMS);
|
||||
break;
|
||||
default:
|
||||
|
@ -204,11 +209,13 @@ static int set_light_battery(struct light_device_t *dev,
|
|||
led.red = 0;
|
||||
led.green = 0;
|
||||
led.blue = 0;
|
||||
snprintf(led.brightness, MAX_WRITE_CMD, "0x00");
|
||||
snprintf(led.blink, MAX_WRITE_CMD, "0x000000 0 0");
|
||||
} else {
|
||||
led.red = (colorRGB >> 16) & 0xFF;
|
||||
led.green = (colorRGB >> 8) & 0xFF;
|
||||
led.blue = colorRGB & 0xFF;
|
||||
snprintf(led.brightness, MAX_WRITE_CMD, "0x00");
|
||||
snprintf(led.blink, MAX_WRITE_CMD, "0x%x %d %d", colorRGB, state->flashOnMS, state->flashOffMS);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue