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: 946542 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p65KKs4S030121 for ; Tue, 5 Jul 2011 20:20:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754104Ab1GEUUy (ORCPT ); Tue, 5 Jul 2011 16:20:54 -0400 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]:53499 "EHLO na3sys009aog110.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753857Ab1GEUUx convert rfc822-to-8bit (ORCPT ); Tue, 5 Jul 2011 16:20:53 -0400 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 CC: zhangfei gao , Russell King - ARM Linux , "linux-arm-kernel@lists.infradead.org" , "linux-mmc@vger.kernel.org" , Chris Ball , Zhangfei Gao 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 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 (demeter2.kernel.org [140.211.167.43]); Tue, 05 Jul 2011 20:20:55 +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);