Loading drivers/mmc/core/sdio.c +57 −0 Original line number Diff line number Diff line Loading @@ -1215,3 +1215,60 @@ int mmc_attach_sdio(struct mmc_host *host) return err; } int sdio_reset_comm(struct mmc_card *card) { struct mmc_host *host = card->host; u32 ocr; int err; printk("%s():\n", __func__); mmc_go_idle(host); mmc_set_clock(host, host->f_min); err = mmc_send_io_op_cond(host, 0, &ocr); if (err) goto err; host->ocr = mmc_select_voltage(host, ocr); if (!host->ocr) { err = -EINVAL; goto err; } err = mmc_send_io_op_cond(host, host->ocr, &ocr); if (err) goto err; if (mmc_host_is_spi(host)) { err = mmc_spi_set_crc(host, use_spi_crc); if (err) goto err; } if (!mmc_host_is_spi(host)) { err = mmc_send_relative_addr(host, &card->rca); if (err) goto err; mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL); } if (!mmc_host_is_spi(host)) { err = mmc_select_card(card); if (err) goto err; } mmc_set_clock(host, card->cis.max_dtr); err = sdio_enable_wide(card); if (err) goto err; return 0; err: printk("%s: Error resetting SDIO communications (%d)\n", mmc_hostname(host), err); return err; } EXPORT_SYMBOL(sdio_reset_comm); Loading
drivers/mmc/core/sdio.c +57 −0 Original line number Diff line number Diff line Loading @@ -1215,3 +1215,60 @@ int mmc_attach_sdio(struct mmc_host *host) return err; } int sdio_reset_comm(struct mmc_card *card) { struct mmc_host *host = card->host; u32 ocr; int err; printk("%s():\n", __func__); mmc_go_idle(host); mmc_set_clock(host, host->f_min); err = mmc_send_io_op_cond(host, 0, &ocr); if (err) goto err; host->ocr = mmc_select_voltage(host, ocr); if (!host->ocr) { err = -EINVAL; goto err; } err = mmc_send_io_op_cond(host, host->ocr, &ocr); if (err) goto err; if (mmc_host_is_spi(host)) { err = mmc_spi_set_crc(host, use_spi_crc); if (err) goto err; } if (!mmc_host_is_spi(host)) { err = mmc_send_relative_addr(host, &card->rca); if (err) goto err; mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL); } if (!mmc_host_is_spi(host)) { err = mmc_select_card(card); if (err) goto err; } mmc_set_clock(host, card->cis.max_dtr); err = sdio_enable_wide(card); if (err) goto err; return 0; err: printk("%s: Error resetting SDIO communications (%d)\n", mmc_hostname(host), err); return err; } EXPORT_SYMBOL(sdio_reset_comm);