From patchwork Fri Jan 14 00:03:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Morsing X-Patchwork-Id: 476991 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 p0E03o4U002160 for ; Fri, 14 Jan 2011 00:03:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757383Ab1ANAD3 (ORCPT ); Thu, 13 Jan 2011 19:03:29 -0500 Received: from mail-ew0-f46.google.com ([209.85.215.46]:54592 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757359Ab1ANAD1 (ORCPT ); Thu, 13 Jan 2011 19:03:27 -0500 Received: by ewy5 with SMTP id 5so1230888ewy.19 for ; Thu, 13 Jan 2011 16:03:26 -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; bh=lsAV/tnn0yIDkZeD0S4aef91EIEOFAMIoLOCbAzhlZA=; b=YWCxt6oAdhj1fsJ9hhr8JI/wWI/awn2CvL5saqa1tHkWQpWi5+T7Em6JAkKIuHPoKd WtHsDOGrAe1OeyFH4+1iSqQ6ncAhMCa8yUJ9zHd2OD5ct5Yghly/Vnc3yXPYmiti31Fn 0i/qaW9juuaQOyDiT0E9fOBJ+meswsyAxvDSE= 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=nZFhQ4wVjUoy1ZxX0mhjr6he5EEm7bKUGOgafD27mY923Mcgyonv1lxC7D+H22o/qr gFrXliMK96hlfhQD4bYB3NqHc5eozFhJ3SnZuh0+Ez6fgubEhj+Qq1Skg7ZjniPYdDQw uHt2+McIXI0Zcv+XNwTwTSsl24/xHXrgnD38c= Received: by 10.213.104.132 with SMTP id p4mr202179ebo.94.1294963406101; Thu, 13 Jan 2011 16:03:26 -0800 (PST) Received: from localhost.localdomain ([84.238.81.146]) by mx.google.com with ESMTPS id t5sm481891eeh.2.2011.01.13.16.03.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 13 Jan 2011 16:03:25 -0800 (PST) From: Daniel Morsing To: Tony Lindgren Cc: linux-omap@vger.kernel.org, Thomas Weber , Daniel Morsing Subject: [PATCH 3/3] omap3: devkit8000: Use generic gpio for second lcd enable Date: Fri, 14 Jan 2011 01:03:29 +0100 Message-Id: <1294963409-29891-4-git-send-email-daniel.morsing@gmail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1294963409-29891-1-git-send-email-daniel.morsing@gmail.com> References: <1294963409-29891-1-git-send-email-daniel.morsing@gmail.com> 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]); Fri, 14 Jan 2011 00:03:51 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 8dc7a24..c1fdb1e 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c @@ -112,10 +112,16 @@ static struct omap2_hsmmc_info mmc[] = { {} /* Terminator */ }; +/* This board uses 2 gpios for the lcd reset line, so use + * omap_dss_device.reset_gpio for storing one and this variable + * for storing the other. + */ +static int lcd_enable_gpio = -EINVAL; /* will be replaced */ + static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev) { - twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1); - twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0); + if (gpio_is_valid(lcd_enable_gpio)) + gpio_set_value_cansleep(lcd_enable_gpio, 1); if (gpio_is_valid(dssdev->reset_gpio)) gpio_set_value_cansleep(dssdev->reset_gpio, 1); @@ -124,6 +130,9 @@ static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev) static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev) { + if (gpio_is_valid(lcd_enable_gpio)) + gpio_set_value_cansleep(lcd_enable_gpio, 0); + if (gpio_is_valid(dssdev->reset_gpio)) gpio_set_value_cansleep(dssdev->reset_gpio, 0); } @@ -251,6 +260,12 @@ static int devkit8000_twl_gpio_setup(struct device *dev, /* Disable until needed */ gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0); + /* TWL4030_GPIO_MAX + 0 == ledA which is also "LCD_PWREN" */ + lcd_enable_gpio = gpio + TWL4030_GPIO_MAX + 0; + gpio_request(lcd_enable_gpio, "LCD_PWREN"); + /* Disable until needed */ + gpio_direction_output(lcd_enable_gpio, 0); + /* gpio + 7 is "DVI_PD" (out, active low) */ devkit8000_dvi_device.reset_gpio = gpio + 7; gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");