summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@gmail.com>2008-10-30 11:05:00 +0000
committerEric Miao <eric.miao@marvell.com>2008-10-30 22:14:10 +0800
commita0601c8944dc08c2d349c24bd9c0b09c406229fc (patch)
tree740a9aec4a80fadc3f8ce75ce99401631d63169e /drivers/leds
parent56e7d85cf982dda4b453c157f3f64aea1478bc4d (diff)
downloadlinux-stable-a0601c8944dc08c2d349c24bd9c0b09c406229fc.tar.gz
linux-stable-a0601c8944dc08c2d349c24bd9c0b09c406229fc.tar.bz2
linux-stable-a0601c8944dc08c2d349c24bd9c0b09c406229fc.zip
leds: da903x: (da9030 only) led brightness reversed.
The brightness control register calculation (for the pwm) is effectively the reverse of what would be expected. 1 is maximum brightness, 255 minimum. This patch inverts this. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-da903x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/leds-da903x.c b/drivers/leds/leds-da903x.c
index 2768c69257f6..1f3cc512eff8 100644
--- a/drivers/leds/leds-da903x.c
+++ b/drivers/leds/leds-da903x.c
@@ -58,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: