Lines Matching refs:ssp
39 struct ssp_device *ssp; member
53 static void dump_registers(struct ssp_device *ssp) in dump_registers() argument
55 dev_dbg(ssp->dev, "SSCR0 0x%08x SSCR1 0x%08x SSTO 0x%08x\n", in dump_registers()
56 pxa_ssp_read_reg(ssp, SSCR0), pxa_ssp_read_reg(ssp, SSCR1), in dump_registers()
57 pxa_ssp_read_reg(ssp, SSTO)); in dump_registers()
59 dev_dbg(ssp->dev, "SSPSP 0x%08x SSSR 0x%08x SSACD 0x%08x\n", in dump_registers()
60 pxa_ssp_read_reg(ssp, SSPSP), pxa_ssp_read_reg(ssp, SSSR), in dump_registers()
61 pxa_ssp_read_reg(ssp, SSACD)); in dump_registers()
64 static void pxa_ssp_set_dma_params(struct ssp_device *ssp, int width4, in pxa_ssp_set_dma_params() argument
70 dma->addr = ssp->phys_base + SSDR; in pxa_ssp_set_dma_params()
77 struct ssp_device *ssp = priv->ssp; in pxa_ssp_startup() local
82 clk_prepare_enable(ssp->clk); in pxa_ssp_startup()
83 pxa_ssp_disable(ssp); in pxa_ssp_startup()
103 struct ssp_device *ssp = priv->ssp; in pxa_ssp_shutdown() local
106 pxa_ssp_disable(ssp); in pxa_ssp_shutdown()
107 clk_disable_unprepare(ssp->clk); in pxa_ssp_shutdown()
121 struct ssp_device *ssp = priv->ssp; in pxa_ssp_suspend() local
124 clk_prepare_enable(ssp->clk); in pxa_ssp_suspend()
126 priv->cr0 = __raw_readl(ssp->mmio_base + SSCR0); in pxa_ssp_suspend()
127 priv->cr1 = __raw_readl(ssp->mmio_base + SSCR1); in pxa_ssp_suspend()
128 priv->to = __raw_readl(ssp->mmio_base + SSTO); in pxa_ssp_suspend()
129 priv->psp = __raw_readl(ssp->mmio_base + SSPSP); in pxa_ssp_suspend()
131 pxa_ssp_disable(ssp); in pxa_ssp_suspend()
132 clk_disable_unprepare(ssp->clk); in pxa_ssp_suspend()
139 struct ssp_device *ssp = priv->ssp; in pxa_ssp_resume() local
142 clk_prepare_enable(ssp->clk); in pxa_ssp_resume()
144 __raw_writel(sssr, ssp->mmio_base + SSSR); in pxa_ssp_resume()
145 __raw_writel(priv->cr0 & ~SSCR0_SSE, ssp->mmio_base + SSCR0); in pxa_ssp_resume()
146 __raw_writel(priv->cr1, ssp->mmio_base + SSCR1); in pxa_ssp_resume()
147 __raw_writel(priv->to, ssp->mmio_base + SSTO); in pxa_ssp_resume()
148 __raw_writel(priv->psp, ssp->mmio_base + SSPSP); in pxa_ssp_resume()
151 pxa_ssp_enable(ssp); in pxa_ssp_resume()
153 clk_disable_unprepare(ssp->clk); in pxa_ssp_resume()
167 static void pxa_ssp_set_scr(struct ssp_device *ssp, u32 div) in pxa_ssp_set_scr() argument
169 u32 sscr0 = pxa_ssp_read_reg(ssp, SSCR0); in pxa_ssp_set_scr()
171 if (ssp->type == PXA25x_SSP) { in pxa_ssp_set_scr()
178 pxa_ssp_write_reg(ssp, SSCR0, sscr0); in pxa_ssp_set_scr()
188 struct ssp_device *ssp = priv->ssp; in pxa_ssp_set_dai_sysclk() local
190 u32 sscr0 = pxa_ssp_read_reg(ssp, SSCR0) & in pxa_ssp_set_dai_sysclk()
208 dev_dbg(ssp->dev, in pxa_ssp_set_dai_sysclk()
218 if (ssp->type == PXA25x_SSP) in pxa_ssp_set_dai_sysclk()
233 pxa_ssp_set_scr(ssp, 1); in pxa_ssp_set_dai_sysclk()
242 if (ssp->type != PXA3xx_SSP) in pxa_ssp_set_dai_sysclk()
243 clk_disable_unprepare(ssp->clk); in pxa_ssp_set_dai_sysclk()
244 pxa_ssp_write_reg(ssp, SSCR0, sscr0); in pxa_ssp_set_dai_sysclk()
245 if (ssp->type != PXA3xx_SSP) in pxa_ssp_set_dai_sysclk()
246 clk_prepare_enable(ssp->clk); in pxa_ssp_set_dai_sysclk()
256 struct ssp_device *ssp = priv->ssp; in pxa_ssp_set_pll() local
257 u32 ssacd = pxa_ssp_read_reg(ssp, SSACD) & ~0x70; in pxa_ssp_set_pll()
259 if (ssp->type == PXA3xx_SSP) in pxa_ssp_set_pll()
260 pxa_ssp_write_reg(ssp, SSACDD, 0); in pxa_ssp_set_pll()
288 if (ssp->type == PXA3xx_SSP) { in pxa_ssp_set_pll()
297 pxa_ssp_write_reg(ssp, SSACDD, val); in pxa_ssp_set_pll()
301 dev_dbg(ssp->dev, in pxa_ssp_set_pll()
310 pxa_ssp_write_reg(ssp, SSACD, ssacd); in pxa_ssp_set_pll()
322 struct ssp_device *ssp = priv->ssp; in pxa_ssp_set_dai_tdm_slot() local
325 sscr0 = pxa_ssp_read_reg(ssp, SSCR0); in pxa_ssp_set_dai_tdm_slot()
342 pxa_ssp_write_reg(ssp, SSTSA, tx_mask); in pxa_ssp_set_dai_tdm_slot()
343 pxa_ssp_write_reg(ssp, SSRSA, rx_mask); in pxa_ssp_set_dai_tdm_slot()
345 pxa_ssp_write_reg(ssp, SSCR0, sscr0); in pxa_ssp_set_dai_tdm_slot()
357 struct ssp_device *ssp = priv->ssp; in pxa_ssp_set_dai_tristate() local
360 sscr1 = pxa_ssp_read_reg(ssp, SSCR1); in pxa_ssp_set_dai_tristate()
365 pxa_ssp_write_reg(ssp, SSCR1, sscr1); in pxa_ssp_set_dai_tristate()
417 struct ssp_device *ssp = priv->ssp; in pxa_ssp_configure_dai_fmt() local
425 sscr0 = pxa_ssp_read_reg(ssp, SSCR0) & in pxa_ssp_configure_dai_fmt()
427 sscr1 = pxa_ssp_read_reg(ssp, SSCR1) & in pxa_ssp_configure_dai_fmt()
430 sspsp = pxa_ssp_read_reg(ssp, SSPSP) & in pxa_ssp_configure_dai_fmt()
483 pxa_ssp_write_reg(ssp, SSCR0, sscr0); in pxa_ssp_configure_dai_fmt()
484 pxa_ssp_write_reg(ssp, SSCR1, sscr1); in pxa_ssp_configure_dai_fmt()
485 pxa_ssp_write_reg(ssp, SSPSP, sspsp); in pxa_ssp_configure_dai_fmt()
490 scfr = pxa_ssp_read_reg(ssp, SSCR1) | SSCR1_SCFR; in pxa_ssp_configure_dai_fmt()
491 pxa_ssp_write_reg(ssp, SSCR1, scfr); in pxa_ssp_configure_dai_fmt()
493 while (pxa_ssp_read_reg(ssp, SSSR) & SSSR_BSY) in pxa_ssp_configure_dai_fmt()
498 dump_registers(ssp); in pxa_ssp_configure_dai_fmt()
536 struct ssp_device *ssp = priv->ssp; in pxa_ssp_hw_params() local
540 int ttsa = pxa_ssp_read_reg(ssp, SSTSA) & 0xf; in pxa_ssp_hw_params()
552 pxa_ssp_set_dma_params(ssp, in pxa_ssp_hw_params()
557 if (pxa_ssp_read_reg(ssp, SSCR0) & SSCR0_SSE) in pxa_ssp_hw_params()
565 sscr0 = pxa_ssp_read_reg(ssp, SSCR0) & ~(SSCR0_DSS | SSCR0_EDSS); in pxa_ssp_hw_params()
570 if (ssp->type == PXA3xx_SSP) in pxa_ssp_hw_params()
581 pxa_ssp_write_reg(ssp, SSCR0, sscr0); in pxa_ssp_hw_params()
608 ssacd = pxa_ssp_read_reg(ssp, SSACD); in pxa_ssp_hw_params()
612 pxa_ssp_write_reg(ssp, SSACD, ssacd); in pxa_ssp_hw_params()
620 pxa_ssp_set_scr(ssp, bclk / rate); in pxa_ssp_hw_params()
625 sspsp = pxa_ssp_read_reg(ssp, SSPSP); in pxa_ssp_hw_params()
636 if (ssp->type != PXA3xx_SSP) in pxa_ssp_hw_params()
656 pxa_ssp_write_reg(ssp, SSPSP, sspsp); in pxa_ssp_hw_params()
666 dev_err(ssp->dev, "No TDM timeslot configured\n"); in pxa_ssp_hw_params()
670 dump_registers(ssp); in pxa_ssp_hw_params()
676 struct ssp_device *ssp, int value) in pxa_ssp_set_running_bit() argument
678 uint32_t sscr0 = pxa_ssp_read_reg(ssp, SSCR0); in pxa_ssp_set_running_bit()
679 uint32_t sscr1 = pxa_ssp_read_reg(ssp, SSCR1); in pxa_ssp_set_running_bit()
680 uint32_t sspsp = pxa_ssp_read_reg(ssp, SSPSP); in pxa_ssp_set_running_bit()
681 uint32_t sssr = pxa_ssp_read_reg(ssp, SSSR); in pxa_ssp_set_running_bit()
684 pxa_ssp_write_reg(ssp, SSCR0, sscr0 & ~SSCR0_SSE); in pxa_ssp_set_running_bit()
698 pxa_ssp_write_reg(ssp, SSCR1, sscr1); in pxa_ssp_set_running_bit()
701 pxa_ssp_write_reg(ssp, SSSR, sssr); in pxa_ssp_set_running_bit()
702 pxa_ssp_write_reg(ssp, SSPSP, sspsp); in pxa_ssp_set_running_bit()
703 pxa_ssp_write_reg(ssp, SSCR0, sscr0 | SSCR0_SSE); in pxa_ssp_set_running_bit()
712 struct ssp_device *ssp = priv->ssp; in pxa_ssp_trigger() local
717 pxa_ssp_enable(ssp); in pxa_ssp_trigger()
720 pxa_ssp_set_running_bit(substream, ssp, 1); in pxa_ssp_trigger()
721 val = pxa_ssp_read_reg(ssp, SSSR); in pxa_ssp_trigger()
722 pxa_ssp_write_reg(ssp, SSSR, val); in pxa_ssp_trigger()
725 pxa_ssp_set_running_bit(substream, ssp, 1); in pxa_ssp_trigger()
728 pxa_ssp_set_running_bit(substream, ssp, 0); in pxa_ssp_trigger()
731 pxa_ssp_disable(ssp); in pxa_ssp_trigger()
734 pxa_ssp_set_running_bit(substream, ssp, 0); in pxa_ssp_trigger()
741 dump_registers(ssp); in pxa_ssp_trigger()
766 priv->ssp = pxa_ssp_request_of(ssp_handle, "SoC audio"); in pxa_ssp_probe()
767 if (priv->ssp == NULL) { in pxa_ssp_probe()
781 priv->ssp = pxa_ssp_request(dai->id + 1, "SoC audio"); in pxa_ssp_probe()
782 if (priv->ssp == NULL) { in pxa_ssp_probe()
802 pxa_ssp_free(priv->ssp); in pxa_ssp_remove()