msm8976-common: Fix button lights

This commit is contained in:
LuK1337 2017-01-20 21:51:03 +01:00
parent 6431319376
commit 74fbea78d2
2 changed files with 11 additions and 1 deletions

View File

@ -104,11 +104,12 @@ set_light_buttons(struct light_device_t* dev,
struct light_state_t const* state)
{
int err = 0;
int on = (state->color & 0xFF);
if(!dev) {
return -1;
}
pthread_mutex_lock(&g_lock);
err = write_int(BUTTON_FILE, state->color & 0xFF);
err = write_int(BUTTON_FILE, on == 255 ? 1 : 0);
pthread_mutex_unlock(&g_lock);
return err;
}

View File

@ -261,6 +261,15 @@ on boot
chown system media_rw /sys/class/graphics/fb0/csc_cfg
chmod 0660 /sys/class/graphics/fb0/csc_cfg
# Permissions for Input Device
chown system radio /sys/class/sec/tsp/cmd
chown system system /sys/class/sec/tsp/input/enabled
chmod 0660 /sys/class/sec/tsp/input/enabled
chown system system /sys/class/sec/sec_touchkey/input/enabled
chmod 0660 /sys/class/sec/sec_touchkey/input/enabled
chown system system /sys/class/sec/sec_touchkey/brightness
chmod 0660 /sys/class/sec/sec_touchkey/brightness
# Permissions for SENSOR
# Fingerprint_sensor
chown system radio /sys/class/fingerprint/fingerprint/type_check