linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: khilman@deeprootsystems.com (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 16/46] davinci: Add MMC/SD support for DA830/OMAP-L137 EVM
Date: Tue, 20 Oct 2009 08:06:52 -0700	[thread overview]
Message-ID: <87fx9ep0j7.fsf@deeprootsystems.com> (raw)
In-Reply-To: <BD79186B4FD85F4B8E60E381CAEE190901E24748@mi8nycmail19.Mi8.com> (H. Hartley Sweeten's message of "Mon\, 19 Oct 2009 20\:15\:39 -0400")

"H Hartley Sweeten" <hartleys@visionengravers.com> writes:

> On Monday, October 19, 2009 4:52 PM, Kevin Hilman wrote:
>> From 05e5376685ce71812ae8eb48115ce0d7fd8e0776 Mon Sep 17 00:00:00 2001
>> From: David A. Griego <dgriego@mvista.com>
>> Date: Tue, 15 Sep 2009 18:10:20 -0700
>> Subject: [PATCH 16/46] davinci: Add MMC/SD support for DA830/OMAP-L137 EVM
>> 
>> Add pinmux settings, etc. to enable the MMC/SC hardware.
>> 
>> Signed-off-by: David A. Griego <dgriego@mvista.com>
>> Signed-off-by: Mark A. Greer <mgreer@mvista.com>
>> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
>> ---
>>  arch/arm/mach-davinci/board-da830-evm.c |   41 +++++++++++++++++++++++++++++++
>>  1 files changed, 41 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..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 <mach/irqs.h>
>>  #include <mach/cp_intc.h>
>>  #include <mach/mux.h>
>> +#include <mach/gpio.h>
>>  #include <mach/da8xx.h>
>>  #include <mach/asp.h>
>>  
>> @@ -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);
>
> If the da8xx_pinmux_setup or gpio_request fail is it still safe to do
> the da8xx_register_mmcsd0?

Well, it would be safe, but it wouldn't work.  ;)

Good catch, I'll break those MMC init calls out into a separate init function
that will return early if any of the calls fails.

Here's an updated version.

