[U-Boot] [PATCH V2] imx6: mx6qarm2: updated board_mmc_getcd() to the new prototype

Stefano Babic sbabic at denx.de
Wed Jan 18 09:22:13 CET 2012


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
=====================================================================


More information about the U-Boot mailing list