From patchwork Mon Feb 14 02:32:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 553291 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 p1DISt6V022252 for ; Sun, 13 Feb 2011 18:31:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754710Ab1BMSbL (ORCPT ); Sun, 13 Feb 2011 13:31:11 -0500 Received: from ch1outboundpool.messaging.microsoft.com ([216.32.181.184]:57910 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754676Ab1BMSbL (ORCPT ); Sun, 13 Feb 2011 13:31:11 -0500 Received: from mail29-ch1-R.bigfish.com (216.32.181.168) by CH1EHSOBE008.bigfish.com (10.43.70.58) with Microsoft SMTP Server id 14.1.225.8; Sun, 13 Feb 2011 18:31:10 +0000 Received: from mail29-ch1 (localhost.localdomain [127.0.0.1]) by mail29-ch1-R.bigfish.com (Postfix) with ESMTP id 14F0512A81D7; Sun, 13 Feb 2011 18:31:10 +0000 (UTC) X-SpamScore: -3 X-BigFish: VS-3(zzbb2cKzz1202hzz8275bhz2dh2a8h668h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:de01egw01.freescale.net; RD:de01egw01.freescale.net; EFVD:NLI Received: from mail29-ch1 (localhost.localdomain [127.0.0.1]) by mail29-ch1 (MessageSwitch) id 1297621869728692_23494; Sun, 13 Feb 2011 18:31:09 +0000 (UTC) Received: from CH1EHSMHS013.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.247]) by mail29-ch1.bigfish.com (Postfix) with ESMTP id A41E239004B; Sun, 13 Feb 2011 18:31:09 +0000 (UTC) Received: from de01egw01.freescale.net (192.88.165.102) by CH1EHSMHS013.bigfish.com (10.43.70.13) with Microsoft SMTP Server (TLS) id 14.1.225.8; Sun, 13 Feb 2011 18:31:09 +0000 Received: from az33smr01.freescale.net (az33smr01.freescale.net [10.64.34.199]) by de01egw01.freescale.net (8.14.3/8.14.3) with ESMTP id p1DIV8kZ014107; Sun, 13 Feb 2011 11:31:08 -0700 (MST) Received: from S2101-09.ap.freescale.net (mvp-10-192-184-6.ap.freescale.net [10.192.184.6]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p1DIUgKH022479; Sun, 13 Feb 2011 12:31:03 -0600 (CST) From: Shawn Guo To: , , , , , CC: Shawn Guo Subject: [PATCH v2 6/7] ARM: mxs/mx23evk: add mmc device Date: Mon, 14 Feb 2011 10:32:25 +0800 Message-ID: <1297650746-12841-7-git-send-email-shawn.guo@freescale.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1297650746-12841-1-git-send-email-shawn.guo@freescale.com> References: <1297650746-12841-1-git-send-email-shawn.guo@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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]); Sun, 13 Feb 2011 18:31:12 +0000 (UTC) diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig index cd2fbdf..f47fae3 100644 --- a/arch/arm/mach-mxs/Kconfig +++ b/arch/arm/mach-mxs/Kconfig @@ -19,6 +19,7 @@ config MACH_MX23EVK bool "Support MX23EVK Platform" select SOC_IMX23 select MXS_HAVE_AMBA_DUART + select MXS_HAVE_PLATFORM_MMC default y help Include support for MX23EVK platform. This includes specific diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c index aa06400..4d37d9c 100644 --- a/arch/arm/mach-mxs/mach-mx23evk.c +++ b/arch/arm/mach-mxs/mach-mx23evk.c @@ -26,10 +26,65 @@ #include "devices-mx23.h" +#define MX23EVK_MMC0_WRITE_PROTECT MXS_GPIO_NR(1, 30) +#define MX23EVK_MMC0_SLOT_POWER MXS_GPIO_NR(1, 29) + static const iomux_cfg_t mx23evk_pads[] __initconst = { /* duart */ MX23_PAD_PWM0__DUART_RX | MXS_PAD_4MA, MX23_PAD_PWM1__DUART_TX | MXS_PAD_4MA, + + /* mmc */ + MX23_PAD_SSP1_DATA0__SSP1_DATA0 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX23_PAD_SSP1_DATA1__SSP1_DATA1 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX23_PAD_SSP1_DATA2__SSP1_DATA2 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX23_PAD_SSP1_DATA3__SSP1_DATA3 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX23_PAD_GPMI_D08__SSP1_DATA4 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX23_PAD_GPMI_D09__SSP1_DATA5 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX23_PAD_GPMI_D10__SSP1_DATA6 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX23_PAD_GPMI_D11__SSP1_DATA7 | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX23_PAD_SSP1_CMD__SSP1_CMD | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), + MX23_PAD_SSP1_DETECT__SSP1_DETECT | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), + MX23_PAD_SSP1_SCK__SSP1_SCK | + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), + /* write protect */ + MX23_PAD_PWM4__GPIO_1_30 | + (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), + /* slot power enable */ + MX23_PAD_PWM3__GPIO_1_29 | + (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), +}; + +/* mmc */ +static void __init mx23evk_mmc_slot_poweron(int gpio) +{ + int ret; + + ret = gpio_request(gpio, "mmc-slot-power"); + if (ret) { + pr_err("Failed to request gpio mmc-slot-power: %d\n", ret); + return; + } + + ret = gpio_direction_output(gpio, 0); + if (ret) { + pr_err("Failed to drive gpio mmc-slot-power: %d\n", ret); + return; + } +} + +static struct mxs_mmc_platform_data mx23_mmc_pdata __initdata = { + .wp_gpio = MX23EVK_MMC0_WRITE_PROTECT, }; static void __init mx23evk_init(void) @@ -37,6 +92,9 @@ static void __init mx23evk_init(void) mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads)); mx23_add_duart(); + + mx23evk_mmc_slot_poweron(MX23EVK_MMC0_SLOT_POWER); + mx23_add_mmc(0, &mx23_mmc_pdata); } static void __init mx23evk_timer_init(void)