From patchwork Wed Feb 16 03:49:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Courbot X-Patchwork-Id: 565601 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1G3nTp8019023 for ; Wed, 16 Feb 2011 03:49:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756563Ab1BPDtf (ORCPT ); Tue, 15 Feb 2011 22:49:35 -0500 Received: from mail-yi0-f46.google.com ([209.85.218.46]:61915 "EHLO mail-yi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756353Ab1BPDtf (ORCPT ); Tue, 15 Feb 2011 22:49:35 -0500 Received: by yib18 with SMTP id 18so422981yib.19 for ; Tue, 15 Feb 2011 19:49:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:in-reply-to:references; bh=+eXyz9SLXpLRuyec+bHRkMNme1rSHjsnalTATKSwliE=; b=jZO/ZghtWFCCcdhpSAb3Zz/VQP0t1MlCi6g7FuZXP+f+kRG/uFr/ica5bnhBejlk7N 3HE+DrxbYtQ8ttHBBIIEgBhEpZmSm5EmwBuW6ZG22mRlpaywmBQn+zsfU0LvXLhpl6Nf P3kL0Kp92VjvGV9Njk8xxoqVRLYp3fxI3O3GM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=KSn/1krdo/u8POsGMFdJrjsws/oefwZSfBHy+UaOpqnWrPXqQF7NwmGZG2QNJdInY5 E+XsG5lKWiYON4pXv5rM8WDRX9tazlkfr9hacaY+Ze7xoWMDPuHGVYT3cw370OcJBWfe IjrzPNH6GIAGbd0khhTYK7tTfMc1jfyhLU6kQ= Received: by 10.151.38.5 with SMTP id q5mr108895ybj.200.1297828174351; Tue, 15 Feb 2011 19:49:34 -0800 (PST) Received: from localhost.localdomain (e0109-114-22-43-241.uqwimax.jp [114.22.43.241]) by mx.google.com with ESMTPS id v8sm515233ybe.1.2011.02.15.19.49.32 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Feb 2011 19:49:33 -0800 (PST) From: Alexandre Courbot To: Magnus Damm Cc: linux-sh@vger.kernel.org, Alexandre Courbot Subject: [PATCH v2 3/3] sh: mach-ap325rxa: move backlight control code Date: Wed, 16 Feb 2011 12:49:03 +0900 Message-Id: <1297828143-11798-4-git-send-email-gnurou@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1297828143-11798-1-git-send-email-gnurou@gmail.com> References: <1297828143-11798-1-git-send-email-gnurou@gmail.com> In-Reply-To: References: Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 16 Feb 2011 03:49:36 +0000 (UTC) diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index 3e5fc3b..d695e43 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c @@ -156,24 +156,34 @@ static struct platform_device nand_flash_device = { #define PORT_DRVCRA 0xA405018A #define PORT_DRVCRB 0xA405018C +static int ap320_wvga_set_brightness(void *board_data, int brightness) +{ + if (brightness) { + gpio_set_value(GPIO_PTS3, 0); + __raw_writew(0x100, FPGA_BKLREG); + } else { + __raw_writew(0, FPGA_BKLREG); + gpio_set_value(GPIO_PTS3, 1); + } + + return 0; +} + +static int ap320_wvga_get_brightness(void *board_data) +{ + return gpio_get_value(GPIO_PTS3); +} + static void ap320_wvga_power_on(void *board_data, struct fb_info *info) { msleep(100); /* ASD AP-320/325 LCD ON */ __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG); - - /* backlight */ - gpio_set_value(GPIO_PTS3, 0); - __raw_writew(0x100, FPGA_BKLREG); } static void ap320_wvga_power_off(void *board_data) { - /* backlight */ - __raw_writew(0, FPGA_BKLREG); - gpio_set_value(GPIO_PTS3, 1); - /* ASD AP-320/325 LCD OFF */ __raw_writew(0, FPGA_LCDREG); } @@ -209,6 +219,12 @@ static struct sh_mobile_lcdc_info lcdc_info = { .board_cfg = { .display_on = ap320_wvga_power_on, .display_off = ap320_wvga_power_off, + .set_brightness = ap320_wvga_set_brightness, + .get_brightness = ap320_wvga_get_brightness, + }, + .bl_info = { + .name = "sh_mobile_lcdc_bl", + .max_brightness = 1, }, } };