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: 11049445 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 D488B746 for ; Thu, 18 Jul 2019 19:09:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C214928710 for ; Thu, 18 Jul 2019 19:09:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B402A287C8; Thu, 18 Jul 2019 19:09:04 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 64C5F28710 for ; Thu, 18 Jul 2019 19:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: MIME-Version:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=7EeEB2Oui2adgWb5liqAJUmKYDNG4Dp4Fr89TmXppRs=; b=nfa DvB2Hd8K3lq0EkzdY3lQHAY3VT4B/cs9ZqXwBym22ZGtphgUPcbvIn/1BN3FYslONzKaA7iW+zky5 F3aETAc6kogJKPqfxfqfpYPXaZTjoif+2V2irEH8Xbr7Z9d+KQc2sUB15FxcA30kjH2TP/Vh9GG6Z iMhqYgl1vLuPpNYM5zoaIdpeeuKkbh2nWZj6cNuTwhuxAL/OPmtOFagsUQZZKFdfS2qjHnSASyuL/ aUclQeXZj1XVlmGnPDu3Mzu2NEC1yNAu8WO0lPaXKXwU7pYHp8CIGvbEMsc3gqFCMyo3cLPXnD6/J 5lx8g+/Axq7oZsUzymp9BgF3Ec1DZWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hoBlz-00059A-Uq; Thu, 18 Jul 2019 19:08:59 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hoBlw-00058F-OE for linux-arm-kernel@lists.infradead.org; Thu, 18 Jul 2019 19:08:59 +0000 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 User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190718_120856_941930_34DDF1EB X-CRM114-Status: UNSURE ( 9.80 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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); }