leds: cpcap: HACK: turn off led for brightness of 0 and 1.
authormakarand.karvekar <makarand.karvekar@motorola.com>
Mon, 8 Nov 2010 23:11:03 +0000 (17:11 -0600)
committerColin Cross <ccross@android.com>
Mon, 29 Nov 2010 22:44:30 +0000 (14:44 -0800)
brightness 0 triggers delay_on and delay_off device file
removal. setting timer trigger creates new device files
with root permissions. Avoid device file removal by treating
brightness 1 as 0.

Change-Id: Idfc2dd1c43e5962c173f8ed69f61e4b207c80cbb
Signed-off-by: makarand.karvekar <makarand.karvekar@motorola.com>
drivers/leds/leds-ld-cpcap.c

index 0c114f18c60831f98f4a06bfa994f6668be7c267..df0e697de019ac76d451e0ecd302afb1df25d268 100755 (executable)
@@ -84,7 +84,7 @@ static void cpcap_brightness_work(struct work_struct *work)
 
        brightness = cpcap_led_data->brightness;
 
-       if (brightness > 0) {
+       if (brightness > 1) {
                brightness = (cpcap_led_data->pdata->cpcap_reg_period |
                                 cpcap_led_data->pdata->cpcap_reg_duty_cycle |
                                 cpcap_led_data->pdata->cpcap_reg_current |