From patchwork Thu Jul 18 19:08:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 11049439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 307E6746 for ; Thu, 18 Jul 2019 19:08:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F5D028710 for ; Thu, 18 Jul 2019 19:08:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12EDA287C8; Thu, 18 Jul 2019 19:08:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D153528710 for ; Thu, 18 Jul 2019 19:08:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391174AbfGRTIw (ORCPT ); Thu, 18 Jul 2019 15:08:52 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:40444 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726040AbfGRTIw (ORCPT ); Thu, 18 Jul 2019 15:08:52 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id B0487802B0; Thu, 18 Jul 2019 21:08:38 +0200 (CEST) Date: Thu, 18 Jul 2019 21:08:49 +0200 From: Pavel Machek To: kernel list , linux-arm-kernel , linux-omap@vger.kernel.org, tony@atomide.com, sre@kernel.org, nekit1000@gmail.com, mpartap@gmx.net, merlijn@wizzup.org, jacek.anaszewski@gmail.com, linux-leds@vger.kernel.org, b.zolnierkie@samsung.com, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH] Enable backlight when trigger is activated Message-ID: <20190718190849.GA11409@amd> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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); }