Lines Matching refs:mmc
271 struct mmc_host *mmc; member
317 dev_err(mmc_dev(host->mmc), "fatal err reset timeout\n"); in sunxi_mmc_reset_host()
403 dma_len = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len, in sunxi_mmc_map_dma()
406 dev_err(mmc_dev(host->mmc), "dma_map_sg failed\n"); in sunxi_mmc_map_dma()
412 dev_err(mmc_dev(host->mmc), in sunxi_mmc_map_dma()
471 dev_err(mmc_dev(host->mmc), "send stop command failed\n"); in sunxi_mmc_send_manual_stop()
493 dev_dbg(mmc_dev(host->mmc), in sunxi_mmc_dump_errinfo()
495 host->mmc->index, cmd->opcode, in sunxi_mmc_dump_errinfo()
554 dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, in sunxi_mmc_finalize_request()
581 dev_dbg(mmc_dev(host->mmc), "irq: rq %p mi %08x idi %08x\n", in sunxi_mmc_irq()
616 mmc_request_done(host->mmc, mrq); in sunxi_mmc_irq()
619 mmc_signal_sdio_irq(host->mmc); in sunxi_mmc_irq()
635 dev_err(mmc_dev(host->mmc), "no request for manual stop\n"); in sunxi_mmc_handle_manual_stop()
639 dev_err(mmc_dev(host->mmc), "data error, sending stop command\n"); in sunxi_mmc_handle_manual_stop()
655 mmc_request_done(host->mmc, mrq); in sunxi_mmc_handle_manual_stop()
665 dev_dbg(mmc_dev(host->mmc), "%sabling the clock\n", in sunxi_mmc_oclk_onoff()
690 dev_err(mmc_dev(host->mmc), "fatal err update clk timeout\n"); in sunxi_mmc_oclk_onoff()
749 dev_dbg(mmc_dev(host->mmc), "Invalid clock... returning\n"); in sunxi_mmc_clk_set_phase()
762 struct mmc_host *mmc = host->mmc; in sunxi_mmc_clk_set_rate() local
772 mmc->actual_clock = 0; in sunxi_mmc_clk_set_rate()
796 dev_err(mmc_dev(mmc), in sunxi_mmc_clk_set_rate()
804 dev_err(mmc_dev(mmc), "error rounding clk to %d: %ld\n", in sunxi_mmc_clk_set_rate()
808 dev_dbg(mmc_dev(mmc), "setting clk to %d, rounded %ld\n", in sunxi_mmc_clk_set_rate()
814 dev_err(mmc_dev(mmc), "error setting clk to %ld: %d\n", in sunxi_mmc_clk_set_rate()
863 mmc->actual_clock = rate; in sunxi_mmc_clk_set_rate()
904 struct mmc_host *mmc = host->mmc; in sunxi_mmc_card_power() local
908 dev_dbg(mmc_dev(mmc), "Powering card up\n"); in sunxi_mmc_card_power()
910 if (!IS_ERR(mmc->supply.vmmc)) { in sunxi_mmc_card_power()
911 host->ferror = mmc_regulator_set_ocr(mmc, in sunxi_mmc_card_power()
912 mmc->supply.vmmc, in sunxi_mmc_card_power()
918 if (!IS_ERR(mmc->supply.vqmmc)) { in sunxi_mmc_card_power()
919 host->ferror = regulator_enable(mmc->supply.vqmmc); in sunxi_mmc_card_power()
921 dev_err(mmc_dev(mmc), in sunxi_mmc_card_power()
930 dev_dbg(mmc_dev(mmc), "Powering card off\n"); in sunxi_mmc_card_power()
932 if (!IS_ERR(mmc->supply.vmmc)) in sunxi_mmc_card_power()
933 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); in sunxi_mmc_card_power()
935 if (!IS_ERR(mmc->supply.vqmmc) && host->vqmmc_enabled) in sunxi_mmc_card_power()
936 regulator_disable(mmc->supply.vqmmc); in sunxi_mmc_card_power()
942 dev_dbg(mmc_dev(mmc), "Ignoring unknown card power state\n"); in sunxi_mmc_card_power()
947 static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in sunxi_mmc_set_ios() argument
949 struct sunxi_mmc_host *host = mmc_priv(mmc); in sunxi_mmc_set_ios()
956 static int sunxi_mmc_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios) in sunxi_mmc_volt_switch() argument
961 if (!IS_ERR(mmc->supply.vqmmc)) { in sunxi_mmc_volt_switch()
962 ret = mmc_regulator_set_vqmmc(mmc, ios); in sunxi_mmc_volt_switch()
967 if (mmc->ios.signal_voltage == MMC_SIGNAL_VOLTAGE_330) in sunxi_mmc_volt_switch()
973 static void sunxi_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) in sunxi_mmc_enable_sdio_irq() argument
975 struct sunxi_mmc_host *host = mmc_priv(mmc); in sunxi_mmc_enable_sdio_irq()
996 pm_runtime_put_noidle(host->mmc->parent); in sunxi_mmc_enable_sdio_irq()
999 static void sunxi_mmc_hw_reset(struct mmc_host *mmc) in sunxi_mmc_hw_reset() argument
1001 struct sunxi_mmc_host *host = mmc_priv(mmc); in sunxi_mmc_hw_reset()
1008 static void sunxi_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) in sunxi_mmc_request() argument
1010 struct sunxi_mmc_host *host = mmc_priv(mmc); in sunxi_mmc_request()
1022 mmc_request_done(mmc, mrq); in sunxi_mmc_request()
1029 dev_err(mmc_dev(mmc), "map DMA failed\n"); in sunxi_mmc_request()
1032 mmc_request_done(mmc, mrq); in sunxi_mmc_request()
1070 dev_dbg(mmc_dev(mmc), "cmd %d(%08x) arg %x ie 0x%08x len %d\n", in sunxi_mmc_request()
1080 dma_unmap_sg(mmc_dev(mmc), data->sg, data->sg_len, in sunxi_mmc_request()
1083 dev_err(mmc_dev(mmc), "request already pending\n"); in sunxi_mmc_request()
1085 mmc_request_done(mmc, mrq); in sunxi_mmc_request()
1104 static int sunxi_mmc_card_busy(struct mmc_host *mmc) in sunxi_mmc_card_busy() argument
1106 struct sunxi_mmc_host *host = mmc_priv(mmc); in sunxi_mmc_card_busy()
1299 ret = mmc_regulator_get_supply(host->mmc); in sunxi_mmc_resource_request()
1359 struct mmc_host *mmc; in sunxi_mmc_probe() local
1362 mmc = mmc_alloc_host(sizeof(struct sunxi_mmc_host), &pdev->dev); in sunxi_mmc_probe()
1363 if (!mmc) { in sunxi_mmc_probe()
1367 platform_set_drvdata(pdev, mmc); in sunxi_mmc_probe()
1369 host = mmc_priv(mmc); in sunxi_mmc_probe()
1371 host->mmc = mmc; in sunxi_mmc_probe()
1410 mmc->ops = &sunxi_mmc_ops; in sunxi_mmc_probe()
1411 mmc->max_blk_count = 8192; in sunxi_mmc_probe()
1412 mmc->max_blk_size = 4096; in sunxi_mmc_probe()
1413 mmc->max_segs = PAGE_SIZE / sizeof(struct sunxi_idma_des); in sunxi_mmc_probe()
1414 mmc->max_seg_size = (1 << host->cfg->idma_des_size_bits); in sunxi_mmc_probe()
1415 mmc->max_req_size = mmc->max_seg_size * mmc->max_segs; in sunxi_mmc_probe()
1417 mmc->f_min = 400000; in sunxi_mmc_probe()
1418 mmc->f_max = 52000000; in sunxi_mmc_probe()
1419 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | in sunxi_mmc_probe()
1432 mmc->caps |= MMC_CAP_1_8V_DDR | MMC_CAP_3_3V_DDR; in sunxi_mmc_probe()
1434 ret = mmc_of_parse(mmc); in sunxi_mmc_probe()
1445 mmc->caps &= ~(MMC_CAP_3_3V_DDR | MMC_CAP_1_8V_DDR | in sunxi_mmc_probe()
1447 mmc->caps2 &= ~MMC_CAP2_HS200; in sunxi_mmc_probe()
1451 mmc->caps2 &= ~MMC_CAP2_HS400; in sunxi_mmc_probe()
1462 ret = mmc_add_host(mmc); in sunxi_mmc_probe()
1467 mmc->max_req_size >> 10, in sunxi_mmc_probe()
1475 mmc_free_host(mmc); in sunxi_mmc_probe()
1481 struct mmc_host *mmc = platform_get_drvdata(pdev); in sunxi_mmc_remove() local
1482 struct sunxi_mmc_host *host = mmc_priv(mmc); in sunxi_mmc_remove()
1484 mmc_remove_host(mmc); in sunxi_mmc_remove()
1489 mmc_free_host(mmc); in sunxi_mmc_remove()
1497 struct mmc_host *mmc = dev_get_drvdata(dev); in sunxi_mmc_runtime_resume() local
1498 struct sunxi_mmc_host *host = mmc_priv(mmc); in sunxi_mmc_runtime_resume()
1506 sunxi_mmc_set_bus_width(host, mmc->ios.bus_width); in sunxi_mmc_runtime_resume()
1507 sunxi_mmc_set_clk(host, &mmc->ios); in sunxi_mmc_runtime_resume()
1515 struct mmc_host *mmc = dev_get_drvdata(dev); in sunxi_mmc_runtime_suspend() local
1516 struct sunxi_mmc_host *host = mmc_priv(mmc); in sunxi_mmc_runtime_suspend()