Lines Matching refs:ssi

64 	struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai);  in imx_ssi_set_dai_tdm_slot()  local
67 sccr = readl(ssi->base + SSI_STCCR); in imx_ssi_set_dai_tdm_slot()
70 writel(sccr, ssi->base + SSI_STCCR); in imx_ssi_set_dai_tdm_slot()
72 sccr = readl(ssi->base + SSI_SRCCR); in imx_ssi_set_dai_tdm_slot()
75 writel(sccr, ssi->base + SSI_SRCCR); in imx_ssi_set_dai_tdm_slot()
77 writel(~tx_mask, ssi->base + SSI_STMSK); in imx_ssi_set_dai_tdm_slot()
78 writel(~rx_mask, ssi->base + SSI_SRMSK); in imx_ssi_set_dai_tdm_slot()
89 struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai); in imx_ssi_set_dai_fmt() local
92 scr = readl(ssi->base + SSI_SCR) & ~(SSI_SCR_SYN | SSI_SCR_NET); in imx_ssi_set_dai_fmt()
101 if (ssi->flags & IMX_SSI_USE_I2S_SLAVE) { in imx_ssi_set_dai_fmt()
147 if (ssi->flags & IMX_SSI_NET) in imx_ssi_set_dai_fmt()
149 if (ssi->flags & IMX_SSI_SYN) in imx_ssi_set_dai_fmt()
152 writel(strcr, ssi->base + SSI_STCR); in imx_ssi_set_dai_fmt()
153 writel(strcr, ssi->base + SSI_SRCR); in imx_ssi_set_dai_fmt()
154 writel(scr, ssi->base + SSI_SCR); in imx_ssi_set_dai_fmt()
166 struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai); in imx_ssi_set_dai_sysclk() local
169 scr = readl(ssi->base + SSI_SCR); in imx_ssi_set_dai_sysclk()
182 writel(scr, ssi->base + SSI_SCR); in imx_ssi_set_dai_sysclk()
194 struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai); in imx_ssi_set_dai_clkdiv() local
197 stccr = readl(ssi->base + SSI_STCCR); in imx_ssi_set_dai_clkdiv()
198 srccr = readl(ssi->base + SSI_SRCCR); in imx_ssi_set_dai_clkdiv()
229 writel(stccr, ssi->base + SSI_STCCR); in imx_ssi_set_dai_clkdiv()
230 writel(srccr, ssi->base + SSI_SRCCR); in imx_ssi_set_dai_clkdiv()
243 struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai); in imx_ssi_hw_params() local
252 if (ssi->flags & IMX_SSI_SYN) in imx_ssi_hw_params()
255 sccr = readl(ssi->base + reg) & ~SSI_STCCR_WL_MASK; in imx_ssi_hw_params()
270 writel(sccr, ssi->base + reg); in imx_ssi_hw_params()
278 struct imx_ssi *ssi = snd_soc_dai_get_drvdata(dai); in imx_ssi_trigger() local
282 scr = readl(ssi->base + SSI_SCR); in imx_ssi_trigger()
283 sier = readl(ssi->base + SSI_SIER); in imx_ssi_trigger()
286 if (ssi->flags & IMX_SSI_DMA) in imx_ssi_trigger()
291 if (ssi->flags & IMX_SSI_DMA) in imx_ssi_trigger()
328 if (!(ssi->flags & IMX_SSI_USE_AC97)) in imx_ssi_trigger()
330 writel(scr, ssi->base + SSI_SCR); in imx_ssi_trigger()
332 writel(sier, ssi->base + SSI_SIER); in imx_ssi_trigger()
348 struct imx_ssi *ssi = dev_get_drvdata(dai->dev); in imx_ssi_dai_probe() local
351 snd_soc_dai_set_drvdata(dai, ssi); in imx_ssi_dai_probe()
353 val = SSI_SFCSR_TFWM0(ssi->dma_params_tx.maxburst) | in imx_ssi_dai_probe()
354 SSI_SFCSR_RFWM0(ssi->dma_params_rx.maxburst); in imx_ssi_dai_probe()
355 writel(val, ssi->base + SSI_SFCSR); in imx_ssi_dai_probe()
358 dai->playback_dma_data = &ssi->dma_params_tx; in imx_ssi_dai_probe()
359 dai->capture_dma_data = &ssi->dma_params_rx; in imx_ssi_dai_probe()
513 struct imx_ssi *ssi; in imx_ssi_probe() local
518 ssi = devm_kzalloc(&pdev->dev, sizeof(*ssi), GFP_KERNEL); in imx_ssi_probe()
519 if (!ssi) in imx_ssi_probe()
521 dev_set_drvdata(&pdev->dev, ssi); in imx_ssi_probe()
524 ssi->ac97_reset = pdata->ac97_reset; in imx_ssi_probe()
525 ssi->ac97_warm_reset = pdata->ac97_warm_reset; in imx_ssi_probe()
526 ssi->flags = pdata->flags; in imx_ssi_probe()
529 ssi->irq = platform_get_irq(pdev, 0); in imx_ssi_probe()
530 if (ssi->irq < 0) { in imx_ssi_probe()
531 dev_err(&pdev->dev, "Failed to get IRQ: %d\n", ssi->irq); in imx_ssi_probe()
532 return ssi->irq; in imx_ssi_probe()
535 ssi->clk = devm_clk_get(&pdev->dev, NULL); in imx_ssi_probe()
536 if (IS_ERR(ssi->clk)) { in imx_ssi_probe()
537 ret = PTR_ERR(ssi->clk); in imx_ssi_probe()
542 ret = clk_prepare_enable(ssi->clk); in imx_ssi_probe()
547 ssi->base = devm_ioremap_resource(&pdev->dev, res); in imx_ssi_probe()
548 if (IS_ERR(ssi->base)) { in imx_ssi_probe()
549 ret = PTR_ERR(ssi->base); in imx_ssi_probe()
553 if (ssi->flags & IMX_SSI_USE_AC97) { in imx_ssi_probe()
559 ac97_ssi = ssi; in imx_ssi_probe()
560 setup_channel_to_ac97(ssi); in imx_ssi_probe()
565 writel(0x0, ssi->base + SSI_SIER); in imx_ssi_probe()
567 ssi->dma_params_rx.addr = res->start + SSI_SRX0; in imx_ssi_probe()
568 ssi->dma_params_tx.addr = res->start + SSI_STX0; in imx_ssi_probe()
570 ssi->dma_params_tx.maxburst = 6; in imx_ssi_probe()
571 ssi->dma_params_rx.maxburst = 4; in imx_ssi_probe()
573 ssi->dma_params_tx.filter_data = &ssi->filter_data_tx; in imx_ssi_probe()
574 ssi->dma_params_rx.filter_data = &ssi->filter_data_rx; in imx_ssi_probe()
578 imx_pcm_dma_params_init_data(&ssi->filter_data_tx, res->start, in imx_ssi_probe()
584 imx_pcm_dma_params_init_data(&ssi->filter_data_rx, res->start, in imx_ssi_probe()
588 platform_set_drvdata(pdev, ssi); in imx_ssi_probe()
603 ssi->fiq_params.irq = ssi->irq; in imx_ssi_probe()
604 ssi->fiq_params.base = ssi->base; in imx_ssi_probe()
605 ssi->fiq_params.dma_params_rx = &ssi->dma_params_rx; in imx_ssi_probe()
606 ssi->fiq_params.dma_params_tx = &ssi->dma_params_tx; in imx_ssi_probe()
608 ssi->fiq_init = imx_pcm_fiq_init(pdev, &ssi->fiq_params); in imx_ssi_probe()
609 ssi->dma_init = imx_pcm_dma_init(pdev, IMX_SSI_DMABUF_SIZE); in imx_ssi_probe()
611 if (ssi->fiq_init && ssi->dma_init) { in imx_ssi_probe()
612 ret = ssi->fiq_init; in imx_ssi_probe()
621 clk_disable_unprepare(ssi->clk); in imx_ssi_probe()
630 struct imx_ssi *ssi = platform_get_drvdata(pdev); in imx_ssi_remove() local
632 if (!ssi->fiq_init) in imx_ssi_remove()
637 if (ssi->flags & IMX_SSI_USE_AC97) in imx_ssi_remove()
640 clk_disable_unprepare(ssi->clk); in imx_ssi_remove()