From patchwork Thu Aug 16 13:00:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1331601 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 5C7DFDFB34 for ; Thu, 16 Aug 2012 13:00:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932180Ab2HPNA5 (ORCPT ); Thu, 16 Aug 2012 09:00:57 -0400 Received: from perceval.ideasonboard.com ([95.142.166.194]:60954 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932167Ab2HPNAt (ORCPT ); Thu, 16 Aug 2012 09:00:49 -0400 Received: from avalon.ideasonboard.com (unknown [91.178.185.167]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4BC2735A91; Thu, 16 Aug 2012 15:00:44 +0200 (CEST) From: Laurent Pinchart To: linux-fbdev@vger.kernel.org Cc: linux-sh@vger.kernel.org, Kuninori Morimoto , Magnus Damm , Paul Mundt Subject: [PATCH 12/19] fbdev: sh_mobile_lcdc: Store the backlight brightness internally Date: Thu, 16 Aug 2012 15:00:47 +0200 Message-Id: <1345122054-16013-13-git-send-email-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1345122054-16013-1-git-send-email-laurent.pinchart@ideasonboard.com> References: <1345122054-16013-1-git-send-email-laurent.pinchart@ideasonboard.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org There's no need to query the hardware for the currenty brightness value through a platform data callback when we can cache the value internally in the LCDC driver. Signed-off-by: Laurent Pinchart --- drivers/video/sh_mobile_lcdcfb.c | 3 ++- drivers/video/sh_mobile_lcdcfb.h | 1 + 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index c169581..dd8dd41 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -2282,6 +2282,7 @@ static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev) bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) brightness = 0; + ch->bl_brightness = brightness; return ch->cfg->bl_info.set_brightness(brightness); } @@ -2289,7 +2290,7 @@ static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev) { struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev); - return ch->cfg->bl_info.get_brightness(); + return ch->bl_brightness; } static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev, diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h index 0f92f65..f839ade 100644 --- a/drivers/video/sh_mobile_lcdcfb.h +++ b/drivers/video/sh_mobile_lcdcfb.h @@ -94,6 +94,7 @@ struct sh_mobile_lcdc_chan { /* Backlight */ struct backlight_device *bl; + unsigned int bl_brightness; /* FB */ struct fb_info *info;