Lines Matching refs:mmc

131 static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)  in tmio_mmc_enable_sdio_irq()  argument
133 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_enable_sdio_irq()
137 pm_runtime_get_sync(mmc_dev(mmc)); in tmio_mmc_enable_sdio_irq()
150 pm_runtime_mark_last_busy(mmc_dev(mmc)); in tmio_mmc_enable_sdio_irq()
151 pm_runtime_put_autosuspend(mmc_dev(mmc)); in tmio_mmc_enable_sdio_irq()
161 for (clock = host->mmc->f_min, clk = 0x80000080; in tmio_mmc_set_clock()
263 mmc_request_done(host->mmc, mrq); in tmio_mmc_reset_work()
265 pm_runtime_mark_last_busy(mmc_dev(host->mmc)); in tmio_mmc_reset_work()
266 pm_runtime_put_autosuspend(mmc_dev(host->mmc)); in tmio_mmc_reset_work()
295 mmc_request_done(host->mmc, mrq); in tmio_mmc_finish_request()
297 pm_runtime_mark_last_busy(mmc_dev(host->mmc)); in tmio_mmc_finish_request()
298 pm_runtime_put_autosuspend(mmc_dev(host->mmc)); in tmio_mmc_finish_request()
641 struct mmc_host *mmc = host->mmc; in __tmio_mmc_card_detect_irq() local
647 if ((((ireg & TMIO_STAT_CARD_REMOVE) && mmc->card) || in __tmio_mmc_card_detect_irq()
648 ((ireg & TMIO_STAT_CARD_INSERT) && !mmc->card)) && in __tmio_mmc_card_detect_irq()
649 !work_pending(&mmc->detect.work)) in __tmio_mmc_card_detect_irq()
650 mmc_detect_change(host->mmc, msecs_to_jiffies(100)); in __tmio_mmc_card_detect_irq()
713 struct mmc_host *mmc = host->mmc; in tmio_mmc_sdio_irq() local
730 if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ) in tmio_mmc_sdio_irq()
731 mmc_signal_sdio_irq(mmc); in tmio_mmc_sdio_irq()
765 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) { in tmio_mmc_start_data()
770 mmc_hostname(host->mmc), data->blksz); in tmio_mmc_start_data()
788 static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) in tmio_mmc_request() argument
790 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_request()
801 mmc_request_done(mmc, mrq); in tmio_mmc_request()
812 pm_runtime_get_sync(mmc_dev(mmc)); in tmio_mmc_request()
831 mmc_request_done(mmc, mrq); in tmio_mmc_request()
833 pm_runtime_mark_last_busy(mmc_dev(mmc)); in tmio_mmc_request()
834 pm_runtime_put_autosuspend(mmc_dev(mmc)); in tmio_mmc_request()
839 struct mmc_host *mmc = host->mmc; in tmio_mmc_clk_update() local
845 ret = host->clk_enable(host->pdev, &mmc->f_max); in tmio_mmc_clk_update()
847 mmc->f_min = mmc->f_max / 512; in tmio_mmc_clk_update()
854 struct mmc_host *mmc = host->mmc; in tmio_mmc_power_on() local
862 if (!IS_ERR(mmc->supply.vmmc)) { in tmio_mmc_power_on()
863 ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); in tmio_mmc_power_on()
876 if (!IS_ERR(mmc->supply.vqmmc) && !ret) { in tmio_mmc_power_on()
877 ret = regulator_enable(mmc->supply.vqmmc); in tmio_mmc_power_on()
888 struct mmc_host *mmc = host->mmc; in tmio_mmc_power_off() local
890 if (!IS_ERR(mmc->supply.vqmmc)) in tmio_mmc_power_off()
891 regulator_disable(mmc->supply.vqmmc); in tmio_mmc_power_off()
893 if (!IS_ERR(mmc->supply.vmmc)) in tmio_mmc_power_off()
894 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); in tmio_mmc_power_off()
919 static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in tmio_mmc_set_ios() argument
921 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_set_ios()
925 pm_runtime_get_sync(mmc_dev(mmc)); in tmio_mmc_set_ios()
984 pm_runtime_mark_last_busy(mmc_dev(mmc)); in tmio_mmc_set_ios()
985 pm_runtime_put_autosuspend(mmc_dev(mmc)); in tmio_mmc_set_ios()
988 static int tmio_mmc_get_ro(struct mmc_host *mmc) in tmio_mmc_get_ro() argument
990 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_get_ro()
992 int ret = mmc_gpio_get_ro(mmc); in tmio_mmc_get_ro()
996 pm_runtime_get_sync(mmc_dev(mmc)); in tmio_mmc_get_ro()
999 pm_runtime_mark_last_busy(mmc_dev(mmc)); in tmio_mmc_get_ro()
1000 pm_runtime_put_autosuspend(mmc_dev(mmc)); in tmio_mmc_get_ro()
1028 struct mmc_host *mmc = host->mmc; in tmio_mmc_init_ocr() local
1030 mmc_regulator_get_supply(mmc); in tmio_mmc_init_ocr()
1033 if (!mmc->ocr_avail) in tmio_mmc_init_ocr()
1034 mmc->ocr_avail = pdata->ocr_mask; in tmio_mmc_init_ocr()
1040 if (!mmc->ocr_avail) in tmio_mmc_init_ocr()
1061 struct mmc_host *mmc; in tmio_mmc_host_alloc() local
1063 mmc = mmc_alloc_host(sizeof(struct tmio_mmc_host), &pdev->dev); in tmio_mmc_host_alloc()
1064 if (!mmc) in tmio_mmc_host_alloc()
1067 host = mmc_priv(mmc); in tmio_mmc_host_alloc()
1068 host->mmc = mmc; in tmio_mmc_host_alloc()
1077 mmc_free_host(host->mmc); in tmio_mmc_host_free()
1085 struct mmc_host *mmc = _host->mmc; in tmio_mmc_host_probe() local
1099 ret = mmc_of_parse(mmc); in tmio_mmc_host_probe()
1104 platform_set_drvdata(pdev, mmc); in tmio_mmc_host_probe()
1120 mmc->ops = &tmio_mmc_ops; in tmio_mmc_host_probe()
1121 mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities; in tmio_mmc_host_probe()
1122 mmc->caps2 |= pdata->capabilities2; in tmio_mmc_host_probe()
1123 mmc->max_segs = 32; in tmio_mmc_host_probe()
1124 mmc->max_blk_size = 512; in tmio_mmc_host_probe()
1125 mmc->max_blk_count = (PAGE_CACHE_SIZE / mmc->max_blk_size) * in tmio_mmc_host_probe()
1126 mmc->max_segs; in tmio_mmc_host_probe()
1127 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; in tmio_mmc_host_probe()
1128 mmc->max_seg_size = mmc->max_req_size; in tmio_mmc_host_probe()
1131 mmc->caps & MMC_CAP_NEEDS_POLL || in tmio_mmc_host_probe()
1132 mmc->caps & MMC_CAP_NONREMOVABLE || in tmio_mmc_host_probe()
1133 mmc->slot.cd_irq >= 0); in tmio_mmc_host_probe()
1136 mmc->f_max = pdata->hclk; in tmio_mmc_host_probe()
1137 mmc->f_min = mmc->f_max / 512; in tmio_mmc_host_probe()
1144 if (mmc->f_min == 0) { in tmio_mmc_host_probe()
1194 ret = mmc_add_host(mmc); in tmio_mmc_host_probe()
1203 ret = mmc_gpio_request_cd(mmc, pdata->cd_gpio, 0); in tmio_mmc_host_probe()
1208 mmc_gpiod_request_cd_irq(mmc); in tmio_mmc_host_probe()
1222 struct mmc_host *mmc = host->mmc; in tmio_mmc_host_remove() local
1229 mmc_remove_host(mmc); in tmio_mmc_host_remove()
1242 struct mmc_host *mmc = dev_get_drvdata(dev); in tmio_mmc_host_runtime_suspend() local
1243 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_host_runtime_suspend()
1259 struct mmc_host *mmc = dev_get_drvdata(dev); in tmio_mmc_host_runtime_resume() local
1260 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_host_runtime_resume()