• Home
  • Raw
  • Download

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()
749 struct mmc_host *mmc = container_of(dev, struct mmc_host, class_dev); in omap_hsmmc_show_slot_name() local
750 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_show_slot_name()
766 dev_vdbg(mmc_dev(host->mmc), "%s: CMD%d, argument 0x%08x\n", in omap_hsmmc_start_command()
767 mmc_hostname(host->mmc), cmd->opcode, cmd->arg); in omap_hsmmc_start_command()
836 mmc_request_done(host->mmc, mrq); in omap_hsmmc_request_done()
959 dev_vdbg(mmc_dev(host->mmc), "%s\n", res); in omap_hsmmc_dbg_report_irq()
1000 dev_err(mmc_dev(host->mmc), in omap_hsmmc_reset_controller_fsm()
1028 dev_vdbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status); in omap_hsmmc_do_irq()
1057 dev_dbg(mmc_dev(host->mmc), "AC12 err: 0x%x\n", ac12); in omap_hsmmc_do_irq()
1082 mmc_signal_sdio_irq(host->mmc); in omap_hsmmc_irq()
1159 dev_err(mmc_dev(host->mmc), "Unable to switch operating voltage\n"); in omap_hsmmc_switch_opcond()
1192 mmc_request_done(host->mmc, mrq); in omap_hsmmc_dma_callback()
1283 dev_err(mmc_dev(host->mmc), "prep_slave_sg() failed\n"); in omap_hsmmc_setup_dma_transfer()
1383 dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); in omap_hsmmc_prepare_data()
1390 static void omap_hsmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, in omap_hsmmc_post_req() argument
1393 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_post_req()
1405 static void omap_hsmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq) in omap_hsmmc_pre_req() argument
1407 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_pre_req()
1426 static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req) in omap_hsmmc_request() argument
1428 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_request()
1444 mmc_request_done(mmc, req); in omap_hsmmc_request()
1457 static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in omap_hsmmc_set_ios() argument
1459 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_set_ios()
1494 dev_dbg(mmc_dev(host->mmc), in omap_hsmmc_set_ios()
1507 static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card) in omap_hsmmc_init_card() argument
1509 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_init_card()
1512 struct device_node *np = mmc_dev(mmc)->of_node; in omap_hsmmc_init_card()
1542 static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable) in omap_hsmmc_enable_sdio_irq() argument
1544 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_enable_sdio_irq()
1592 dev_err(mmc_dev(host->mmc), "Unable to request wake IRQ\n"); in omap_hsmmc_configure_wake_irq()
1676 struct mmc_host *mmc = s->private; in mmc_regs_show() local
1677 struct omap_hsmmc_host *host = mmc_priv(mmc); in mmc_regs_show()
1679 seq_printf(s, "mmc%d:\n", mmc->index); in mmc_regs_show()
1681 (mmc->caps & MMC_CAP_SDIO_IRQ) ? "interrupt" : "polling"); in mmc_regs_show()
1683 if (mmc->caps & MMC_CAP_SDIO_IRQ) { in mmc_regs_show()
1715 static void omap_hsmmc_debugfs(struct mmc_host *mmc) in omap_hsmmc_debugfs() argument
1717 if (mmc->debugfs_root) in omap_hsmmc_debugfs()
1718 debugfs_create_file("regs", S_IRUSR, mmc->debugfs_root, in omap_hsmmc_debugfs()
1719 mmc, &mmc_regs_fops); in omap_hsmmc_debugfs()
1724 static void omap_hsmmc_debugfs(struct mmc_host *mmc) in omap_hsmmc_debugfs() argument
1807 struct mmc_host *mmc; in omap_hsmmc_probe() local
1843 mmc = mmc_alloc_host(sizeof(struct omap_hsmmc_host), &pdev->dev); in omap_hsmmc_probe()
1844 if (!mmc) { in omap_hsmmc_probe()
1849 ret = mmc_of_parse(mmc); in omap_hsmmc_probe()
1853 host = mmc_priv(mmc); in omap_hsmmc_probe()
1854 host->mmc = mmc; in omap_hsmmc_probe()
1872 mmc->ops = &omap_hsmmc_ops; in omap_hsmmc_probe()
1874 mmc->f_min = OMAP_MMC_MIN_CLOCK; in omap_hsmmc_probe()
1877 mmc->f_max = pdata->max_freq; in omap_hsmmc_probe()
1878 else if (mmc->f_max == 0) in omap_hsmmc_probe()
1879 mmc->f_max = OMAP_MMC_MAX_CLOCK; in omap_hsmmc_probe()
1910 dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n"); in omap_hsmmc_probe()
1916 mmc->max_segs = 64; in omap_hsmmc_probe()
1918 mmc->max_blk_size = 512; /* Block Length at max can be 1024 */ in omap_hsmmc_probe()
1919 mmc->max_blk_count = 0xFFFF; /* No. of Blocks is 16 bits */ in omap_hsmmc_probe()
1920 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; in omap_hsmmc_probe()
1922 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | in omap_hsmmc_probe()
1925 mmc->caps |= mmc_pdata(host)->caps; in omap_hsmmc_probe()
1926 if (mmc->caps & MMC_CAP_8_BIT_DATA) in omap_hsmmc_probe()
1927 mmc->caps |= MMC_CAP_4_BIT_DATA; in omap_hsmmc_probe()
1930 mmc->caps |= MMC_CAP_NONREMOVABLE; in omap_hsmmc_probe()
1932 mmc->pm_caps |= mmc_pdata(host)->pm_caps; in omap_hsmmc_probe()
1938 dev_err(mmc_dev(host->mmc), "RX DMA channel request failed\n"); in omap_hsmmc_probe()
1945 dev_err(mmc_dev(host->mmc), "TX DMA channel request failed\n"); in omap_hsmmc_probe()
1957 mmc->max_seg_size = min3(mmc->max_req_size, in omap_hsmmc_probe()
1963 mmc_hostname(mmc), host); in omap_hsmmc_probe()
1965 dev_err(mmc_dev(host->mmc), "Unable to grab HSMMC IRQ\n"); in omap_hsmmc_probe()
1973 if (!mmc->ocr_avail) in omap_hsmmc_probe()
1974 mmc->ocr_avail = mmc_pdata(host)->ocr_mask; in omap_hsmmc_probe()
1988 mmc->caps |= MMC_CAP_SDIO_IRQ; in omap_hsmmc_probe()
1990 ret = mmc_add_host(mmc); in omap_hsmmc_probe()
1995 ret = device_create_file(&mmc->class_dev, &dev_attr_slot_name); in omap_hsmmc_probe()
2000 omap_hsmmc_debugfs(mmc); in omap_hsmmc_probe()
2007 mmc_remove_host(mmc); in omap_hsmmc_probe()
2019 mmc_free_host(mmc); in omap_hsmmc_probe()
2029 mmc_remove_host(host->mmc); in omap_hsmmc_remove()
2041 mmc_free_host(host->mmc); in omap_hsmmc_remove()
2056 if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) { in omap_hsmmc_suspend()
2082 if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) in omap_hsmmc_resume()
2102 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && in omap_hsmmc_runtime_suspend()
2143 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && in omap_hsmmc_runtime_resume()