From patchwork Thu Aug 16 13:00:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1331531 Return-Path: X-Original-To: patchwork-linux-sh@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 791CEDFB34 for ; Thu, 16 Aug 2012 13:00:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932190Ab2HPNAy (ORCPT ); Thu, 16 Aug 2012 09:00:54 -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 S1756368Ab2HPNAw (ORCPT ); Thu, 16 Aug 2012 09:00:52 -0400 Received: from avalon.ideasonboard.com (unknown [91.178.185.167]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0979235AB2; Thu, 16 Aug 2012 15:00:46 +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 18/19] sh: kfr2r09: Use the backlight API for brightness control Date: Thu, 16 Aug 2012 15:00:53 +0200 Message-Id: <1345122054-16013-19-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-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Don't hook up brightness control in the display on/off operations, use the backlight API instead. Signed-off-by: Laurent Pinchart --- arch/sh/boards/mach-kfr2r09/lcd_wqvga.c | 16 +++------------- arch/sh/boards/mach-kfr2r09/setup.c | 7 +++++-- arch/sh/include/mach-kfr2r09/mach/kfr2r09.h | 6 ++---- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c index c148b36..c620503 100644 --- a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c +++ b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c @@ -283,7 +283,7 @@ void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so) #define MAIN_MLED4 0x40 #define MAIN_MSW 0x80 -static int kfr2r09_lcd_backlight(int on) +int kfr2r09_lcd_set_brightness(int brightness) { struct i2c_adapter *a; struct i2c_msg msg; @@ -295,7 +295,7 @@ static int kfr2r09_lcd_backlight(int on) return -ENODEV; buf[0] = 0x00; - if (on) + if (brightness) buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW; else buf[1] = 0; @@ -309,7 +309,7 @@ static int kfr2r09_lcd_backlight(int on) return -ENODEV; buf[0] = 0x01; - if (on) + if (brightness) buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c; else buf[1] = 0; @@ -324,13 +324,3 @@ static int kfr2r09_lcd_backlight(int on) return 0; } - -void kfr2r09_lcd_on(void) -{ - kfr2r09_lcd_backlight(1); -} - -void kfr2r09_lcd_off(void) -{ - kfr2r09_lcd_backlight(0); -} diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index 158c917..ecf40b8 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c @@ -156,8 +156,11 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = { .height = 58, .setup_sys = kfr2r09_lcd_setup, .start_transfer = kfr2r09_lcd_start, - .display_on = kfr2r09_lcd_on, - .display_off = kfr2r09_lcd_off, + }, + .bl_info = { + .name = "sh_mobile_lcdc_bl", + .max_brightness = 1, + .set_brightness = kfr2r09_lcd_set_brightness, }, .sys_bus_cfg = { .ldmt2r = 0x07010904, diff --git a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h index ba3d93d..c20c9e5 100644 --- a/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h +++ b/arch/sh/include/mach-kfr2r09/mach/kfr2r09.h @@ -4,15 +4,13 @@ #include