Re: [patch 044/177] sdio: allow non-standard SDIO cards

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/8/11  <akpm@xxxxxxxxxxxxxxxxxxxx>:
> From: Grazvydas Ignotas <notasas@xxxxxxxxx>
>
> There are some chips (like TI WL12xx series) that can be interfaced over
> SDIO but don't support the SDIO specification, meaning that they are
> missing CIA (Common I/O Area) with all it's registers.  Current Linux SDIO
> implementation relies on those registers to identify and configure the
> card, so non-standard cards can not function and cause lots of warnings
> from the core when it reads invalid data from non-existent registers.
>
> After this patch, init_card() host callback can now set new quirk
> MMC_QUIRK_NONSTD_SDIO, which means that SDIO core should not try to access
> any standard SDIO registers and rely on init_card() to fill all SDIO
> structures instead.  As those cards are usually embedded chips, all the
> required information can be obtained from machine board files by the host
> driver when it's called through init_card() callback.
>
[...]
> diff -puN drivers/mmc/core/sdio.c~sdio-allow-non-standard-sdio-cards drivers/mmc/core/sdio.c
> --- a/drivers/mmc/core/sdio.c~sdio-allow-non-standard-sdio-cards
> +++ a/drivers/mmc/core/sdio.c
[...]
> @@ -412,6 +418,23 @@ static int mmc_sdio_init_card(struct mmc
>                        goto remove;
>        }
>
> +       if (card->quirks & MMC_QUIRK_NONSTD_SDIO) {
> +               /*
> +                * This is non-standard SDIO device, meaning it doesn't
> +                * have any CIA (Common I/O area) registers present.
> +                * It's host's responsibility to fill cccr and cis
> +                * structures in init_card().
> +                */
> +               mmc_set_clock(host, card->cis.max_dtr);
> +

> +               if (card->cccr.high_speed) {
> +                       mmc_card_set_highspeed(card);
> +                       mmc_set_timing(card->host, MMC_TIMING_SD_HS);
> +               }

Since this goes after patch 032/177 "mmc: split mmc_sd_init_card()",
you can use:

    if (card->cccr.high_speed)
        mmc_sd_go_highspeed(card);

> +
> +               goto finish;
> +       }
> +
>        /*
>         * Read the common registers.
>         */
[...]

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux