All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype
Date: Wed, 18 Jan 2012 09:22:13 +0100	[thread overview]
Message-ID: <4F168135.10504@denx.de> (raw)
In-Reply-To: <CAFQ4atT+wk=fOPLu4ZGCuVwnZj9x2aycLwDicoG_=-dO97AXYg@mail.gmail.com>

On 18/01/2012 04:08, Jason Hui wrote:

>> -int board_mmc_getcd(u8 *cd, struct mmc *mmc)
>> +int board_mmc_getcd(struct mmc *mmc)
>>  {
>>        struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
>> +       int ret;
>>
>>        if (cfg->esdhc_base == USDHC3_BASE_ADDR) {
>>                gpio_direction_input(171); /*GPIO6_11*/
>> -               *cd = gpio_get_value(171);
>> +               ret = !gpio_get_value(171);
>>        } else /* Don't have the CD GPIO pin on board */
>> -               *cd = 0;
>> +               ret = 0;
>                               ^^^^^^1
> Apparently, this is wrong for the else statement, since there is no CD
> for the SD4 on the board,
> so, we have to tell MMC system that the card is always there,
> otherwise, we can't use the MMC

Ok - so we have to invert the logic for the else clause.

> plug-in that slot. After change to new prototype, we also need convert
> the ret value for the SD4,
> and return 1 not 0 to MMC.

Thanks - I send V3 with the required change.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2012-01-18  8:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17 11:18 [U-Boot] [PATCH] imx6: mx6qarm2: updated Stefano Babic
2012-01-17 11:50 ` Dirk Behme
2012-01-17 12:03 ` Fabio Estevam
2012-01-17 13:11   ` Stefano Babic
2012-01-17 13:15 ` [U-Boot] [PATCH V2] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype Stefano Babic
2012-01-18  3:08   ` Jason Hui
2012-01-18  8:22     ` Stefano Babic [this message]
2012-01-18  9:41 ` [U-Boot] [PATCH V3] " Stefano Babic
2012-01-18 10:40   ` Jason Hui

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=4F168135.10504@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.