Kevin

  reply	other threads:[~2009-10-20 15:06 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-16 19:09 [PATCH 00/46] davinci updates for 2.6.33 Kevin Hilman
2009-10-16 19:09 ` Kevin Hilman
2009-10-16 19:09   ` [PATCH 01/46] DaVinci: DM365: SDIO interrupt resource correction Kevin Hilman
2009-10-16 19:09     ` [PATCH 02/46] DaVinci: DM365: Correct USB parent clock Kevin Hilman
2009-10-16 19:09       ` [PATCH 03/46] Davinci: DM365: Add platform device for McBSP Kevin Hilman
2009-10-16 19:09         ` [PATCH 04/46] davinci: Move DA8xx/OMAP-L13x emac register routine Kevin Hilman
2009-10-16 19:09           ` [PATCH 05/46] davinci: Change DA8xx/OMAP-L13x McASP registration routine name Kevin Hilman
2009-10-16 19:09             ` [PATCH 06/46] davinci: Add DA830/OMAP-L137 EVM specific pinmux setting for McASP1 Kevin Hilman
2009-10-16 19:09               ` [PATCH 07/46] davinci: DA8XX/OMAP-L1XX: It's SYSCFG not BOOT_CFG Kevin Hilman
2009-10-16 19:09                 ` [PATCH 08/46] davinci: DA8XX/OMAP-L1XX: Avoid use of IO_ADDRESS for SYSCFG module Kevin Hilman
2009-10-16 19:09                   ` [PATCH 09/46] davinci: DA8XX/OMAP-L1XX: JTAG ID register should offset from SYSCFG base Kevin Hilman
2009-10-16 19:09                     ` [PATCH 10/46] davinci: enable easy top down traversal of clock tree Kevin Hilman
2009-10-16 19:09                       ` [PATCH 11/46] davinci: make clock rate re-calculation easy Kevin Hilman
2009-10-16 19:09                         ` [PATCH 12/46] davinci: support changing the clock rate in clock framework Kevin Hilman
2009-10-16 19:09                           ` [PATCH 13/46] davinci: support re-parenting a clock in the " Kevin Hilman
2009-10-16 19:09                             ` [PATCH 14/46] davinci: DA850/OMAP-L138: allow async3 source to be changed Kevin Hilman
2009-10-16 19:09                               ` [PATCH 15/46] davinci: dm646x: Add support for 3.x silicon revision Kevin Hilman
2009-10-16 19:09                                 ` [PATCH 16/46] davinci: Add MMC/SD support for DA830/OMAP-L137 EVM Kevin Hilman
2009-10-16 19:09                                   ` [PATCH 17/46] davinci: Add support for Sharp LCD035Q3DG01 graphical LCD Kevin Hilman
2009-10-16 19:09                                     ` [PATCH 18/46] davinci: Add LCD Graphics support for DA830/OMAP-L137 EVM Kevin Hilman
2009-10-16 19:09                                       ` [PATCH 19/46] davinci: Add RTC support for DA8xx/OMAP-L13x SoC's Kevin Hilman
2009-10-16 19:09                                         ` [PATCH 20/46] davinci: Correct the GPIO number for LCD panel power Kevin Hilman
2009-10-16 19:09                                           ` [PATCH 21/46] DaVinci: EDMA: Fix bug in edma_free_cont_slots API Kevin Hilman
2009-10-16 19:09                                             ` [PATCH 22/46] DaVinci: EDMA: Fix Bug in edma_alloc_cont_slots API Kevin Hilman
2009-10-16 19:09                                               ` [PATCH 23/46] davinci: DM355: Update NAND driver platform data Kevin Hilman
2009-10-16 19:09                                                 ` [PATCH 24/46] davinci: DM365: " Kevin Hilman
2009-10-16 19:09                                                   ` [PATCH 25/46] DaVinci: EDMA: Fix Bug while obtaining contiguous params Kevin Hilman
2009-10-16 19:09                                                     ` [PATCH 26/46] DaVinci: EDMA: Updating terminlogy in EDMA driver Kevin Hilman
2009-10-16 19:09                                                       ` [PATCH 27/46] davinci: DA8xx: CFGCHIP2 register definitions Kevin Hilman
2009-10-16 19:09                                                         ` [PATCH 28/46] davinci: DA8xx: OHCI platform device Kevin Hilman
2009-10-16 19:09                                                           ` [PATCH 29/46] davinci: DA830 EVM: OHCI platform code Kevin Hilman
2009-10-16 19:09                                                             ` [PATCH 30/46] davinci: da830 EVM: make machine name string consistent with da850 Kevin Hilman
2009-10-16 19:09                                                               ` [PATCH 31/46] davinci: da830: add support for new silicon revisions Kevin Hilman
2009-10-16 19:09                                                                 ` [PATCH 32/46] davinci: da830 EVM: remove #include <mach/gpio.h> Kevin Hilman
2009-10-16 19:09                                                                   ` [PATCH 33/46] davinci: add generic CPUFreq driver for DaVinci Kevin Hilman
2009-10-16 19:09                                                                     ` [PATCH 34/46] davinci: DA850/OMAP-L138: add frequency scaling support Kevin Hilman
2009-10-16 19:09                                                                       ` [PATCH 35/46] davinci: DA850/OMAP-L138: add voltage regulation support Kevin Hilman
2009-10-16 19:09                                                                         ` [PATCH 36/46] davinci: DA850/OMAP-L138 EVM: register for CPUFreq support Kevin Hilman
2009-10-16 19:09                                                                           ` [PATCH 37/46] davinci: DA850/OMAP-L138 EVM: add support for TPS65070 PMIC Kevin Hilman
2009-10-16 19:09                                                                             ` [PATCH 38/46] davinci: fix compilation error when using mach/system.h Kevin Hilman
2009-10-16 19:09                                                                               ` [PATCH 39/46] davinci: DA8xx: rename 'psc_ctlr' field into 'gpsc' Kevin Hilman
2009-10-16 19:09                                                                                 ` [PATCH 40/46] davinci: DA850/OMAP-L138 EVM expander setup and UI card detection Kevin Hilman
2009-10-16 19:09                                                                                   ` [PATCH 41/46] davinci: RMII support for DA850/OMAP-L138 EVM Kevin Hilman
2009-10-16 19:09                                                                                     ` [PATCH 42/46] davinci: make it easier to identify SoC init failures Kevin Hilman
2009-10-16 19:09                                                                                       ` [PATCH 43/46] DaVinci: remove unneeded #include's Kevin Hilman
2009-10-16 19:09                                                                                         ` [PATCH 44/46] davinci: dm646x-evm: Add platform data for NAND Kevin Hilman
2009-10-16 19:09                                                                                           ` [PATCH 45/46] davinci: DA850/OMAP-L138: Set ASYNC3 domain flag for McASP Kevin Hilman
2009-10-16 19:09                                                                                             ` [PATCH 46/46] davinci: DMx and da8xx defconfig updates Kevin Hilman
2009-10-22 14:02                                                                                         ` [PATCH 43/46] DaVinci: remove unneeded #include's Sergei Shtylyov
2009-10-23 20:49                                                                                           ` Kevin Hilman
2009-10-19 14:13                                                                               ` [PATCH 38/46] davinci: fix compilation error when using mach/system.h Russell King - ARM Linux
2009-10-19 18:33                                                                                 ` Kevin Hilman
2009-10-19 18:35                                                                                   ` Russell King - ARM Linux
2009-10-20 12:59                                                                                   ` Nori, Sekhar
2009-10-20 14:12                                                                                     ` Kevin Hilman
2009-11-02 12:04                                                                     ` [PATCH 33/46] davinci: add generic CPUFreq driver for DaVinci Nori, Sekhar
2009-11-02 17:20                                                                       ` Kevin Hilman
2009-10-19 14:07                                   ` [PATCH 16/46] davinci: Add MMC/SD support for DA830/OMAP-L137 EVM Russell King - ARM Linux
2009-10-19 16:39                                     ` Mark A. Greer
2009-10-19 16:42                                       ` Mark A. Greer
2009-10-19 16:56                                       ` Russell King - ARM Linux
2009-10-19 23:52                                     ` Kevin Hilman
2009-10-20  0:15                                       ` H Hartley Sweeten
2009-10-20 15:06                                         ` Kevin Hilman [this message]
2009-10-19 14:05                             ` [PATCH 13/46] davinci: support re-parenting a clock in the clock framework Russell King - ARM Linux
2009-10-19 18:19                               ` Kevin Hilman
2009-10-19 23:26                               ` Kevin Hilman
2009-10-19 13:58     ` [PATCH 01/46] DaVinci: DM365: SDIO interrupt resource correction Russell King - ARM Linux
2009-10-19 18:03       ` Kevin Hilman
  -- strict thread matches above, loose matches on Subject: below --
2009-09-16  1:10 [PATCH 16/46] davinci: Add MMC/SD support for DA830/OMAP-L137 EVM David A. Griego
2009-09-16  1:10 David A. Griego

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fx9ep0j7.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).