From patchwork Tue Apr 29 15:28:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 4088151 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BB6FBC0ACC for ; Tue, 29 Apr 2014 15:31:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D93EF20160 for ; Tue, 29 Apr 2014 15:31:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0729E201B4 for ; Tue, 29 Apr 2014 15:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757267AbaD2Pah (ORCPT ); Tue, 29 Apr 2014 11:30:37 -0400 Received: from mail-ee0-f48.google.com ([74.125.83.48]:33614 "EHLO mail-ee0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756560AbaD2Pag (ORCPT ); Tue, 29 Apr 2014 11:30:36 -0400 Received: by mail-ee0-f48.google.com with SMTP id b57so456238eek.35 for ; Tue, 29 Apr 2014 08:30:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=W11Rmns24sA+5ZhPFwDwBum8d878XRvopvf6pUGNOAQ=; b=n3+ApeMtCaVBXuD3DRM89v0z2Po7gcwUcIsD2TJ2W6QBsphbNxcERar7PeQkKZ+DdA i8RyJzSnuJ85TOB03+okhDzr99xOTE0s2pLqoxBnyowcrZSeEOvGp2oLjilAlW3UdzCt wmunT9r8u0MHjH72sMhOFk3ZUGRS0XMH4i91NznLo6X53RstKay4fjVU1PU/jnM7TDO1 wNu1WeWh/l4Zemzfs5TdPpQRrW4X5hRTaq4inoG0MeRxRkLoAoEd0vm+5kNDBAGBLU73 Z41E+f1iAYcTBlus6vveGuXQ5YKQpwDbBImfwTHGqx4HFE00fUV6CyC4HfLAERu+QU1w 1THQ== X-Received: by 10.15.31.70 with SMTP id x46mr133868eeu.26.1398785435127; Tue, 29 Apr 2014 08:30:35 -0700 (PDT) Received: from localhost (port-22200.pppoe.wtnet.de. [46.59.148.101]) by mx.google.com with ESMTPSA id 48sm60065219eei.24.2014.04.29.08.30.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Apr 2014 08:30:34 -0700 (PDT) From: Thierry Reding To: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Cc: Stephen Warren Subject: [PATCH 3/3] pwm-backlight: Disable backlight on shutdown Date: Tue, 29 Apr 2014 17:28:59 +0200 Message-Id: <1398785339-8107-3-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1398785339-8107-1-git-send-email-thierry.reding@gmail.com> References: <1398785339-8107-1-git-send-email-thierry.reding@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding When a device is shut down, make sure to disable the backlight. If it stays lit, it gives the impression that the device hasn't turned off. Furthermore keeping the backlight on may consume power, which is not what users expect when they shut down a device. Signed-off-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 994f424eb289..b85479b14971 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -368,6 +368,14 @@ static int pwm_backlight_remove(struct platform_device *pdev) return 0; } +static void pwm_backlight_shutdown(struct platform_device *pdev) +{ + struct backlight_device *bl = platform_get_drvdata(pdev); + struct pwm_bl_data *pb = bl_get_data(bl); + + pwm_backlight_power_off(pb); +} + #ifdef CONFIG_PM_SLEEP static int pwm_backlight_suspend(struct device *dev) { @@ -413,6 +421,7 @@ static struct platform_driver pwm_backlight_driver = { }, .probe = pwm_backlight_probe, .remove = pwm_backlight_remove, + .shutdown = pwm_backlight_shutdown, }; module_platform_driver(pwm_backlight_driver);