Lines Matching full:ssp

49 	struct mxs_ssp			ssp;  member
65 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_get_cd() local
76 !(readl(ssp->base + HW_SSP_STATUS(ssp)) & in mxs_mmc_get_cd()
87 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_reset() local
91 ret = stmp_reset_block(ssp->base); in mxs_mmc_reset()
109 ssp->base + HW_SSP_TIMING(ssp)); in mxs_mmc_reset()
116 writel(ctrl0, ssp->base + HW_SSP_CTRL0); in mxs_mmc_reset()
117 writel(ctrl1, ssp->base + HW_SSP_CTRL1(ssp)); in mxs_mmc_reset()
129 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_request_done() local
133 cmd->resp[3] = readl(ssp->base + HW_SSP_SDRESP0(ssp)); in mxs_mmc_request_done()
134 cmd->resp[2] = readl(ssp->base + HW_SSP_SDRESP1(ssp)); in mxs_mmc_request_done()
135 cmd->resp[1] = readl(ssp->base + HW_SSP_SDRESP2(ssp)); in mxs_mmc_request_done()
136 cmd->resp[0] = readl(ssp->base + HW_SSP_SDRESP3(ssp)); in mxs_mmc_request_done()
138 cmd->resp[0] = readl(ssp->base + HW_SSP_SDRESP0(ssp)); in mxs_mmc_request_done()
148 data->sg_len, ssp->dma_dir); in mxs_mmc_request_done()
181 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_irq_handler() local
186 stat = readl(ssp->base + HW_SSP_CTRL1(ssp)); in mxs_mmc_irq_handler()
188 ssp->base + HW_SSP_CTRL1(ssp) + STMP_OFFSET_REG_CLR); in mxs_mmc_irq_handler()
217 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_prep_dma() local
226 data->sg_len, ssp->dma_dir); in mxs_mmc_prep_dma()
231 sgl = (struct scatterlist *) ssp->ssp_pio_words; in mxs_mmc_prep_dma()
235 desc = dmaengine_prep_slave_sg(ssp->dmach, in mxs_mmc_prep_dma()
236 sgl, sg_len, ssp->slave_dirn, flags); in mxs_mmc_prep_dma()
243 data->sg_len, ssp->dma_dir); in mxs_mmc_prep_dma()
251 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_bc() local
265 ssp->ssp_pio_words[0] = ctrl0; in mxs_mmc_bc()
266 ssp->ssp_pio_words[1] = cmd0; in mxs_mmc_bc()
267 ssp->ssp_pio_words[2] = cmd1; in mxs_mmc_bc()
268 ssp->dma_dir = DMA_NONE; in mxs_mmc_bc()
269 ssp->slave_dirn = DMA_TRANS_NONE; in mxs_mmc_bc()
275 dma_async_issue_pending(ssp->dmach); in mxs_mmc_bc()
285 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_ac() local
310 ssp->ssp_pio_words[0] = ctrl0; in mxs_mmc_ac()
311 ssp->ssp_pio_words[1] = cmd0; in mxs_mmc_ac()
312 ssp->ssp_pio_words[2] = cmd1; in mxs_mmc_ac()
313 ssp->dma_dir = DMA_NONE; in mxs_mmc_ac()
314 ssp->slave_dirn = DMA_TRANS_NONE; in mxs_mmc_ac()
320 dma_async_issue_pending(ssp->dmach); in mxs_mmc_ac()
358 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_adtc() local
402 if (ssp_is_old(ssp)) { in mxs_mmc_adtc()
407 writel(data_size, ssp->base + HW_SSP_XFER_SIZE); in mxs_mmc_adtc()
410 ssp->base + HW_SSP_BLOCK_SIZE); in mxs_mmc_adtc()
424 timeout = mxs_ns_to_ssp_ticks(ssp->clk_rate, data->timeout_ns); in mxs_mmc_adtc()
425 val = readl(ssp->base + HW_SSP_TIMING(ssp)); in mxs_mmc_adtc()
428 writel(val, ssp->base + HW_SSP_TIMING(ssp)); in mxs_mmc_adtc()
431 ssp->ssp_pio_words[0] = ctrl0; in mxs_mmc_adtc()
432 ssp->ssp_pio_words[1] = cmd0; in mxs_mmc_adtc()
433 ssp->ssp_pio_words[2] = cmd1; in mxs_mmc_adtc()
434 ssp->dma_dir = DMA_NONE; in mxs_mmc_adtc()
435 ssp->slave_dirn = DMA_TRANS_NONE; in mxs_mmc_adtc()
443 ssp->dma_dir = dma_data_dir; in mxs_mmc_adtc()
444 ssp->slave_dirn = slave_dirn; in mxs_mmc_adtc()
450 dma_async_issue_pending(ssp->dmach); in mxs_mmc_adtc()
507 mxs_ssp_set_clk_rate(&host->ssp, ios->clock); in mxs_mmc_set_ios()
513 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_enable_sdio_irq() local
522 ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET); in mxs_mmc_enable_sdio_irq()
524 ssp->base + HW_SSP_CTRL1(ssp) + STMP_OFFSET_REG_SET); in mxs_mmc_enable_sdio_irq()
527 ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_CLR); in mxs_mmc_enable_sdio_irq()
529 ssp->base + HW_SSP_CTRL1(ssp) + STMP_OFFSET_REG_CLR); in mxs_mmc_enable_sdio_irq()
534 if (enable && readl(ssp->base + HW_SSP_STATUS(ssp)) & in mxs_mmc_enable_sdio_irq()
567 struct mxs_ssp *ssp; in mxs_mmc_probe() local
578 ssp = &host->ssp; in mxs_mmc_probe()
579 ssp->dev = &pdev->dev; in mxs_mmc_probe()
580 ssp->base = devm_platform_ioremap_resource(pdev, 0); in mxs_mmc_probe()
581 if (IS_ERR(ssp->base)) { in mxs_mmc_probe()
582 ret = PTR_ERR(ssp->base); in mxs_mmc_probe()
586 ssp->devid = (enum mxs_ssp_id)of_device_get_match_data(&pdev->dev); in mxs_mmc_probe()
606 ssp->clk = devm_clk_get(&pdev->dev, NULL); in mxs_mmc_probe()
607 if (IS_ERR(ssp->clk)) { in mxs_mmc_probe()
608 ret = PTR_ERR(ssp->clk); in mxs_mmc_probe()
611 ret = clk_prepare_enable(ssp->clk); in mxs_mmc_probe()
621 ssp->dmach = dma_request_chan(&pdev->dev, "rx-tx"); in mxs_mmc_probe()
622 if (IS_ERR(ssp->dmach)) { in mxs_mmc_probe()
625 ret = PTR_ERR(ssp->dmach); in mxs_mmc_probe()
647 mmc->max_blk_count = (ssp_is_old(ssp)) ? 0xff : 0xffffff; in mxs_mmc_probe()
648 mmc->max_req_size = (ssp_is_old(ssp)) ? 0xffff : 0xffffffff; in mxs_mmc_probe()
649 mmc->max_seg_size = dma_get_max_seg_size(ssp->dmach->device->dev); in mxs_mmc_probe()
669 dma_release_channel(ssp->dmach); in mxs_mmc_probe()
671 clk_disable_unprepare(ssp->clk); in mxs_mmc_probe()
681 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_remove() local
685 if (ssp->dmach) in mxs_mmc_remove()
686 dma_release_channel(ssp->dmach); in mxs_mmc_remove()
688 clk_disable_unprepare(ssp->clk); in mxs_mmc_remove()
700 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_suspend() local
702 clk_disable_unprepare(ssp->clk); in mxs_mmc_suspend()
710 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_resume() local
712 return clk_prepare_enable(ssp->clk); in mxs_mmc_resume()