From patchwork Mon Jan 24 19:22:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 501831 X-Patchwork-Delegate: tony@atomide.com 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 p0OJh2ZX026265 for ; Mon, 24 Jan 2011 19:48:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750831Ab1AXTWh (ORCPT ); Mon, 24 Jan 2011 14:22:37 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:53693 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750712Ab1AXTWh (ORCPT ); Mon, 24 Jan 2011 14:22:37 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p0OJMTve006872 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 24 Jan 2011 13:22:32 -0600 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p0OJMRFt004849; Tue, 25 Jan 2011 00:52:27 +0530 (IST) From: Vaibhav Hiremath To: linux-omap@vger.kernel.org Cc: tony@atomide.com, tomi.valkeinen@nokia.com, Vaibhav Hiremath Subject: [PATCH-V2] OMAP3EVM: Made backlight GPIO default state to off Date: Tue, 25 Jan 2011 00:52:27 +0530 Message-Id: <1295896947-30475-1-git-send-email-hvaibhav@ti.com> X-Mailer: git-send-email 1.6.2.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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]); Mon, 24 Jan 2011 19:48:25 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 7119380..a888a7d 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -411,6 +411,8 @@ static struct platform_device leds_gpio = { static int omap3evm_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { + int r; + /* gpio + 0 is "mmc0_cd" (input/IRQ) */ omap_mux_init_gpio(63, OMAP_PIN_INPUT); mmc[0].gpio_cd = gpio + 0; @@ -426,8 +428,17 @@ static int omap3evm_twl_gpio_setup(struct device *dev, */ /* TWL4030_GPIO_MAX + 0 == ledA, LCD Backlight control */ - gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); - gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); + r = gpio_request(gpio + TWL4030_GPIO_MAX, "EN_LCD_BKL"); + if (r) + printk(KERN_ERR "failed to get lcd_bkl gpio\n"); + + if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) + r = gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1); + else + r = gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); + + if (r) + printk(KERN_ERR "failed to set direction of lcd_bkl gpio\n"); /* gpio + 7 == DVI Enable */ gpio_request(gpio + 7, "EN_DVI");