aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>2009-08-26 17:29:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-08-26 23:06:53 -0400
commitcc674c81f01a6151ca00c617e5efa0812ee5fdbe (patch)
treee34948f103c0dc69cfdad69caead17eb184e9736
parent48cccd26f36511ddb6aeca07485ecf2829683907 (diff)
leds: after setting inverted attribute, we must update the LED
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>
-rw-r--r--drivers/leds/ledtrig-gpio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/leds/ledtrig-gpio.c b/drivers/leds/ledtrig-gpio.c
index 8183b81fca84..1bc5db4ece0d 100644
--- a/drivers/leds/ledtrig-gpio.c
+++ b/drivers/leds/ledtrig-gpio.c
@@ -117,6 +117,9 @@ static ssize_t gpio_trig_inverted_store(struct device *dev,
117 117
118 gpio_data->inverted = !!inverted; 118 gpio_data->inverted = !!inverted;
119 119
120 /* After inverting, we need to update the LED. */
121 schedule_work(&gpio_data->work);
122
120 return n; 123 return n;
121} 124}
122static DEVICE_ATTR(inverted, 0644, gpio_trig_inverted_show, 125static DEVICE_ATTR(inverted, 0644, gpio_trig_inverted_show,