From patchwork Wed Jan 30 06:19:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 2065321 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 612833FDD1 for ; Wed, 30 Jan 2013 06:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751408Ab3A3GTx (ORCPT ); Wed, 30 Jan 2013 01:19:53 -0500 Received: from hqemgate04.nvidia.com ([216.228.121.35]:15292 "EHLO hqemgate04.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751295Ab3A3GTx (ORCPT ); Wed, 30 Jan 2013 01:19:53 -0500 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate04.nvidia.com id ; Tue, 29 Jan 2013 22:19:40 -0800 Received: from hqemhub01.nvidia.com ([172.17.108.22]) by hqnvupgp08.nvidia.com (PGP Universal service); Tue, 29 Jan 2013 22:17:37 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Tue, 29 Jan 2013 22:17:37 -0800 Received: from percival.nvidia.com (172.20.144.16) by hqemhub01.nvidia.com (172.20.150.30) with Microsoft SMTP Server (TLS) id 8.3.297.1; Tue, 29 Jan 2013 22:19:51 -0800 From: Alexandre Courbot To: Thierry Reding , Richard Purdie CC: , , , Alexandre Courbot Subject: [PATCH] pwm-backlight: handle BL_CORE_FBBLANK state Date: Wed, 30 Jan 2013 15:19:15 +0900 Message-ID: <1359526755-21145-1-git-send-email-acourbot@nvidia.com> X-Mailer: git-send-email 1.8.1.2 X-NVConfidentiality: public MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org According to include/linux/backlight.h, the fb_blank field is to be removed and blank status should preferably be set by setting the BL_CORE_FBBLANK bit of the state field. This patch ensures this condition is also taken into account when updating the backlight state. Signed-off-by: Alexandre Courbot --- drivers/video/backlight/pwm_bl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 069983c..4af6d13 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -41,10 +41,9 @@ static int pwm_backlight_update_status(struct backlight_device *bl) int brightness = bl->props.brightness; int max = bl->props.max_brightness; - if (bl->props.power != FB_BLANK_UNBLANK) - brightness = 0; - - if (bl->props.fb_blank != FB_BLANK_UNBLANK) + if (bl->props.power != FB_BLANK_UNBLANK || + bl->props.fb_blank != FB_BLANK_UNBLANK || + bl->props.state & BL_CORE_FBBLANK) brightness = 0; if (pb->notify)