From patchwork Fri Sep 18 10:27:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 48485 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8IAREGH005974 for ; Fri, 18 Sep 2009 10:27:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751672AbZIRK1J (ORCPT ); Fri, 18 Sep 2009 06:27:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753167AbZIRK1J (ORCPT ); Fri, 18 Sep 2009 06:27:09 -0400 Received: from ey-out-2122.google.com ([74.125.78.27]:34932 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751656AbZIRK1I (ORCPT ); Fri, 18 Sep 2009 06:27:08 -0400 Received: by ey-out-2122.google.com with SMTP id 25so273020eya.19 for ; Fri, 18 Sep 2009 03:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=epJvaymnYRX/n5OwlPUjb4gDy4cnXH+dyE7bcbV2wms=; b=D4IT8AjprC6OQSGFMwid6yAIocjToTCzdxGI6GvPk8Vt3AwqUEq8O8pBjhJxNi5Rzc uzb1uFnYAG27ZzGm96AsoDzvrffxQDnqJHcyTnIcMetnMAVh1BeaXLCsv9w/hPvMJ7uL lMV37PtR7Lwxd/ZK1ZiwXVpFXn0E5Vm8yr0po= 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=MWnO2YxY5vPTcBke/tVp/l0WjFRtOLj0GRlEYejEagi/VGzRoV4BegHTgGjcG2sJGj 4RS9iCFGcMnZc89sLfSCPKjTmnhvoENcAJKqNAHtMzfSvLddtv7RvmzP+iQobBc2brZx orom9MtHptMmkiYM33fEU+8gjHoeHKEY5glXI= Received: by 10.211.131.12 with SMTP id i12mr844534ebn.97.1253269631002; Fri, 18 Sep 2009 03:27:11 -0700 (PDT) Received: from localhost (host-94-101-4-66.taloyhtioverkot.fi [94.101.4.66]) by mx.google.com with ESMTPS id 24sm4282353eyx.31.2009.09.18.03.27.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 18 Sep 2009 03:27:10 -0700 (PDT) From: jhnikula@gmail.com To: linux-omap@vger.kernel.org Cc: Jarkko Nikula Subject: [PATCHv2] ARM: OMAP: Fix MMC gpio_wp for BeagleBoard C2 and above Date: Fri, 18 Sep 2009 13:27:22 +0300 Message-Id: <4ab3607e.1818d00a.312c.ffff941a@mx.google.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <20090918132250.c4382f67.jhnikula@gmail.com> References: <20090918132250.c4382f67.jhnikula@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Jarkko Nikula Earlier BeagleBoards were using pad AH8 muxed to GPIO29 for MMC write-protect. However, this signal has been changed to pad AG9 in board revision C2. Fix this by adding mux configuration for pad AG9, runtime check for board revisions and set the gpio number and pad muxing accordingly. Signed-off-by: Jarkko Nikula --- arch/arm/mach-omap2/board-omap3beagle.c | 7 ++++++- arch/arm/mach-omap2/mux.c | 2 ++ arch/arm/plat-omap/include/mach/mux.h | 1 + 3 files changed, 9 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index a661fe3..ea7db8a 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -139,8 +139,13 @@ static struct gpio_led gpio_leds[]; static int beagle_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { + if (system_rev >= 0x20 && system_rev <= 0x34301000) { + omap_cfg_reg(AG9_34XX_GPIO23); + mmc[0].gpio_wp = 23; + } else { + omap_cfg_reg(AH8_34XX_GPIO29); + } /* gpio + 0 is "mmc0_cd" (input/IRQ) */ - omap_cfg_reg(AH8_34XX_GPIO29); mmc[0].gpio_cd = gpio + 0; twl4030_mmc_init(mmc); diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 2daa595..8d773e8 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -460,6 +460,8 @@ MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) +MUX_CFG_34XX("AG9_34XX_GPIO23", 0x5ee, + OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4, diff --git a/arch/arm/plat-omap/include/mach/mux.h b/arch/arm/plat-omap/include/mach/mux.h index 98dfab6..9fd6171 100644 --- a/arch/arm/plat-omap/include/mach/mux.h +++ b/arch/arm/plat-omap/include/mach/mux.h @@ -840,6 +840,7 @@ enum omap34xx_index { */ AF26_34XX_GPIO0, AF22_34XX_GPIO9, + AG9_34XX_GPIO23, AH8_34XX_GPIO29, U8_34XX_GPIO54_OUT, U8_34XX_GPIO54_DOWN,