Commit a0601c89 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Eric Miao

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: default avatarJonathan Cameron <jic23@cam.ac.uk>
Acked-by: default avatarMike Rapoport <mike@compulab.co.il>
Signed-off-by: default avatarEric Miao <eric.miao@marvell.com>
parent 56e7d85c
...@@ -58,7 +58,7 @@ static void da903x_led_work(struct work_struct *work) ...@@ -58,7 +58,7 @@ static void da903x_led_work(struct work_struct *work)
offset = DA9030_LED_OFFSET(led->id); offset = DA9030_LED_OFFSET(led->id);
val = led->flags & ~0x87; val = led->flags & ~0x87;
val |= (led->new_brightness) ? 0x80 : 0; /* EN bit */ 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); da903x_write(led->master, DA9030_LED1_CONTROL + offset, val);
break; break;
case DA9030_ID_VIBRA: case DA9030_ID_VIBRA:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment