From patchwork Wed Sep 16 01:00:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mark A. Greer" X-Patchwork-Id: 47790 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8G10qjZ025837 for ; Wed, 16 Sep 2009 01:00:52 GMT Received: from dlep36.itg.ti.com ([157.170.170.91]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8G10pt2024400 for ; Tue, 15 Sep 2009 20:00:51 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id n8G10pGc023433 for ; Tue, 15 Sep 2009 20:00:51 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 83E3180671 for ; Tue, 15 Sep 2009 20:00:48 -0500 (CDT) X-Original-To: Davinci-linux-open-source@linux.davincidsp.com Delivered-To: Davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id BD4FB80626 for ; Tue, 15 Sep 2009 20:00:43 -0500 (CDT) Received: from neches.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8G10h3w029685 for ; Tue, 15 Sep 2009 20:00:43 -0500 (CDT) Received: from mail156-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.114]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8G10hC9001584 for ; Tue, 15 Sep 2009 20:00:43 -0500 Received: from mail156-tx2 (localhost.localdomain [127.0.0.1]) by mail156-tx2-R.bigfish.com (Postfix) with ESMTP id 48FBC121009A for ; Wed, 16 Sep 2009 01:00:43 +0000 (UTC) X-SpamScore: 7 X-BigFish: vps7(zza4b1ozz1202hzzz2dh6bh62h) X-Spam-TCS-SCL: 1:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 63.81.120.158; Service: EHS Received: by mail156-tx2 (MessageSwitch) id 1253062839452794_4912; Wed, 16 Sep 2009 01:00:39 +0000 (UCT) Received: from gateway-1237.mvista.com (gateway-1237.mvista.com [63.81.120.158]) by mail156-tx2.bigfish.com (Postfix) with ESMTP id 302E0430089 for ; Wed, 16 Sep 2009 01:00:39 +0000 (UTC) Received: from mag.az.mvista.com (mag.az.mvista.com [10.50.1.99]) by hermes.mvista.com (Postfix) with ESMTP id 48F8C1B98D for ; Tue, 15 Sep 2009 18:00:35 -0700 (PDT) Received: from mgreer by mag.az.mvista.com with local (Exim 4.69) (envelope-from ) id 1Mniss-0008Jr-Lc for Davinci-linux-open-source@linux.davincidsp.com; Tue, 15 Sep 2009 18:00:34 -0700 Date: Tue, 15 Sep 2009 18:00:34 -0700 From: "Mark A. Greer" To: Davinci List Message-ID: <20090916010034.GA31954@mag.az.mvista.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Cc: Subject: [PATCH 1/4] davinci: Add MMC/SD support for DA830/OMAP-L137 EVM X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com From: Mark A. Greer Add pinmux settings, etc. to enable the MMC/SC hardware. Signed-off-by: Mark A. Greer --- Sorry for the delay... arch/arm/mach-davinci/board-da830-evm.c | 43 +++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 39711c1..69a791a 100644 --- a/arch/arm/mach-davinci/board-da830-evm.c +++ b/arch/arm/mach-davinci/board-da830-evm.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -83,6 +84,38 @@ static struct snd_platform_data da830_evm_snd_data = { .rxnumevt = 1, }; +/* + * GPIO2[1] is used as MMC_SD_WP and GPIO2[2] as MMC_SD_INS. + */ +static const short da830_evm_mmc_sd_pins[] = { + DA830_MMCSD_DAT_0, DA830_MMCSD_DAT_1, DA830_MMCSD_DAT_2, + DA830_MMCSD_DAT_3, DA830_MMCSD_DAT_4, DA830_MMCSD_DAT_5, + DA830_MMCSD_DAT_6, DA830_MMCSD_DAT_7, DA830_MMCSD_CLK, + DA830_MMCSD_CMD, DA830_GPIO2_1, DA830_GPIO2_2, + -1 +}; + +static int da830_evm_mmc_get_ro(int index) +{ + int val, status, gpio_num = 33; + + status = gpio_request(gpio_num, "MMC WP\n"); + if (status < 0) { + pr_warning("%s can not open GPIO %d\n", __func__, gpio_num); + return 0; + } + gpio_direction_input(gpio_num); + val = gpio_get_value(gpio_num); + gpio_free(gpio_num); + return val; +} + +static struct davinci_mmc_config da830_evm_mmc_config = { + .get_ro = da830_evm_mmc_get_ro, + .wires = 4, + .version = MMC_CTLR_VERSION_2, +}; + static __init void da830_evm_init(void) { struct davinci_soc_info *soc_info = &davinci_soc_info; @@ -132,6 +165,16 @@ static __init void da830_evm_init(void) ret); da8xx_register_mcasp(1, &da830_evm_snd_data); + + ret = da8xx_pinmux_setup(da830_evm_mmc_sd_pins); + if (ret) + pr_warning("da830_evm_init: mmc/sd mux setup failed: %d\n", + ret); + + ret = da8xx_register_mmcsd0(&da830_evm_mmc_config); + if (ret) + pr_warning("da830_evm_init: mmc/sd registration failed: %d\n", + ret); } #ifdef CONFIG_SERIAL_8250_CONSOLE