• Home
  • Raw
  • Download

Lines Matching refs:mmc

118 	struct mmc_host			*mmc;  member
125 static void meson_mx_mmc_mask_bits(struct mmc_host *mmc, char reg, u32 mask, in meson_mx_mmc_mask_bits() argument
128 struct meson_mx_mmc_host *host = mmc_priv(mmc); in meson_mx_mmc_mask_bits()
155 static void meson_mx_mmc_start_cmd(struct mmc_host *mmc, in meson_mx_mmc_start_cmd() argument
158 struct meson_mx_mmc_host *host = mmc_priv(mmc); in meson_mx_mmc_start_cmd()
197 if (mmc->ios.bus_width == MMC_BUS_WIDTH_4) in meson_mx_mmc_start_cmd()
225 meson_mx_mmc_mask_bits(mmc, MESON_MX_SDIO_IRQC, in meson_mx_mmc_start_cmd()
230 meson_mx_mmc_mask_bits(mmc, MESON_MX_SDIO_IRQS, in meson_mx_mmc_start_cmd()
255 mmc_request_done(host->mmc, mrq); in meson_mx_mmc_request_done()
258 static void meson_mx_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in meson_mx_mmc_set_ios() argument
260 struct meson_mx_mmc_host *host = mmc_priv(mmc); in meson_mx_mmc_set_ios()
266 meson_mx_mmc_mask_bits(mmc, MESON_MX_SDIO_CONF, in meson_mx_mmc_set_ios()
271 meson_mx_mmc_mask_bits(mmc, MESON_MX_SDIO_CONF, in meson_mx_mmc_set_ios()
278 dev_err(mmc_dev(mmc), "unsupported bus width: %d\n", in meson_mx_mmc_set_ios()
286 dev_warn(mmc_dev(mmc), in meson_mx_mmc_set_ios()
292 mmc->actual_clock = clk_get_rate(host->cfg_div_clk); in meson_mx_mmc_set_ios()
299 if (!IS_ERR(mmc->supply.vmmc)) { in meson_mx_mmc_set_ios()
300 host->error = mmc_regulator_set_ocr(mmc, in meson_mx_mmc_set_ios()
301 mmc->supply.vmmc, in meson_mx_mmc_set_ios()
310 static int meson_mx_mmc_map_dma(struct mmc_host *mmc, struct mmc_request *mrq) in meson_mx_mmc_map_dma() argument
321 dev_err(mmc_dev(mmc), in meson_mx_mmc_map_dma()
327 dma_len = dma_map_sg(mmc_dev(mmc), data->sg, data->sg_len, in meson_mx_mmc_map_dma()
330 dev_err(mmc_dev(mmc), "dma_map_sg failed\n"); in meson_mx_mmc_map_dma()
337 static void meson_mx_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) in meson_mx_mmc_request() argument
339 struct meson_mx_mmc_host *host = mmc_priv(mmc); in meson_mx_mmc_request()
343 host->error = meson_mx_mmc_map_dma(mmc, mrq); in meson_mx_mmc_request()
347 mmc_request_done(mmc, mrq); in meson_mx_mmc_request()
358 meson_mx_mmc_start_cmd(mmc, mrq->sbc); in meson_mx_mmc_request()
360 meson_mx_mmc_start_cmd(mmc, mrq->cmd); in meson_mx_mmc_request()
363 static void meson_mx_mmc_read_response(struct mmc_host *mmc, in meson_mx_mmc_read_response() argument
366 struct meson_mx_mmc_host *host = mmc_priv(mmc); in meson_mx_mmc_read_response()
402 meson_mx_mmc_read_response(host->mmc, cmd); in meson_mx_mmc_process_cmd_irq()
452 dma_unmap_sg(mmc_dev(host->mmc), cmd->data->sg, in meson_mx_mmc_irq_thread()
461 meson_mx_mmc_start_cmd(host->mmc, next_cmd); in meson_mx_mmc_irq_thread()
490 dev_dbg(mmc_dev(host->mmc), in meson_mx_mmc_timeout()
531 struct mmc_host *mmc = host->mmc; in meson_mx_mmc_add_host() local
532 struct device *slot_dev = mmc_dev(mmc); in meson_mx_mmc_add_host()
547 ret = mmc_regulator_get_supply(mmc); in meson_mx_mmc_add_host()
551 mmc->max_req_size = MESON_MX_SDIO_BOUNCE_REQ_SIZE; in meson_mx_mmc_add_host()
552 mmc->max_seg_size = mmc->max_req_size; in meson_mx_mmc_add_host()
553 mmc->max_blk_count = in meson_mx_mmc_add_host()
556 mmc->max_blk_size = FIELD_GET(MESON_MX_SDIO_EXT_DATA_RW_NUMBER_MASK, in meson_mx_mmc_add_host()
558 mmc->max_blk_size -= (4 * MESON_MX_SDIO_RESPONSE_CRC16_BITS); in meson_mx_mmc_add_host()
559 mmc->max_blk_size /= BITS_PER_BYTE; in meson_mx_mmc_add_host()
562 mmc->f_min = clk_round_rate(host->cfg_div_clk, 1); in meson_mx_mmc_add_host()
563 mmc->f_max = clk_round_rate(host->cfg_div_clk, in meson_mx_mmc_add_host()
566 mmc->caps |= MMC_CAP_CMD23 | MMC_CAP_WAIT_WHILE_BUSY; in meson_mx_mmc_add_host()
567 mmc->ops = &meson_mx_mmc_ops; in meson_mx_mmc_add_host()
569 ret = mmc_of_parse(mmc); in meson_mx_mmc_add_host()
573 ret = mmc_add_host(mmc); in meson_mx_mmc_add_host()
632 struct mmc_host *mmc; in meson_mx_mmc_probe() local
643 mmc = mmc_alloc_host(sizeof(*host), &slot_pdev->dev); in meson_mx_mmc_probe()
644 if (!mmc) { in meson_mx_mmc_probe()
649 host = mmc_priv(mmc); in meson_mx_mmc_probe()
650 host->mmc = mmc; in meson_mx_mmc_probe()
725 mmc_free_host(mmc); in meson_mx_mmc_probe()
734 struct device *slot_dev = mmc_dev(host->mmc); in meson_mx_mmc_remove()
738 mmc_remove_host(host->mmc); in meson_mx_mmc_remove()
745 mmc_free_host(host->mmc); in meson_mx_mmc_remove()