Jelajahi Sumber

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>
Thadeu Lima de Souza Cascardo 16 tahun lalu
induk
melakukan
cc674c81f0
1 mengubah file dengan 3 tambahan dan 0 penghapusan
  1. 3 0
      drivers/leds/ledtrig-gpio.c

+ 3 - 0
drivers/leds/ledtrig-gpio.c

@@ -117,6 +117,9 @@ static ssize_t gpio_trig_inverted_store(struct device *dev,
 
 
 	gpio_data->inverted = !!inverted;
 	gpio_data->inverted = !!inverted;
 
 
+	/* After inverting, we need to update the LED. */
+	schedule_work(&gpio_data->work);
+
 	return n;
 	return n;
 }
 }
 static DEVICE_ATTR(inverted, 0644, gpio_trig_inverted_show,
 static DEVICE_ATTR(inverted, 0644, gpio_trig_inverted_show,