From patchwork Mon Oct 19 23:52:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 54859 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9JNsR9I024474 for ; Mon, 19 Oct 2009 23:54:27 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9JNqPV6020183 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Oct 2009 18:52:25 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id n9JNqOl0003514; Mon, 19 Oct 2009 18:52:25 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id C100C80627; Mon, 19 Oct 2009 18:52:24 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 404D780626 for ; Mon, 19 Oct 2009 18:52:22 -0500 (CDT) Received: from white.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id n9JNqMkH012895 for ; Mon, 19 Oct 2009 18:52:22 -0500 (CDT) Received: from mail66-va3-R.bigfish.com (mail-va3.bigfish.com [216.32.180.112]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9JNqLfv010530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 19 Oct 2009 18:52:21 -0500 Received: from mail66-va3 (localhost.localdomain [127.0.0.1]) by mail66-va3-R.bigfish.com (Postfix) with ESMTP id 3C020308433 for ; Mon, 19 Oct 2009 23:52:21 +0000 (UTC) X-SpamScore: -26 X-BigFish: vps-26(zz1432R98dN1447Rzz1202hzzz2dh6bh61h) X-Spam-TCS-SCL: 0:0 X-FB-SS: 5, X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.222.174; Service: EHS Received: by mail66-va3 (MessageSwitch) id 12559963397410_19523; Mon, 19 Oct 2009 23:52:19 +0000 (UCT) Received: from VA3EHSMHS031.bigfish.com (unknown [10.7.14.248]) by mail66-va3.bigfish.com (Postfix) with ESMTP id E7BD36B8051 for ; Mon, 19 Oct 2009 23:52:18 +0000 (UTC) Received: from mail-pz0-f174.google.com (209.85.222.174) by VA3EHSMHS031.bigfish.com (10.7.99.41) with Microsoft SMTP Server id 14.0.482.32; Mon, 19 Oct 2009 23:52:17 +0000 Received: by pzk4 with SMTP id 4so7933738pzk.32 for ; Mon, 19 Oct 2009 16:52:16 -0700 (PDT) Received: by 10.115.86.3 with SMTP id o3mr7604107wal.206.1255996336390; Mon, 19 Oct 2009 16:52:16 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id 22sm526695pzk.2.2009.10.19.16.52.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Oct 2009 16:52:15 -0700 (PDT) To: Russell King - ARM Linux References: <1255720190-7452-9-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-10-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-11-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-12-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-13-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-14-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-15-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-16-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-17-git-send-email-khilman@deeprootsystems.com> <1255720190-7452-18-git-send-email-khilman@deeprootsystems.com> <20091019140752.GC13614@n2100.arm.linux.org.uk> From: Kevin Hilman Organization: Deep Root Systems, LLC Date: Mon, 19 Oct 2009 16:52:14 -0700 In-Reply-To: <20091019140752.GC13614@n2100.arm.linux.org.uk> (Russell King's message of "Mon\, 19 Oct 2009 15\:07\:52 +0100") Message-ID: <87my3nq6vl.fsf@deeprootsystems.com> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 X-Reverse-DNS: mail-pz0-f174.google.com Cc: davinci-linux-open-source@linux.davincidsp.com, "David A. Griego" , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 16/46] 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@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c index 39711c1..444029e 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,30 @@ 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 +}; + +#define DA830_MMCSD_WP_PIN GPIO_TO_PIN(2, 1) + +static int da830_evm_mmc_get_ro(int index) +{ + return gpio_get_value(DA830_MMCSD_WP_PIN); +} + +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 +157,22 @@ 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 = gpio_request(DA830_MMCSD_WP_PIN, "MMC WP"); + if (ret) + pr_warning("da830_evm_init: can not open GPIO %d\n", + DA830_MMCSD_WP_PIN); + gpio_direction_input(DA830_MMCSD_WP_PIN); + + 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