Lines Matching refs:mmc
137 static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) in tmio_mmc_enable_sdio_irq() argument
139 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_enable_sdio_irq()
145 pm_runtime_get_sync(mmc_dev(mmc)); in tmio_mmc_enable_sdio_irq()
162 pm_runtime_mark_last_busy(mmc_dev(mmc)); in tmio_mmc_enable_sdio_irq()
163 pm_runtime_put_autosuspend(mmc_dev(mmc)); in tmio_mmc_enable_sdio_irq()
211 tmio_mmc_set_bus_width(host, host->mmc->ios.bus_width); in tmio_mmc_reset()
225 if (host->mmc->card) in tmio_mmc_reset()
226 mmc_retune_needed(host->mmc); in tmio_mmc_reset()
271 mmc_request_done(host->mmc, mrq); in tmio_mmc_reset_work()
632 struct mmc_host *mmc = host->mmc; in __tmio_mmc_card_detect_irq() local
638 if ((((ireg & TMIO_STAT_CARD_REMOVE) && mmc->card) || in __tmio_mmc_card_detect_irq()
639 ((ireg & TMIO_STAT_CARD_INSERT) && !mmc->card)) && in __tmio_mmc_card_detect_irq()
640 !work_pending(&mmc->detect.work)) in __tmio_mmc_card_detect_irq()
641 mmc_detect_change(host->mmc, msecs_to_jiffies(100)); in __tmio_mmc_card_detect_irq()
678 struct mmc_host *mmc = host->mmc; in __tmio_mmc_sdio_irq() local
695 if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ) in __tmio_mmc_sdio_irq()
696 mmc_signal_sdio_irq(mmc); in __tmio_mmc_sdio_irq()
733 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4 || in tmio_mmc_start_data()
734 host->mmc->ios.bus_width == MMC_BUS_WIDTH_8) { in tmio_mmc_start_data()
739 mmc_hostname(host->mmc), data->blksz); in tmio_mmc_start_data()
750 if (host->mmc->max_blk_count >= SZ_64K) in tmio_mmc_start_data()
788 mmc_request_done(host->mmc, mrq); in tmio_process_mrq()
792 static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) in tmio_mmc_request() argument
794 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_request()
804 mmc_request_done(mmc, mrq); in tmio_mmc_request()
851 mmc_retune_needed(host->mmc); in tmio_mmc_finish_request()
862 mmc_request_done(host->mmc, mrq); in tmio_mmc_finish_request()
874 struct mmc_host *mmc = host->mmc; in tmio_mmc_power_on() local
882 if (!IS_ERR(mmc->supply.vmmc)) { in tmio_mmc_power_on()
883 ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); in tmio_mmc_power_on()
896 if (!IS_ERR(mmc->supply.vqmmc) && !ret) { in tmio_mmc_power_on()
897 ret = regulator_enable(mmc->supply.vqmmc); in tmio_mmc_power_on()
908 struct mmc_host *mmc = host->mmc; in tmio_mmc_power_off() local
910 if (!IS_ERR(mmc->supply.vqmmc)) in tmio_mmc_power_off()
911 regulator_disable(mmc->supply.vqmmc); in tmio_mmc_power_off()
913 if (!IS_ERR(mmc->supply.vmmc)) in tmio_mmc_power_off()
914 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); in tmio_mmc_power_off()
930 unsigned int clk_rate = host->mmc->actual_clock ?: host->mmc->f_max; in tmio_mmc_max_busy_timeout()
932 host->mmc->max_busy_timeout = host->get_timeout_cycles(host) / in tmio_mmc_max_busy_timeout()
942 static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in tmio_mmc_set_ios() argument
944 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_set_ios()
1012 static int tmio_mmc_get_ro(struct mmc_host *mmc) in tmio_mmc_get_ro() argument
1014 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_get_ro()
1020 static int tmio_mmc_get_cd(struct mmc_host *mmc) in tmio_mmc_get_cd() argument
1022 struct tmio_mmc_host *host = mmc_priv(mmc); in tmio_mmc_get_cd()
1051 struct mmc_host *mmc = host->mmc; in tmio_mmc_init_ocr() local
1054 err = mmc_regulator_get_supply(mmc); in tmio_mmc_init_ocr()
1059 if (!mmc->ocr_avail) in tmio_mmc_init_ocr()
1060 mmc->ocr_avail = pdata->ocr_mask; in tmio_mmc_init_ocr()
1066 if (!mmc->ocr_avail) in tmio_mmc_init_ocr()
1073 struct mmc_host *mmc) in tmio_mmc_of_parse() argument
1086 mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT; in tmio_mmc_of_parse()
1093 struct mmc_host *mmc; in tmio_mmc_host_alloc() local
1101 mmc = mmc_alloc_host(sizeof(struct tmio_mmc_host), &pdev->dev); in tmio_mmc_host_alloc()
1102 if (!mmc) in tmio_mmc_host_alloc()
1105 host = mmc_priv(mmc); in tmio_mmc_host_alloc()
1107 host->mmc = mmc; in tmio_mmc_host_alloc()
1111 mmc->ops = &host->ops; in tmio_mmc_host_alloc()
1113 ret = mmc_of_parse(host->mmc); in tmio_mmc_host_alloc()
1119 tmio_mmc_of_parse(pdev, mmc); in tmio_mmc_host_alloc()
1125 mmc_free_host(mmc); in tmio_mmc_host_alloc()
1133 mmc_free_host(host->mmc); in tmio_mmc_host_free()
1141 struct mmc_host *mmc = _host->mmc; in tmio_mmc_host_probe() local
1148 if (mmc->f_min == 0) in tmio_mmc_host_probe()
1167 ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0); in tmio_mmc_host_probe()
1171 mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities; in tmio_mmc_host_probe()
1172 mmc->caps2 |= pdata->capabilities2; in tmio_mmc_host_probe()
1173 mmc->max_segs = pdata->max_segs ? : 32; in tmio_mmc_host_probe()
1174 mmc->max_blk_size = TMIO_MAX_BLK_SIZE; in tmio_mmc_host_probe()
1175 mmc->max_blk_count = pdata->max_blk_count ? : in tmio_mmc_host_probe()
1176 (PAGE_SIZE / mmc->max_blk_size) * mmc->max_segs; in tmio_mmc_host_probe()
1177 mmc->max_req_size = min_t(size_t, in tmio_mmc_host_probe()
1178 mmc->max_blk_size * mmc->max_blk_count, in tmio_mmc_host_probe()
1180 mmc->max_seg_size = mmc->max_req_size; in tmio_mmc_host_probe()
1182 if (mmc_can_gpio_ro(mmc)) in tmio_mmc_host_probe()
1185 if (mmc_can_gpio_cd(mmc)) in tmio_mmc_host_probe()
1189 _host->native_hotplug = !(mmc_can_gpio_cd(mmc) || in tmio_mmc_host_probe()
1190 mmc->caps & MMC_CAP_NEEDS_POLL || in tmio_mmc_host_probe()
1191 !mmc_card_is_removable(mmc)); in tmio_mmc_host_probe()
1226 ret = mmc_add_host(mmc); in tmio_mmc_host_probe()
1245 struct mmc_host *mmc = host->mmc; in tmio_mmc_host_remove() local
1254 mmc_remove_host(mmc); in tmio_mmc_host_remove()