From patchwork Tue Jul 5 20:20:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 946552 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p65KL7m2000365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 5 Jul 2011 20:21:28 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QeC77-00023a-Me; Tue, 05 Jul 2011 20:20:57 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QeC77-0002Py-AN; Tue, 05 Jul 2011 20:20:57 +0000 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1QeC72-0002Pf-TV for linux-arm-kernel@lists.infradead.org; Tue, 05 Jul 2011 20:20:54 +0000 Received: from SC-OWA01.marvell.com ([65.219.4.129]) (using TLSv1) by na3sys009aob110.postini.com ([74.125.148.12]) with SMTP ID DSNKThNyF34Yalj9Lmc327LKUyQmStQNY/oC@postini.com; Tue, 05 Jul 2011 13:20:52 PDT Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by SC-OWA01.marvell.com ([10.93.76.21]) with mapi; Tue, 5 Jul 2011 13:20:39 -0700 From: Philip Rakity To: Eric Miao Date: Tue, 5 Jul 2011 13:20:37 -0700 Subject: [PATCH v3] arm: mach-mmp: brownstone.c support multiple sd slots Thread-Topic: [PATCH v3] arm: mach-mmp: brownstone.c support multiple sd slots Thread-Index: Acw7UQHhWg5KtCpVSrqjXHlUTM0TXQ== Message-ID: <67F311C7-B489-41E6-BC85-C06DACC7263A@marvell.com> References: <59C2B513-EC04-4CA2-818B-9901CAF3E554@marvell.com> <20110427093328.GU17290@n2100.arm.linux.org.uk> <161C3F6C-0986-4364-B458-DBA4D08456FD@marvell.com> <1F336A22-BAC3-41E3-8D4E-5DF27874D1EA@marvell.com> <20110428095127.GX17290@n2100.arm.linux.org.uk> <3BFCE791-3BAD-42ED-BC87-A27F40D6C77C@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110705_162053_244035_665D6467 X-CRM114-Status: GOOD ( 18.79 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.203 listed in list.dnswl.org] Cc: Russell King - ARM Linux , "linux-mmc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , zhangfei gao , Chris Ball , Zhangfei Gao X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 05 Jul 2011 20:21:28 +0000 (UTC) Subject: [PATCH V3] arm: mach-mmp: brownstone.c support multiple sd slots V3 == Change since V2 -- delete mmc3 since it was committed to linux next. enable mmc1 used for wifi (8688) and marked PERMANENT. Wifi requires enabling of power on the device by toggling the gpio lines for power and reset. Enable eMMC first to work around problem in booting order due to workqueue bug. Signed-off-by: Philip Rakity --- arch/arm/mach-mmp/brownstone.c | 41 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 40 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c index c79162a..940982c 100644 --- a/arch/arm/mach-mmp/brownstone.c +++ b/arch/arm/mach-mmp/brownstone.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -180,6 +181,11 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { .clk_delay_cycles = 0x1f, }; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = { + .clk_delay_cycles = 0x1f, + .flags = PXA_FLAG_CARD_PERMANENT, +}; + static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { .clk_delay_cycles = 0x1f, .flags = PXA_FLAG_CARD_PERMANENT @@ -187,6 +193,38 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { }; +static void __init mmc_sdio_wifi(void) +{ + int poweron; + int reset; + + poweron = mfp_to_gpio(GPIO57_GPIO); + reset = mfp_to_gpio(GPIO58_GPIO); + + if (gpio_request(reset, "sd8xxx reset")) { + printk(KERN_INFO "gpio %d request failed\n", reset); + return; + } + + if (gpio_request(poweron, "sd8xxx PDn")) { + gpio_free(reset); + printk(KERN_INFO "gpio %d request failed\n", poweron); + return; + } + + gpio_direction_output(poweron, 0); + msleep(1); + gpio_direction_output(poweron, 1); + msleep(1); + gpio_direction_output(reset, 0); + msleep(1); + gpio_direction_output(reset, 1); + gpio_free(reset); + gpio_free(poweron); + + mmp2_add_sdhost(1, &mmp2_sdh_platdata_mmc1); /* Wifi */ +} + static void __init brownstone_init(void) { mfp_config(ARRAY_AND_SIZE(brownstone_pin_config)); @@ -195,8 +233,9 @@ static void __init brownstone_init(void) mmp2_add_uart(1); mmp2_add_uart(3); mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); - mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ mmp2_add_sdhost(2, &mmp2_sdh_platdata_mmc2); /* eMMC */ + mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ + mmc_sdio_wifi(); /* enable 5v regulator */ platform_device_register(&brownstone_v_5vp_device);