Lines Matching full:ssp

48 	struct mxs_ssp			ssp;  member
64 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_get_cd() local
75 !(readl(ssp->base + HW_SSP_STATUS(ssp)) & in mxs_mmc_get_cd()
86 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_reset() local
90 ret = stmp_reset_block(ssp->base); in mxs_mmc_reset()
108 ssp->base + HW_SSP_TIMING(ssp)); in mxs_mmc_reset()
115 writel(ctrl0, ssp->base + HW_SSP_CTRL0); in mxs_mmc_reset()
116 writel(ctrl1, ssp->base + HW_SSP_CTRL1(ssp)); in mxs_mmc_reset()
128 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_request_done() local
132 cmd->resp[3] = readl(ssp->base + HW_SSP_SDRESP0(ssp)); in mxs_mmc_request_done()
133 cmd->resp[2] = readl(ssp->base + HW_SSP_SDRESP1(ssp)); in mxs_mmc_request_done()
134 cmd->resp[1] = readl(ssp->base + HW_SSP_SDRESP2(ssp)); in mxs_mmc_request_done()
135 cmd->resp[0] = readl(ssp->base + HW_SSP_SDRESP3(ssp)); in mxs_mmc_request_done()
137 cmd->resp[0] = readl(ssp->base + HW_SSP_SDRESP0(ssp)); in mxs_mmc_request_done()
147 data->sg_len, ssp->dma_dir); in mxs_mmc_request_done()
180 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_irq_handler() local
185 stat = readl(ssp->base + HW_SSP_CTRL1(ssp)); in mxs_mmc_irq_handler()
187 ssp->base + HW_SSP_CTRL1(ssp) + STMP_OFFSET_REG_CLR); in mxs_mmc_irq_handler()
216 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_prep_dma() local
225 data->sg_len, ssp->dma_dir); in mxs_mmc_prep_dma()
230 sgl = (struct scatterlist *) ssp->ssp_pio_words; in mxs_mmc_prep_dma()
234 desc = dmaengine_prep_slave_sg(ssp->dmach, in mxs_mmc_prep_dma()
235 sgl, sg_len, ssp->slave_dirn, flags); in mxs_mmc_prep_dma()
242 data->sg_len, ssp->dma_dir); in mxs_mmc_prep_dma()
250 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_bc() local
264 ssp->ssp_pio_words[0] = ctrl0; in mxs_mmc_bc()
265 ssp->ssp_pio_words[1] = cmd0; in mxs_mmc_bc()
266 ssp->ssp_pio_words[2] = cmd1; in mxs_mmc_bc()
267 ssp->dma_dir = DMA_NONE; in mxs_mmc_bc()
268 ssp->slave_dirn = DMA_TRANS_NONE; in mxs_mmc_bc()
274 dma_async_issue_pending(ssp->dmach); in mxs_mmc_bc()
284 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_ac() local
309 ssp->ssp_pio_words[0] = ctrl0; in mxs_mmc_ac()
310 ssp->ssp_pio_words[1] = cmd0; in mxs_mmc_ac()
311 ssp->ssp_pio_words[2] = cmd1; in mxs_mmc_ac()
312 ssp->dma_dir = DMA_NONE; in mxs_mmc_ac()
313 ssp->slave_dirn = DMA_TRANS_NONE; in mxs_mmc_ac()
319 dma_async_issue_pending(ssp->dmach); in mxs_mmc_ac()
357 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_adtc() local
401 if (ssp_is_old(ssp)) { in mxs_mmc_adtc()
406 writel(data_size, ssp->base + HW_SSP_XFER_SIZE); in mxs_mmc_adtc()
409 ssp->base + HW_SSP_BLOCK_SIZE); in mxs_mmc_adtc()
423 timeout = mxs_ns_to_ssp_ticks(ssp->clk_rate, data->timeout_ns); in mxs_mmc_adtc()
424 val = readl(ssp->base + HW_SSP_TIMING(ssp)); in mxs_mmc_adtc()
427 writel(val, ssp->base + HW_SSP_TIMING(ssp)); in mxs_mmc_adtc()
430 ssp->ssp_pio_words[0] = ctrl0; in mxs_mmc_adtc()
431 ssp->ssp_pio_words[1] = cmd0; in mxs_mmc_adtc()
432 ssp->ssp_pio_words[2] = cmd1; in mxs_mmc_adtc()
433 ssp->dma_dir = DMA_NONE; in mxs_mmc_adtc()
434 ssp->slave_dirn = DMA_TRANS_NONE; in mxs_mmc_adtc()
442 ssp->dma_dir = dma_data_dir; in mxs_mmc_adtc()
443 ssp->slave_dirn = slave_dirn; in mxs_mmc_adtc()
449 dma_async_issue_pending(ssp->dmach); in mxs_mmc_adtc()
506 mxs_ssp_set_clk_rate(&host->ssp, ios->clock); in mxs_mmc_set_ios()
512 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_enable_sdio_irq() local
521 ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET); in mxs_mmc_enable_sdio_irq()
523 ssp->base + HW_SSP_CTRL1(ssp) + STMP_OFFSET_REG_SET); in mxs_mmc_enable_sdio_irq()
526 ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_CLR); in mxs_mmc_enable_sdio_irq()
528 ssp->base + HW_SSP_CTRL1(ssp) + STMP_OFFSET_REG_CLR); in mxs_mmc_enable_sdio_irq()
533 if (enable && readl(ssp->base + HW_SSP_STATUS(ssp)) & in mxs_mmc_enable_sdio_irq()
566 struct mxs_ssp *ssp; in mxs_mmc_probe() local
577 ssp = &host->ssp; in mxs_mmc_probe()
578 ssp->dev = &pdev->dev; in mxs_mmc_probe()
579 ssp->base = devm_platform_ioremap_resource(pdev, 0); in mxs_mmc_probe()
580 if (IS_ERR(ssp->base)) { in mxs_mmc_probe()
581 ret = PTR_ERR(ssp->base); in mxs_mmc_probe()
585 ssp->devid = (enum mxs_ssp_id)of_device_get_match_data(&pdev->dev); in mxs_mmc_probe()
605 ssp->clk = devm_clk_get(&pdev->dev, NULL); in mxs_mmc_probe()
606 if (IS_ERR(ssp->clk)) { in mxs_mmc_probe()
607 ret = PTR_ERR(ssp->clk); in mxs_mmc_probe()
610 ret = clk_prepare_enable(ssp->clk); in mxs_mmc_probe()
620 ssp->dmach = dma_request_chan(&pdev->dev, "rx-tx"); in mxs_mmc_probe()
621 if (IS_ERR(ssp->dmach)) { in mxs_mmc_probe()
624 ret = PTR_ERR(ssp->dmach); in mxs_mmc_probe()
646 mmc->max_blk_count = (ssp_is_old(ssp)) ? 0xff : 0xffffff; in mxs_mmc_probe()
647 mmc->max_req_size = (ssp_is_old(ssp)) ? 0xffff : 0xffffffff; in mxs_mmc_probe()
648 mmc->max_seg_size = dma_get_max_seg_size(ssp->dmach->device->dev); in mxs_mmc_probe()
668 dma_release_channel(ssp->dmach); in mxs_mmc_probe()
670 clk_disable_unprepare(ssp->clk); in mxs_mmc_probe()
680 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_remove() local
684 if (ssp->dmach) in mxs_mmc_remove()
685 dma_release_channel(ssp->dmach); in mxs_mmc_remove()
687 clk_disable_unprepare(ssp->clk); in mxs_mmc_remove()
697 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_suspend() local
699 clk_disable_unprepare(ssp->clk); in mxs_mmc_suspend()
707 struct mxs_ssp *ssp = &host->ssp; in mxs_mmc_resume() local
709 return clk_prepare_enable(ssp->clk); in mxs_mmc_resume()