• Home
  • Raw
  • Download

Lines Matching refs:mmc

336 static int mmci_card_busy(struct mmc_host *mmc)  in mmci_card_busy()  argument
338 struct mmci_host *host = mmc_priv(mmc); in mmci_card_busy()
449 host->mmc->actual_clock = host->cclk; in mmci_set_clkreg()
451 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) in mmci_set_clkreg()
453 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8) in mmci_set_clkreg()
456 if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50 || in mmci_set_clkreg()
457 host->mmc->ios.timing == MMC_TIMING_MMC_DDR52) in mmci_set_clkreg()
496 dev_err(mmc_dev(host->mmc), in mmci_validate_data()
556 dev_vdbg(mmc_dev(host->mmc), in mmci_dma_start()
605 mmc_request_done(host->mmc, mrq); in mmci_request_end()
742 dmae = devm_kzalloc(mmc_dev(host->mmc), sizeof(*dmae), GFP_KERNEL); in mmci_dmae_setup()
748 dmae->rx_channel = dma_request_chan(mmc_dev(host->mmc), "rx"); in mmci_dmae_setup()
755 dmae->tx_channel = dma_request_chan(mmc_dev(host->mmc), "tx"); in mmci_dmae_setup()
758 dev_warn(mmc_dev(host->mmc), in mmci_dmae_setup()
781 dev_info(mmc_dev(host->mmc), "DMA channels RX %s, TX %s\n", in mmci_dmae_setup()
792 if (max_seg_size < host->mmc->max_seg_size) in mmci_dmae_setup()
793 host->mmc->max_seg_size = max_seg_size; in mmci_dmae_setup()
799 if (max_seg_size < host->mmc->max_seg_size) in mmci_dmae_setup()
800 host->mmc->max_seg_size = max_seg_size; in mmci_dmae_setup()
847 dev_err(mmc_dev(host->mmc), "error during DMA transfer!\n"); in mmci_dmae_error()
893 dev_err(mmc_dev(host->mmc), "buggy DMA detected. Taking evasive action.\n"); in mmci_dmae_finalize()
1101 static void mmci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq) in mmci_pre_request() argument
1103 struct mmci_host *host = mmc_priv(mmc); in mmci_pre_request()
1117 static void mmci_post_request(struct mmc_host *mmc, struct mmc_request *mrq, in mmci_post_request() argument
1120 struct mmci_host *host = mmc_priv(mmc); in mmci_post_request()
1136 dev_dbg(mmc_dev(host->mmc), "blksz %04x blks %04x flags %08x\n", in mmci_start_data()
1155 if (host->mmc->card && mmc_card_sdio(host->mmc->card)) { in mmci_start_data()
1176 if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50 || in mmci_start_data()
1177 host->mmc->ios.timing == MMC_TIMING_MMC_DDR52) in mmci_start_data()
1219 dev_dbg(mmc_dev(host->mmc), "op %02x arg %08x flags %08x\n", in mmci_start_command()
1245 if (cmd->busy_timeout > host->mmc->max_busy_timeout) in mmci_start_command()
1246 clks = (unsigned long long)host->mmc->max_busy_timeout * host->cclk; in mmci_start_command()
1310 dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ, status 0x%08x at 0x%08x\n", in mmci_data_irq()
1333 dev_err(mmc_dev(host->mmc), "stray MCI_DATABLOCKEND interrupt\n"); in mmci_data_irq()
1543 dev_dbg(mmc_dev(host->mmc), "irq1 (pio) %08x\n", status); in mmci_pio_irq()
1637 dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status); in mmci_irq()
1691 static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq) in mmci_request() argument
1693 struct mmci_host *host = mmc_priv(mmc); in mmci_request()
1700 mmc_request_done(mmc, mrq); in mmci_request()
1723 static void mmci_set_max_busy_timeout(struct mmc_host *mmc) in mmci_set_max_busy_timeout() argument
1725 struct mmci_host *host = mmc_priv(mmc); in mmci_set_max_busy_timeout()
1731 if (host->variant->busy_timeout && mmc->actual_clock) in mmci_set_max_busy_timeout()
1732 max_busy_timeout = U32_MAX / DIV_ROUND_UP(mmc->actual_clock, in mmci_set_max_busy_timeout()
1735 mmc->max_busy_timeout = max_busy_timeout; in mmci_set_max_busy_timeout()
1738 static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in mmci_set_ios() argument
1740 struct mmci_host *host = mmc_priv(mmc); in mmci_set_ios()
1747 host->plat->ios_handler(mmc_dev(mmc), ios)) in mmci_set_ios()
1748 dev_err(mmc_dev(mmc), "platform ios_handler failed\n"); in mmci_set_ios()
1752 if (!IS_ERR(mmc->supply.vmmc)) in mmci_set_ios()
1753 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); in mmci_set_ios()
1755 if (!IS_ERR(mmc->supply.vqmmc) && host->vqmmc_enabled) { in mmci_set_ios()
1756 regulator_disable(mmc->supply.vqmmc); in mmci_set_ios()
1762 if (!IS_ERR(mmc->supply.vmmc)) in mmci_set_ios()
1763 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); in mmci_set_ios()
1774 if (!IS_ERR(mmc->supply.vqmmc) && !host->vqmmc_enabled) { in mmci_set_ios()
1775 ret = regulator_enable(mmc->supply.vqmmc); in mmci_set_ios()
1777 dev_err(mmc_dev(mmc), in mmci_set_ios()
1814 pinctrl_select_default_state(mmc_dev(mmc)); in mmci_set_ios()
1828 dev_err(mmc_dev(host->mmc), in mmci_set_ios()
1842 mmci_set_max_busy_timeout(mmc); in mmci_set_ios()
1854 static int mmci_get_cd(struct mmc_host *mmc) in mmci_get_cd() argument
1856 struct mmci_host *host = mmc_priv(mmc); in mmci_get_cd()
1858 unsigned int status = mmc_gpio_get_cd(mmc); in mmci_get_cd()
1864 status = plat->status(mmc_dev(host->mmc)); in mmci_get_cd()
1869 static int mmci_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios) in mmci_sig_volt_switch() argument
1871 struct mmci_host *host = mmc_priv(mmc); in mmci_sig_volt_switch()
1874 ret = mmc_regulator_set_vqmmc(mmc, ios); in mmci_sig_volt_switch()
1882 dev_warn(mmc_dev(mmc), "Voltage switch failed\n"); in mmci_sig_volt_switch()
1897 static void mmci_probe_level_translator(struct mmc_host *mmc) in mmci_probe_level_translator() argument
1899 struct device *dev = mmc_dev(mmc); in mmci_probe_level_translator()
1900 struct mmci_host *host = mmc_priv(mmc); in mmci_probe_level_translator()
1956 static int mmci_of_parse(struct device_node *np, struct mmc_host *mmc) in mmci_of_parse() argument
1958 struct mmci_host *host = mmc_priv(mmc); in mmci_of_parse()
1959 int ret = mmc_of_parse(mmc); in mmci_of_parse()
1981 mmci_probe_level_translator(mmc); in mmci_of_parse()
1984 mmc->caps |= MMC_CAP_MMC_HIGHSPEED; in mmci_of_parse()
1986 mmc->caps |= MMC_CAP_SD_HIGHSPEED; in mmci_of_parse()
1998 struct mmc_host *mmc; in mmci_probe() local
2013 mmc = mmc_alloc_host(sizeof(struct mmci_host), &dev->dev); in mmci_probe()
2014 if (!mmc) in mmci_probe()
2017 host = mmc_priv(mmc); in mmci_probe()
2018 host->mmc = mmc; in mmci_probe()
2020 mmc->ops = &mmci_ops; in mmci_probe()
2022 ret = mmci_of_parse(np, mmc); in mmci_probe()
2041 dev_err(mmc_dev(mmc), "Can't select opendrain pins\n"); in mmci_probe()
2049 dev_dbg(mmc_dev(mmc), "designer ID = 0x%02x\n", host->hw_designer); in mmci_probe()
2050 dev_dbg(mmc_dev(mmc), "revision = 0x%01x\n", host->hw_revision); in mmci_probe()
2080 dev_dbg(mmc_dev(mmc), "eventual mclk rate: %u Hz\n", in mmci_probe()
2101 mmc->f_min = DIV_ROUND_UP(host->mclk, 257); in mmci_probe()
2103 mmc->f_min = DIV_ROUND_UP(host->mclk, 2046); in mmci_probe()
2105 mmc->f_min = clk_round_rate(host->clk, 100000); in mmci_probe()
2107 mmc->f_min = DIV_ROUND_UP(host->mclk, 512); in mmci_probe()
2114 if (mmc->f_max) in mmci_probe()
2115 mmc->f_max = variant->explicit_mclk_control ? in mmci_probe()
2116 min(variant->f_max, mmc->f_max) : in mmci_probe()
2117 min(host->mclk, mmc->f_max); in mmci_probe()
2119 mmc->f_max = variant->explicit_mclk_control ? in mmci_probe()
2123 dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); in mmci_probe()
2132 dev_err(mmc_dev(mmc), "failed to de-assert reset\n"); in mmci_probe()
2135 ret = mmc_regulator_get_supply(mmc); in mmci_probe()
2139 if (!mmc->ocr_avail) in mmci_probe()
2140 mmc->ocr_avail = plat->ocr_mask; in mmci_probe()
2142 dev_warn(mmc_dev(mmc), "Platform OCR mask is ignored\n"); in mmci_probe()
2145 mmc->caps |= MMC_CAP_CMD23; in mmci_probe()
2159 mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; in mmci_probe()
2164 mmc->caps |= MMC_CAP_NEED_RSP_BUSY; in mmci_probe()
2172 mmc->pm_caps |= MMC_PM_KEEP_POWER; in mmci_probe()
2177 mmc->max_segs = NR_SG; in mmci_probe()
2184 mmc->max_req_size = (1 << variant->datalength_bits) - 1; in mmci_probe()
2190 mmc->max_seg_size = mmc->max_req_size; in mmci_probe()
2195 mmc->max_blk_size = 1 << variant->datactrl_blocksz; in mmci_probe()
2201 mmc->max_blk_count = mmc->max_req_size >> variant->datactrl_blocksz; in mmci_probe()
2220 ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0); in mmci_probe()
2224 ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0); in mmci_probe()
2246 amba_set_drvdata(dev, mmc); in mmci_probe()
2249 mmc_hostname(mmc), amba_part(dev), amba_manf(dev), in mmci_probe()
2258 ret = mmc_add_host(mmc); in mmci_probe()
2268 mmc_free_host(mmc); in mmci_probe()
2274 struct mmc_host *mmc = amba_get_drvdata(dev); in mmci_remove() local
2276 if (mmc) { in mmci_remove()
2277 struct mmci_host *host = mmc_priv(mmc); in mmci_remove()
2286 mmc_remove_host(mmc); in mmci_remove()
2298 mmc_free_host(mmc); in mmci_remove()
2341 struct mmc_host *mmc = amba_get_drvdata(adev); in mmci_runtime_suspend() local
2343 if (mmc) { in mmci_runtime_suspend()
2344 struct mmci_host *host = mmc_priv(mmc); in mmci_runtime_suspend()
2356 struct mmc_host *mmc = amba_get_drvdata(adev); in mmci_runtime_resume() local
2358 if (mmc) { in mmci_runtime_resume()
2359 struct mmci_host *host = mmc_priv(mmc); in mmci_runtime_resume()