unsigned char data;
ret = mmc_io_rw_direct(func->card, 0, 0,
- func->num * 0x100 + SDIO_FBR_STD_IF, 0, &data);
+ SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF, 0, &data);
if (ret)
goto out;
if (data == 0x0f) {
ret = mmc_io_rw_direct(func->card, 0, 0,
- func->num * 0x100 + SDIO_FBR_STD_IF_EXT, 0, &data);
+ SDIO_FBR_BASE(func->num) + SDIO_FBR_STD_IF_EXT, 0, &data);
if (ret)
goto out;
}
struct mmc_card *card;
BUG_ON(!host);
- BUG_ON(!host->claimed);
+ WARN_ON(!host->claimed);
mmc_attach_bus(host, &mmc_sdio_ops);
if (err)
goto err;
+ /*
+ * For SPI, enable CRC as appropriate.
+ */
+ if (mmc_host_is_spi(host)) {
+ err = mmc_spi_set_crc(host, use_spi_crc);
+ if (err)
+ goto err;
+ }
+
/*
* The number of functions on the card is encoded inside
* the ocr.
/*
* Allocate card structure.
*/
- card = mmc_alloc_card(host);
+ card = mmc_alloc_card(host, NULL);
if (IS_ERR(card)) {
err = PTR_ERR(card);
goto err;
host->card = card;
/*
- * Set card RCA.
+ * For native busses: set card RCA and quit open drain mode.
*/
- err = mmc_send_relative_addr(host, &card->rca);
- if (err)
- goto remove;
+ if (!mmc_host_is_spi(host)) {
+ err = mmc_send_relative_addr(host, &card->rca);
+ if (err)
+ goto remove;
- mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
+ mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
+ }
/*
* Select card, as all following commands rely on that.
*/
- err = mmc_select_card(card);
- if (err)
- goto remove;
+ if (!mmc_host_is_spi(host)) {
+ err = mmc_select_card(card);
+ if (err)
+ goto remove;
+ }
/*
* Read the common registers.