Lines Matching refs:mmc

129 static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)  in tmio_mmc_enable_sdio_irq()  argument
131 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_enable_sdio_irq()
135 pm_runtime_get_sync(mmc_dev(mmc)); in tmio_mmc_enable_sdio_irq()
148 pm_runtime_mark_last_busy(mmc_dev(mmc)); in tmio_mmc_enable_sdio_irq()
149 pm_runtime_put_autosuspend(mmc_dev(mmc)); in tmio_mmc_enable_sdio_irq()
159 for (clock = host->mmc->f_min, clk = 0x80000080; in tmio_mmc_set_clock()
261 mmc_request_done(host->mmc, mrq); in tmio_mmc_reset_work()
263 pm_runtime_mark_last_busy(mmc_dev(host->mmc)); in tmio_mmc_reset_work()
264 pm_runtime_put_autosuspend(mmc_dev(host->mmc)); in tmio_mmc_reset_work()
293 mmc_request_done(host->mmc, mrq); in tmio_mmc_finish_request()
295 pm_runtime_mark_last_busy(mmc_dev(host->mmc)); in tmio_mmc_finish_request()
296 pm_runtime_put_autosuspend(mmc_dev(host->mmc)); in tmio_mmc_finish_request()
639 struct mmc_host *mmc = host->mmc; in __tmio_mmc_card_detect_irq() local
645 if ((((ireg & TMIO_STAT_CARD_REMOVE) && mmc->card) || in __tmio_mmc_card_detect_irq()
646 ((ireg & TMIO_STAT_CARD_INSERT) && !mmc->card)) && in __tmio_mmc_card_detect_irq()
647 !work_pending(&mmc->detect.work)) in __tmio_mmc_card_detect_irq()
648 mmc_detect_change(host->mmc, msecs_to_jiffies(100)); in __tmio_mmc_card_detect_irq()
711 struct mmc_host *mmc = host->mmc; in tmio_mmc_sdio_irq() local
728 if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ) in tmio_mmc_sdio_irq()
729 mmc_signal_sdio_irq(mmc); in tmio_mmc_sdio_irq()
763 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) { in tmio_mmc_start_data()
768 mmc_hostname(host->mmc), data->blksz); in tmio_mmc_start_data()
786 static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) in tmio_mmc_request() argument
788 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_request()
799 mmc_request_done(mmc, mrq); in tmio_mmc_request()
810 pm_runtime_get_sync(mmc_dev(mmc)); in tmio_mmc_request()
829 mmc_request_done(mmc, mrq); in tmio_mmc_request()
831 pm_runtime_mark_last_busy(mmc_dev(mmc)); in tmio_mmc_request()
832 pm_runtime_put_autosuspend(mmc_dev(mmc)); in tmio_mmc_request()
837 struct mmc_host *mmc = host->mmc; in tmio_mmc_clk_update() local
843 ret = host->clk_enable(host->pdev, &mmc->f_max); in tmio_mmc_clk_update()
845 mmc->f_min = mmc->f_max / 512; in tmio_mmc_clk_update()
852 struct mmc_host *mmc = host->mmc; in tmio_mmc_power_on() local
860 if (!IS_ERR(mmc->supply.vmmc)) { in tmio_mmc_power_on()
861 ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); in tmio_mmc_power_on()
874 if (!IS_ERR(mmc->supply.vqmmc) && !ret) { in tmio_mmc_power_on()
875 ret = regulator_enable(mmc->supply.vqmmc); in tmio_mmc_power_on()
886 struct mmc_host *mmc = host->mmc; in tmio_mmc_power_off() local
888 if (!IS_ERR(mmc->supply.vqmmc)) in tmio_mmc_power_off()
889 regulator_disable(mmc->supply.vqmmc); in tmio_mmc_power_off()
891 if (!IS_ERR(mmc->supply.vmmc)) in tmio_mmc_power_off()
892 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); in tmio_mmc_power_off()
917 static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in tmio_mmc_set_ios() argument
919 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_set_ios()
923 pm_runtime_get_sync(mmc_dev(mmc)); in tmio_mmc_set_ios()
982 pm_runtime_mark_last_busy(mmc_dev(mmc)); in tmio_mmc_set_ios()
983 pm_runtime_put_autosuspend(mmc_dev(mmc)); in tmio_mmc_set_ios()
986 static int tmio_mmc_get_ro(struct mmc_host *mmc) in tmio_mmc_get_ro() argument
988 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_get_ro()
990 int ret = mmc_gpio_get_ro(mmc); in tmio_mmc_get_ro()
994 pm_runtime_get_sync(mmc_dev(mmc)); in tmio_mmc_get_ro()
997 pm_runtime_mark_last_busy(mmc_dev(mmc)); in tmio_mmc_get_ro()
998 pm_runtime_put_autosuspend(mmc_dev(mmc)); in tmio_mmc_get_ro()
1026 struct mmc_host *mmc = host->mmc; in tmio_mmc_init_ocr() local
1028 mmc_regulator_get_supply(mmc); in tmio_mmc_init_ocr()
1031 if (!mmc->ocr_avail) in tmio_mmc_init_ocr()
1032 mmc->ocr_avail = pdata->ocr_mask; in tmio_mmc_init_ocr()
1038 if (!mmc->ocr_avail) in tmio_mmc_init_ocr()
1059 struct mmc_host *mmc; in tmio_mmc_host_alloc() local
1061 mmc = mmc_alloc_host(sizeof(struct tmio_mmc_host), &pdev->dev); in tmio_mmc_host_alloc()
1062 if (!mmc) in tmio_mmc_host_alloc()
1065 host = mmc_priv(mmc); in tmio_mmc_host_alloc()
1066 host->mmc = mmc; in tmio_mmc_host_alloc()
1075 mmc_free_host(host->mmc); in tmio_mmc_host_free()
1083 struct mmc_host *mmc = _host->mmc; in tmio_mmc_host_probe() local
1097 ret = mmc_of_parse(mmc); in tmio_mmc_host_probe()
1102 platform_set_drvdata(pdev, mmc); in tmio_mmc_host_probe()
1117 mmc->ops = &tmio_mmc_ops; in tmio_mmc_host_probe()
1118 mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities; in tmio_mmc_host_probe()
1119 mmc->caps2 |= pdata->capabilities2; in tmio_mmc_host_probe()
1120 mmc->max_segs = 32; in tmio_mmc_host_probe()
1121 mmc->max_blk_size = 512; in tmio_mmc_host_probe()
1122 mmc->max_blk_count = (PAGE_CACHE_SIZE / mmc->max_blk_size) * in tmio_mmc_host_probe()
1123 mmc->max_segs; in tmio_mmc_host_probe()
1124 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; in tmio_mmc_host_probe()
1125 mmc->max_seg_size = mmc->max_req_size; in tmio_mmc_host_probe()
1128 mmc->caps & MMC_CAP_NEEDS_POLL || in tmio_mmc_host_probe()
1129 mmc->caps & MMC_CAP_NONREMOVABLE || in tmio_mmc_host_probe()
1130 mmc->slot.cd_irq >= 0); in tmio_mmc_host_probe()
1133 mmc->f_max = pdata->hclk; in tmio_mmc_host_probe()
1134 mmc->f_min = mmc->f_max / 512; in tmio_mmc_host_probe()
1141 if (mmc->f_min == 0) { in tmio_mmc_host_probe()
1191 ret = mmc_add_host(mmc); in tmio_mmc_host_probe()
1200 ret = mmc_gpio_request_cd(mmc, pdata->cd_gpio, 0); in tmio_mmc_host_probe()
1205 mmc_gpiod_request_cd_irq(mmc); in tmio_mmc_host_probe()
1219 struct mmc_host *mmc = host->mmc; in tmio_mmc_host_remove() local
1226 mmc_remove_host(mmc); in tmio_mmc_host_remove()
1241 struct mmc_host *mmc = dev_get_drvdata(dev); in tmio_mmc_host_runtime_suspend() local
1242 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_host_runtime_suspend()
1258 struct mmc_host *mmc = dev_get_drvdata(dev); in tmio_mmc_host_runtime_resume() local
1259 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_host_runtime_resume()