Lines Matching refs:mmc
177 struct mmc_host *mmc; member
247 return mmc_gpio_get_cd(host->mmc); in omap_hsmmc_card_detect()
254 return mmc_gpio_get_cd(host->mmc); in omap_hsmmc_get_cover_state()
299 ret = mmc_regulator_set_ocr(host->mmc, host->vcc, vdd); in omap_hsmmc_set_power()
304 ret = mmc_regulator_set_ocr(host->mmc, in omap_hsmmc_set_power()
313 ret = mmc_regulator_set_ocr(host->mmc, in omap_hsmmc_set_power()
423 static int omap_hsmmc_gpio_init(struct mmc_host *mmc, in omap_hsmmc_gpio_init() argument
430 ret = mmc_gpio_request_cd(mmc, pdata->gpio_cod, 0); in omap_hsmmc_gpio_init()
435 mmc_gpio_set_cd_isr(mmc, omap_hsmmc_cover_irq); in omap_hsmmc_gpio_init()
437 ret = mmc_gpio_request_cd(mmc, pdata->gpio_cd, 0); in omap_hsmmc_gpio_init()
445 ret = mmc_gpio_request_ro(mmc, pdata->gpio_wp); in omap_hsmmc_gpio_init()
470 dev_dbg(mmc_dev(host->mmc), "MMC Clock is not stopped\n"); in omap_hsmmc_stop_clock()
528 struct mmc_ios *ios = &host->mmc->ios; in omap_hsmmc_set_clock()
533 dev_vdbg(mmc_dev(host->mmc), "Set clock to %uHz\n", ios->clock); in omap_hsmmc_set_clock()
578 struct mmc_ios *ios = &host->mmc->ios; in omap_hsmmc_set_bus_width()
606 struct mmc_ios *ios = &host->mmc->ios; in omap_hsmmc_set_bus_mode()
624 struct mmc_ios *ios = &host->mmc->ios; in omap_hsmmc_context_restore()
648 if (host->mmc->caps & MMC_CAP_SDIO_IRQ) in omap_hsmmc_context_restore()
680 dev_dbg(mmc_dev(host->mmc), "context is restored: restore count %d\n", in omap_hsmmc_context_restore()
755 struct mmc_host *mmc = container_of(dev, struct mmc_host, class_dev); in omap_hsmmc_show_cover_switch() local
756 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_show_cover_switch()
768 struct mmc_host *mmc = container_of(dev, struct mmc_host, class_dev); in omap_hsmmc_show_slot_name() local
769 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_show_slot_name()
785 dev_vdbg(mmc_dev(host->mmc), "%s: CMD%d, argument 0x%08x\n", in omap_hsmmc_start_command()
786 mmc_hostname(host->mmc), cmd->opcode, cmd->arg); in omap_hsmmc_start_command()
864 mmc_request_done(host->mmc, mrq); in omap_hsmmc_request_done()
989 dev_vdbg(mmc_dev(host->mmc), "%s\n", res); in omap_hsmmc_dbg_report_irq()
1030 dev_err(mmc_dev(host->mmc), in omap_hsmmc_reset_controller_fsm()
1058 dev_vdbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status); in omap_hsmmc_do_irq()
1086 dev_dbg(mmc_dev(host->mmc), "AC12 err: 0x%x\n", ac12); in omap_hsmmc_do_irq()
1111 mmc_signal_sdio_irq(host->mmc); in omap_hsmmc_irq()
1208 dev_err(mmc_dev(host->mmc), "Unable to switch operating voltage\n"); in omap_hsmmc_switch_opcond()
1223 mmc_hostname(host->mmc)); in omap_hsmmc_protect_card()
1230 mmc_hostname(host->mmc)); in omap_hsmmc_protect_card()
1243 sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); in omap_hsmmc_cover_irq()
1246 mmc_detect_change(host->mmc, (HZ * 200) / 1000); in omap_hsmmc_cover_irq()
1279 mmc_request_done(host->mmc, mrq); in omap_hsmmc_dma_callback()
1372 dev_err(mmc_dev(host->mmc), "prep_slave_sg() failed\n"); in omap_hsmmc_setup_dma_transfer()
1463 dev_err(mmc_dev(host->mmc), "MMC start dma failure\n"); in omap_hsmmc_prepare_data()
1470 static void omap_hsmmc_post_req(struct mmc_host *mmc, struct mmc_request *mrq, in omap_hsmmc_post_req() argument
1473 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_post_req()
1485 static void omap_hsmmc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq, in omap_hsmmc_pre_req() argument
1488 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_pre_req()
1507 static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req) in omap_hsmmc_request() argument
1509 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_request()
1530 mmc_request_done(mmc, req); in omap_hsmmc_request()
1545 mmc_request_done(mmc, req); in omap_hsmmc_request()
1560 static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in omap_hsmmc_set_ios() argument
1562 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_set_ios()
1599 dev_dbg(mmc_dev(host->mmc), in omap_hsmmc_set_ios()
1614 static int omap_hsmmc_get_cd(struct mmc_host *mmc) in omap_hsmmc_get_cd() argument
1616 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_get_cd()
1623 static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card) in omap_hsmmc_init_card() argument
1625 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_init_card()
1631 static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable) in omap_hsmmc_enable_sdio_irq() argument
1633 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_enable_sdio_irq()
1668 struct mmc_host *mmc = host->mmc; in omap_hsmmc_configure_wake_irq() local
1684 mmc_hostname(mmc), host); in omap_hsmmc_configure_wake_irq()
1686 dev_err(mmc_dev(host->mmc), "Unable to request wake IRQ\n"); in omap_hsmmc_configure_wake_irq()
1776 struct mmc_host *mmc = s->private; in omap_hsmmc_regs_show() local
1777 struct omap_hsmmc_host *host = mmc_priv(mmc); in omap_hsmmc_regs_show()
1779 seq_printf(s, "mmc%d:\n", mmc->index); in omap_hsmmc_regs_show()
1781 (mmc->caps & MMC_CAP_SDIO_IRQ) ? "interrupt" : "polling"); in omap_hsmmc_regs_show()
1783 if (mmc->caps & MMC_CAP_SDIO_IRQ) { in omap_hsmmc_regs_show()
1825 static void omap_hsmmc_debugfs(struct mmc_host *mmc) in omap_hsmmc_debugfs() argument
1827 if (mmc->debugfs_root) in omap_hsmmc_debugfs()
1828 debugfs_create_file("regs", S_IRUSR, mmc->debugfs_root, in omap_hsmmc_debugfs()
1829 mmc, &mmc_regs_fops); in omap_hsmmc_debugfs()
1834 static void omap_hsmmc_debugfs(struct mmc_host *mmc) in omap_hsmmc_debugfs() argument
1917 struct mmc_host *mmc; in omap_hsmmc_probe() local
1955 mmc = mmc_alloc_host(sizeof(struct omap_hsmmc_host), &pdev->dev); in omap_hsmmc_probe()
1956 if (!mmc) { in omap_hsmmc_probe()
1961 ret = mmc_of_parse(mmc); in omap_hsmmc_probe()
1965 host = mmc_priv(mmc); in omap_hsmmc_probe()
1966 host->mmc = mmc; in omap_hsmmc_probe()
1978 ret = omap_hsmmc_gpio_init(mmc, host, pdata); in omap_hsmmc_probe()
1987 mmc->ops = &omap_hsmmc_ops; in omap_hsmmc_probe()
1989 mmc->f_min = OMAP_MMC_MIN_CLOCK; in omap_hsmmc_probe()
1992 mmc->f_max = pdata->max_freq; in omap_hsmmc_probe()
1993 else if (mmc->f_max == 0) in omap_hsmmc_probe()
1994 mmc->f_max = OMAP_MMC_MAX_CLOCK; in omap_hsmmc_probe()
2024 dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n"); in omap_hsmmc_probe()
2030 mmc->max_segs = 1024; in omap_hsmmc_probe()
2032 mmc->max_blk_size = 512; /* Block Length at max can be 1024 */ in omap_hsmmc_probe()
2033 mmc->max_blk_count = 0xFFFF; /* No. of Blocks is 16 bits */ in omap_hsmmc_probe()
2034 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; in omap_hsmmc_probe()
2035 mmc->max_seg_size = mmc->max_req_size; in omap_hsmmc_probe()
2037 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | in omap_hsmmc_probe()
2040 mmc->caps |= mmc_pdata(host)->caps; in omap_hsmmc_probe()
2041 if (mmc->caps & MMC_CAP_8_BIT_DATA) in omap_hsmmc_probe()
2042 mmc->caps |= MMC_CAP_4_BIT_DATA; in omap_hsmmc_probe()
2045 mmc->caps |= MMC_CAP_NONREMOVABLE; in omap_hsmmc_probe()
2047 mmc->pm_caps |= mmc_pdata(host)->pm_caps; in omap_hsmmc_probe()
2054 dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); in omap_hsmmc_probe()
2062 dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n"); in omap_hsmmc_probe()
2077 dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req); in omap_hsmmc_probe()
2087 dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req); in omap_hsmmc_probe()
2094 mmc_hostname(mmc), host); in omap_hsmmc_probe()
2096 dev_err(mmc_dev(host->mmc), "Unable to grab HSMMC IRQ\n"); in omap_hsmmc_probe()
2107 mmc->ocr_avail = mmc_pdata(host)->ocr_mask; in omap_hsmmc_probe()
2121 mmc->caps |= MMC_CAP_SDIO_IRQ; in omap_hsmmc_probe()
2125 mmc_add_host(mmc); in omap_hsmmc_probe()
2128 ret = device_create_file(&mmc->class_dev, &dev_attr_slot_name); in omap_hsmmc_probe()
2133 ret = device_create_file(&mmc->class_dev, in omap_hsmmc_probe()
2139 omap_hsmmc_debugfs(mmc); in omap_hsmmc_probe()
2146 mmc_remove_host(mmc); in omap_hsmmc_probe()
2160 mmc_free_host(mmc); in omap_hsmmc_probe()
2170 mmc_remove_host(host->mmc); in omap_hsmmc_remove()
2184 mmc_free_host(host->mmc); in omap_hsmmc_remove()
2199 if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) { in omap_hsmmc_suspend()
2208 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && in omap_hsmmc_suspend()
2209 !(host->mmc->pm_flags & MMC_PM_WAKE_SDIO_IRQ)) in omap_hsmmc_suspend()
2232 if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER)) in omap_hsmmc_resume()
2237 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && in omap_hsmmc_resume()
2238 !(host->mmc->pm_flags & MMC_PM_WAKE_SDIO_IRQ)) in omap_hsmmc_resume()
2258 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && in omap_hsmmc_runtime_suspend()
2303 if ((host->mmc->caps & MMC_CAP_SDIO_IRQ) && in omap_hsmmc_runtime_resume()