Lines Matching refs:mmc
161 dev_err(mmc_dev(host->mmc), in mmci_validate_data()
233 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) in mmci_set_clkreg()
235 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8) in mmci_set_clkreg()
238 if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50) in mmci_set_clkreg()
254 mmc_request_done(host->mmc, mrq); in mmci_request_end()
256 pm_runtime_mark_last_busy(mmc_dev(host->mmc)); in mmci_request_end()
257 pm_runtime_put_autosuspend(mmc_dev(host->mmc)); in mmci_request_end()
308 dev_info(mmc_dev(host->mmc), "no DMA platform data\n"); in mmci_dma_setup()
330 dev_err(mmc_dev(host->mmc), "no RX DMA channel\n"); in mmci_dma_setup()
338 dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n"); in mmci_dma_setup()
353 dev_info(mmc_dev(host->mmc), "DMA channels RX %s, TX %s\n", in mmci_dma_setup()
364 if (max_seg_size < host->mmc->max_seg_size) in mmci_dma_setup()
365 host->mmc->max_seg_size = max_seg_size; in mmci_dma_setup()
371 if (max_seg_size < host->mmc->max_seg_size) in mmci_dma_setup()
372 host->mmc->max_seg_size = max_seg_size; in mmci_dma_setup()
393 dev_err(mmc_dev(host->mmc), "error during DMA transfer!\n"); in mmci_dma_data_error()
449 dev_err(mmc_dev(host->mmc), "buggy DMA detected. Taking evasive action.\n"); in mmci_dma_finalize()
546 dev_vdbg(mmc_dev(host->mmc), in mmci_dma_start_data()
580 static void mmci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq, in mmci_pre_request() argument
583 struct mmci_host *host = mmc_priv(mmc); in mmci_pre_request()
599 static void mmci_post_request(struct mmc_host *mmc, struct mmc_request *mrq, in mmci_post_request() argument
602 struct mmci_host *host = mmc_priv(mmc); in mmci_post_request()
668 dev_dbg(mmc_dev(host->mmc), "blksz %04x blks %04x flags %08x\n", in mmci_start_data()
696 if (variant->sdio && host->mmc->card) in mmci_start_data()
697 if (mmc_card_sdio(host->mmc->card)) { in mmci_start_data()
722 if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50) in mmci_start_data()
763 dev_dbg(mmc_dev(host->mmc), "op %02x arg %08x flags %08x\n", in mmci_start_command()
811 dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ, status 0x%08x at 0x%08x\n", in mmci_data_irq()
834 dev_err(mmc_dev(host->mmc), "stray MCI_DATABLOCKEND interrupt\n"); in mmci_data_irq()
984 dev_dbg(mmc_dev(host->mmc), "irq1 (pio) %08x\n", status); in mmci_pio_irq()
1077 dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status); in mmci_irq()
1097 static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq) in mmci_request() argument
1099 struct mmci_host *host = mmc_priv(mmc); in mmci_request()
1106 mmc_request_done(mmc, mrq); in mmci_request()
1110 pm_runtime_get_sync(mmc_dev(mmc)); in mmci_request()
1127 static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in mmci_set_ios() argument
1129 struct mmci_host *host = mmc_priv(mmc); in mmci_set_ios()
1135 pm_runtime_get_sync(mmc_dev(mmc)); in mmci_set_ios()
1138 host->plat->ios_handler(mmc_dev(mmc), ios)) in mmci_set_ios()
1139 dev_err(mmc_dev(mmc), "platform ios_handler failed\n"); in mmci_set_ios()
1143 if (!IS_ERR(mmc->supply.vmmc)) in mmci_set_ios()
1144 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); in mmci_set_ios()
1146 if (!IS_ERR(mmc->supply.vqmmc) && in mmci_set_ios()
1147 regulator_is_enabled(mmc->supply.vqmmc)) in mmci_set_ios()
1148 regulator_disable(mmc->supply.vqmmc); in mmci_set_ios()
1152 if (!IS_ERR(mmc->supply.vmmc)) in mmci_set_ios()
1153 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); in mmci_set_ios()
1164 if (!IS_ERR(mmc->supply.vqmmc) && in mmci_set_ios()
1165 !regulator_is_enabled(mmc->supply.vqmmc)) { in mmci_set_ios()
1166 ret = regulator_enable(mmc->supply.vqmmc); in mmci_set_ios()
1168 dev_err(mmc_dev(mmc), in mmci_set_ios()
1218 pm_runtime_mark_last_busy(mmc_dev(mmc)); in mmci_set_ios()
1219 pm_runtime_put_autosuspend(mmc_dev(mmc)); in mmci_set_ios()
1222 static int mmci_get_ro(struct mmc_host *mmc) in mmci_get_ro() argument
1224 struct mmci_host *host = mmc_priv(mmc); in mmci_get_ro()
1232 static int mmci_get_cd(struct mmc_host *mmc) in mmci_get_cd() argument
1234 struct mmci_host *host = mmc_priv(mmc); in mmci_get_cd()
1242 status = plat->status(mmc_dev(host->mmc)); in mmci_get_cd()
1258 mmc_detect_change(host->mmc, msecs_to_jiffies(500)); in mmci_cd_irq()
1325 struct mmc_host *mmc; in mmci_probe() local
1347 mmc = mmc_alloc_host(sizeof(struct mmci_host), &dev->dev); in mmci_probe()
1348 if (!mmc) { in mmci_probe()
1353 host = mmc_priv(mmc); in mmci_probe()
1354 host->mmc = mmc; in mmci_probe()
1362 dev_dbg(mmc_dev(mmc), "designer ID = 0x%02x\n", host->hw_designer); in mmci_probe()
1363 dev_dbg(mmc_dev(mmc), "revision = 0x%01x\n", host->hw_revision); in mmci_probe()
1389 dev_dbg(mmc_dev(mmc), "eventual mclk rate: %u Hz\n", in mmci_probe()
1399 mmc->ops = &mmci_ops; in mmci_probe()
1406 mmc->f_min = DIV_ROUND_UP(host->mclk, 257); in mmci_probe()
1408 mmc->f_min = DIV_ROUND_UP(host->mclk, 512); in mmci_probe()
1418 mmc->f_max = min(host->mclk, plat->f_max); in mmci_probe()
1420 mmc->f_max = min(host->mclk, fmax); in mmci_probe()
1421 dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); in mmci_probe()
1441 mmc_regulator_get_supply(mmc); in mmci_probe()
1442 if (!mmc->ocr_avail) in mmci_probe()
1443 mmc->ocr_avail = plat->ocr_mask; in mmci_probe()
1445 dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n"); in mmci_probe()
1447 mmc->caps = plat->capabilities; in mmci_probe()
1448 mmc->caps2 = plat->capabilities2; in mmci_probe()
1451 mmc->pm_caps = MMC_PM_KEEP_POWER; in mmci_probe()
1456 mmc->max_segs = NR_SG; in mmci_probe()
1463 mmc->max_req_size = (1 << variant->datalength_bits) - 1; in mmci_probe()
1469 mmc->max_seg_size = mmc->max_req_size; in mmci_probe()
1474 mmc->max_blk_size = 1 << 11; in mmci_probe()
1480 mmc->max_blk_count = mmc->max_req_size >> 11; in mmci_probe()
1531 mmc->caps |= MMC_CAP_NEEDS_POLL; in mmci_probe()
1548 amba_set_drvdata(dev, mmc); in mmci_probe()
1551 mmc_hostname(mmc), amba_part(dev), amba_manf(dev), in mmci_probe()
1561 mmc_add_host(mmc); in mmci_probe()
1582 mmc_free_host(mmc); in mmci_probe()
1591 struct mmc_host *mmc = amba_get_drvdata(dev); in mmci_remove() local
1595 if (mmc) { in mmci_remove()
1596 struct mmci_host *host = mmc_priv(mmc); in mmci_remove()
1604 mmc_remove_host(mmc); in mmci_remove()
1628 mmc_free_host(mmc); in mmci_remove()
1640 struct mmc_host *mmc = amba_get_drvdata(adev); in mmci_suspend() local
1643 if (mmc) { in mmci_suspend()
1644 struct mmci_host *host = mmc_priv(mmc); in mmci_suspend()
1646 ret = mmc_suspend_host(mmc); in mmci_suspend()
1659 struct mmc_host *mmc = amba_get_drvdata(adev); in mmci_resume() local
1662 if (mmc) { in mmci_resume()
1663 struct mmci_host *host = mmc_priv(mmc); in mmci_resume()
1668 ret = mmc_resume_host(mmc); in mmci_resume()
1679 struct mmc_host *mmc = amba_get_drvdata(adev); in mmci_runtime_suspend() local
1681 if (mmc) { in mmci_runtime_suspend()
1682 struct mmci_host *host = mmc_priv(mmc); in mmci_runtime_suspend()
1692 struct mmc_host *mmc = amba_get_drvdata(adev); in mmci_runtime_resume() local
1694 if (mmc) { in mmci_runtime_resume()
1695 struct mmci_host *host = mmc_priv(mmc); in mmci_runtime_resume()