linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Enable backlight when trigger is activated
@ 2019-07-18 19:08 Pavel Machek
  2019-07-21 23:00 ` Ezequiel Garcia
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Machek @ 2019-07-18 19:08 UTC (permalink / raw)
  To: kernel list, linux-arm-kernel, linux-omap, tony, sre, nekit1000,
	mpartap, merlijn, jacek.anaszewski, linux-leds, b.zolnierkie,
	dri-devel, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 1147 bytes --]

Configuring backlight trigger from dts results in backlight off during
boot. Machine looks dead upon boot, which is not good.

Fix that by enabling LED on trigger activation.

Signed-off-by: Pavel Machek <pavel@ucw.cz>

diff --git a/drivers/leds/trigger/ledtrig-backlight.c b/drivers/leds/trigger/ledtrig-backlight.c
index 487577d..6e6bc78 100644
--- a/drivers/leds/trigger/ledtrig-backlight.c
+++ b/drivers/leds/trigger/ledtrig-backlight.c
@@ -114,6 +114,8 @@ static int bl_trig_activate(struct led_classdev *led)
 	n->old_status = UNBLANK;
 	n->notifier.notifier_call = fb_notifier_callback;
 
+	led_set_brightness(led, LED_ON);
+
 	ret = fb_register_client(&n->notifier);
 	if (ret)
 		dev_err(led->dev, "unable to register backlight trigger\n");
@@ -126,6 +128,7 @@ static void bl_trig_deactivate(struct led_classdev *led)
 	struct bl_trig_notifier *n = led_get_trigger_data(led);
 
 	fb_unregister_client(&n->notifier);
+	led_set_brightness(led, LED_OFF);
 	kfree(n);
 }
 

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-24 21:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18 19:08 [PATCH] Enable backlight when trigger is activated Pavel Machek
2019-07-21 23:00 ` Ezequiel Garcia
2019-07-22  7:50   ` Pavel Machek
2019-07-22 20:25     ` Jacek Anaszewski
2019-07-22 21:04       ` Pavel Machek
2019-07-24  8:33       ` Pavel Machek
2019-07-24 21:16         ` Jacek Anaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).