Skip to content

Commit

Permalink
leds: after setting inverted attribute, we must update the LED
Browse files Browse the repository at this point in the history
If we change the inverted attribute to another value, the LED will not be
inverted until we change the GPIO state.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Cc: Samuel R. C. Vale <srcvale@holoscopio.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and Linus Torvalds committed Aug 27, 2009
1 parent 48cccd2 commit cc674c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/leds/ledtrig-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ static ssize_t gpio_trig_inverted_store(struct device *dev,

gpio_data->inverted = !!inverted;

/* After inverting, we need to update the LED. */
schedule_work(&gpio_data->work);

return n;
}
static DEVICE_ATTR(inverted, 0644, gpio_trig_inverted_show,
Expand Down

0 comments on commit cc674c8

Please sign in to comment.