Lines Matching refs:mmc

171 	struct	mmc_host	*mmc;  member
216 static int omap_hsmmc_enable_supply(struct mmc_host *mmc) in omap_hsmmc_enable_supply() argument
219 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_enable_supply()
220 struct mmc_ios *ios = &mmc->ios; in omap_hsmmc_enable_supply()
222 if (!IS_ERR(mmc->supply.vmmc)) { in omap_hsmmc_enable_supply()
223 ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); in omap_hsmmc_enable_supply()
229 if (!IS_ERR(mmc->supply.vqmmc) && !host->vqmmc_enabled) { in omap_hsmmc_enable_supply()
230 ret = regulator_enable(mmc->supply.vqmmc); in omap_hsmmc_enable_supply()
232 dev_err(mmc_dev(mmc), "vmmc_aux reg enable failed\n"); in omap_hsmmc_enable_supply()
241 if (!IS_ERR(mmc->supply.vmmc)) in omap_hsmmc_enable_supply()
242 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); in omap_hsmmc_enable_supply()
247 static int omap_hsmmc_disable_supply(struct mmc_host *mmc) in omap_hsmmc_disable_supply() argument
251 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_disable_supply()
253 if (!IS_ERR(mmc->supply.vqmmc) && host->vqmmc_enabled) { in omap_hsmmc_disable_supply()
254 ret = regulator_disable(mmc->supply.vqmmc); in omap_hsmmc_disable_supply()
256 dev_err(mmc_dev(mmc), "vmmc_aux reg disable failed\n"); in omap_hsmmc_disable_supply()
262 if (!IS_ERR(mmc->supply.vmmc)) { in omap_hsmmc_disable_supply()
263 ret = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); in omap_hsmmc_disable_supply()
271 if (!IS_ERR(mmc->supply.vqmmc)) { in omap_hsmmc_disable_supply()
272 status = regulator_enable(mmc->supply.vqmmc); in omap_hsmmc_disable_supply()
274 dev_err(mmc_dev(mmc), "vmmc_aux re-enable failed\n"); in omap_hsmmc_disable_supply()
312 struct mmc_host *mmc = host->mmc; in omap_hsmmc_set_power() local
319 if (IS_ERR(mmc->supply.vmmc)) in omap_hsmmc_set_power()
340 ret = omap_hsmmc_enable_supply(mmc); in omap_hsmmc_set_power()
348 ret = omap_hsmmc_disable_supply(mmc); in omap_hsmmc_set_power()
356 omap_hsmmc_disable_supply(mmc); in omap_hsmmc_set_power()
383 struct mmc_host *mmc = host->mmc; in omap_hsmmc_disable_boot_regulators() local
391 ret = omap_hsmmc_disable_boot_regulator(mmc->supply.vmmc); in omap_hsmmc_disable_boot_regulators()
397 ret = omap_hsmmc_disable_boot_regulator(mmc->supply.vqmmc); in omap_hsmmc_disable_boot_regulators()
417 struct mmc_host *mmc = host->mmc; in omap_hsmmc_reg_get() local
420 ret = mmc_regulator_get_supply(mmc); in omap_hsmmc_reg_get()
425 if (IS_ERR(mmc->supply.vqmmc)) { in omap_hsmmc_reg_get()
426 mmc->supply.vqmmc = devm_regulator_get_optional(host->dev, in omap_hsmmc_reg_get()
428 if (IS_ERR(mmc->supply.vqmmc)) { in omap_hsmmc_reg_get()
429 ret = PTR_ERR(mmc->supply.vqmmc); in omap_hsmmc_reg_get()
433 PTR_ERR(mmc->supply.vqmmc)); in omap_hsmmc_reg_get()
477 dev_dbg(mmc_dev(host->mmc), "MMC Clock is not stopped\n"); in omap_hsmmc_stop_clock()
535 struct mmc_ios *ios = &host->mmc->ios; in omap_hsmmc_set_clock()
540 dev_vdbg(mmc_dev(host->mmc), "Set clock to %uHz\n", ios->clock); in omap_hsmmc_set_clock()
585 struct mmc_ios *ios = &host->mmc->ios; in omap_hsmmc_set_bus_width()
613 struct mmc_ios *ios = &host->mmc->ios; in omap_hsmmc_set_bus_mode()
631 struct mmc_ios *ios = &host->mmc->ios; in omap_hsmmc_context_restore()
655 if (host->mmc->caps & MMC_CAP_SDIO_IRQ) in omap_hsmmc_context_restore()
687 dev_dbg(mmc_dev(host->mmc), "context is restored: restore count %d\n", in omap_hsmmc_context_restore()
744 struct mmc_host *mmc = container_of(dev, struct mmc_host, class_dev); in omap_hsmmc_show_slot_name() local
745 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_show_slot_name()
761 dev_vdbg(mmc_dev(host->mmc), "%s: CMD%d, argument 0x%08x\n", in omap_hsmmc_start_command()
762 mmc_hostname(host->mmc), cmd->opcode, cmd->arg); in omap_hsmmc_start_command()
831 mmc_request_done(host->mmc, mrq); in omap_hsmmc_request_done()
954 dev_vdbg(mmc_dev(host->mmc), "%s\n", res); in omap_hsmmc_dbg_report_irq()
995 dev_err(mmc_dev(host->mmc), in omap_hsmmc_reset_controller_fsm()
1023 dev_vdbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status); in omap_hsmmc_do_irq()
1052 dev_dbg(mmc_dev(host->mmc), "AC12 err: 0x%x\n", ac12); in omap_hsmmc_do_irq()
1077 mmc_signal_sdio_irq(host->mmc); in omap_hsmmc_irq()
1154 dev_err(mmc_dev(host->mmc), "Unable to switch operating voltage\n"); in omap_hsmmc_switch_opcond()
1187 mmc_request_done(host->mmc, mrq); in omap_hsmmc_dma_callback()
1278 dev_err(mmc_dev(host->mmc), "prep_slave_sg() failed\n"); in omap_hsmmc_setup_dma_transfer()
1378 dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); in omap_hsmmc_prepare_data()
1385 static void omap_hsmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, in omap_hsmmc_post_req() argument
1388 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_post_req()
1400 static void omap_hsmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq) in omap_hsmmc_pre_req() argument
1402 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_pre_req()
1421 static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req) in omap_hsmmc_request() argument
1423 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_request()
1439 mmc_request_done(mmc, req); in omap_hsmmc_request()
1452 static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in omap_hsmmc_set_ios() argument
1454 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_set_ios()
1489 dev_dbg(mmc_dev(host->mmc), in omap_hsmmc_set_ios()
1502 static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card) in omap_hsmmc_init_card() argument
1504 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_init_card()
1507 struct device_node *np = mmc_dev(mmc)->of_node; in omap_hsmmc_init_card()
1537 static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable) in omap_hsmmc_enable_sdio_irq() argument
1539 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_enable_sdio_irq()
1587 dev_err(mmc_dev(host->mmc), "Unable to request wake IRQ\n"); in omap_hsmmc_configure_wake_irq()
1671 struct mmc_host *mmc = s->private; in mmc_regs_show() local
1672 struct omap_hsmmc_host *host = mmc_priv(mmc); in mmc_regs_show()
1674 seq_printf(s, "mmc%d:\n", mmc->index); in mmc_regs_show()
1676 (mmc->caps & MMC_CAP_SDIO_IRQ) ? "interrupt" : "polling"); in mmc_regs_show()
1678 if (mmc->caps & MMC_CAP_SDIO_IRQ) { in mmc_regs_show()
1710 static void omap_hsmmc_debugfs(struct mmc_host *mmc) in omap_hsmmc_debugfs() argument
1712 if (mmc->debugfs_root) in omap_hsmmc_debugfs()
1713 debugfs_create_file("regs", S_IRUSR, mmc->debugfs_root, in omap_hsmmc_debugfs()
1714 mmc, &mmc_regs_fops); in omap_hsmmc_debugfs()
1719 static void omap_hsmmc_debugfs(struct mmc_host *mmc) in omap_hsmmc_debugfs() argument
1802 struct mmc_host *mmc; in omap_hsmmc_probe() local
1838 mmc = mmc_alloc_host(sizeof(struct omap_hsmmc_host), &pdev->dev); in omap_hsmmc_probe()
1839 if (!mmc) { in omap_hsmmc_probe()
1844 ret = mmc_of_parse(mmc); in omap_hsmmc_probe()
1848 host = mmc_priv(mmc); in omap_hsmmc_probe()
1849 host->mmc = mmc; in omap_hsmmc_probe()
1867 mmc->ops = &omap_hsmmc_ops; in omap_hsmmc_probe()
1869 mmc->f_min = OMAP_MMC_MIN_CLOCK; in omap_hsmmc_probe()
1872 mmc->f_max = pdata->max_freq; in omap_hsmmc_probe()
1873 else if (mmc->f_max == 0) in omap_hsmmc_probe()
1874 mmc->f_max = OMAP_MMC_MAX_CLOCK; in omap_hsmmc_probe()
1905 dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n"); in omap_hsmmc_probe()
1911 mmc->max_segs = 64; in omap_hsmmc_probe()
1913 mmc->max_blk_size = 512; /* Block Length at max can be 1024 */ in omap_hsmmc_probe()
1914 mmc->max_blk_count = 0xFFFF; /* No. of Blocks is 16 bits */ in omap_hsmmc_probe()
1915 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; in omap_hsmmc_probe()
1917 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | in omap_hsmmc_probe()
1920 mmc->caps |= mmc_pdata(host)->caps; in omap_hsmmc_probe()
1921 if (mmc->caps & MMC_CAP_8_BIT_DATA) in omap_hsmmc_probe()
1922 mmc->caps |= MMC_CAP_4_BIT_DATA; in omap_hsmmc_probe()
1925 mmc->caps |= MMC_CAP_NONREMOVABLE; in omap_hsmmc_probe()
1927 mmc->pm_caps |= mmc_pdata(host)->pm_caps; in omap_hsmmc_probe()
1933 dev_err(mmc_dev(host->mmc), "RX DMA channel request failed\n"); in omap_hsmmc_probe()
1940 dev_err(mmc_dev(host->mmc), "TX DMA channel request failed\n"); in omap_hsmmc_probe()
1952 mmc->max_seg_size = min3(mmc->max_req_size, in omap_hsmmc_probe()
1958 mmc_hostname(mmc), host); in omap_hsmmc_probe()
1960 dev_err(mmc_dev(host->mmc), "Unable to grab HSMMC IRQ\n"); in omap_hsmmc_probe()
1968 if (!mmc->ocr_avail) in omap_hsmmc_probe()
1969 mmc->ocr_avail = mmc_pdata(host)->ocr_mask; in omap_hsmmc_probe()
1983 mmc->caps |= MMC_CAP_SDIO_IRQ; in omap_hsmmc_probe()
1985 mmc_add_host(mmc); in omap_hsmmc_probe()
1988 ret = device_create_file(&mmc->class_dev, &dev_attr_slot_name); in omap_hsmmc_probe()
1993 omap_hsmmc_debugfs(mmc); in omap_hsmmc_probe()
2000 mmc_remove_host(mmc); in omap_hsmmc_probe()
2012 mmc_free_host(mmc); in omap_hsmmc_probe()
2022 mmc_remove_host(host->mmc); in omap_hsmmc_remove()
2034 mmc_free_host(host->mmc); in omap_hsmmc_remove()
2049 if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) { in omap_hsmmc_suspend()
2075 if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) in omap_hsmmc_resume()
2096 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && in omap_hsmmc_runtime_suspend()
2137 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && in omap_hsmmc_runtime_resume()