From patchwork Mon Feb 14 06:53:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 554071 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 p1E6s9Qf006486 for ; Mon, 14 Feb 2011 06:54:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751783Ab1BNGyu (ORCPT ); Mon, 14 Feb 2011 01:54:50 -0500 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]:54238 "EHLO na3sys009aog110.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751770Ab1BNGyu convert rfc822-to-8bit (ORCPT ); Mon, 14 Feb 2011 01:54:50 -0500 Received: from source ([65.219.4.130]) (using TLSv1) by na3sys009aob110.postini.com ([74.125.148.12]) with SMTP ID DSNKTVjRtiQ8/0P2C0/yMKiHN/9ob+gwNiLS@postini.com; Sun, 13 Feb 2011 22:54:50 PST Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by sc-owa02.marvell.com ([10.93.76.22]) with mapi; Sun, 13 Feb 2011 22:53:50 -0800 From: Philip Rakity To: "linux-arm-kernel@lists.infradead.org" CC: "linux-mmc@vger.kernel.org" , Mark Brown , Chris Ball , Arnd Bergmann Date: Sun, 13 Feb 2011 22:53:47 -0800 Subject: [PATCH 5/5] arm: mach-mmp: brownstone.c support multiple sd slots Thread-Topic: [PATCH 5/5] arm: mach-mmp: brownstone.c support multiple sd slots Thread-Index: AcvME+7HEspzKgNuQgqBKydO30Af9Q== Message-ID: <23C25DE3-86A5-4115-8539-D9837268F63F@marvell.com> 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 (demeter1.kernel.org [140.211.167.41]); Mon, 14 Feb 2011 06:54:51 +0000 (UTC) diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c index 7bb78fd..0e92fd7 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,45 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { .max_speed = 25000000, }; +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc1 = { + .flags = PXA_FLAG_CARD_PERMANENT, +}; + +static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc2 = { + .flags = PXA_FLAG_CARD_PERMANENT | + PXA_FLAG_SD_8_BIT_CAPABLE_SLOT, +}; + +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, 1); + mdelay (20); + gpio_direction_output(reset, 0); + mdelay (20); + 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)); @@ -188,7 +228,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(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);