]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/leds/leds-da903x.c
Merge branch 'for-2.6.28' of git://linux-nfs.org/~bfields/linux
[linux-2.6-omap-h63xx.git] / drivers / leds / leds-da903x.c
index f1fddb18d70d0bf45c1f2ed07afd53d1d66d8527..1f3cc512eff898af0bc3b74c878d8b862c3cbad0 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/leds.h>
+#include <linux/workqueue.h>
 #include <linux/mfd/da903x.h>
 
 #define DA9030_LED1_CONTROL    0x20
@@ -57,7 +58,7 @@ static void da903x_led_work(struct work_struct *work)
                offset = DA9030_LED_OFFSET(led->id);
                val = led->flags & ~0x87;
                val |= (led->new_brightness) ? 0x80 : 0; /* EN bit */
-               val |= (led->new_brightness >> 5) & 0x7; /* PWM<2:0> */
+               val |= (0x7 - (led->new_brightness >> 5)) & 0x7; /* PWM<2:0> */
                da903x_write(led->master, DA9030_LED1_CONTROL + offset, val);
                break;
        case DA9030_ID_VIBRA: