Lines Matching full:i2s

3 // ALSA Soc Audio Layer - I2S core for newer Samsung SoCs.
21 #include "regs-i2s-v2.h"
22 #include "s3c-i2s-v2.h"
61 static void s3c2412_snd_txctrl(struct s3c_i2sv2_info *i2s, int on) in s3c2412_snd_txctrl() argument
63 void __iomem *regs = i2s->regs; in s3c2412_snd_txctrl()
91 dev_err(i2s->dev, "TXEN: Invalid MODE %x in IISMOD\n", in s3c2412_snd_txctrl()
120 dev_err(i2s->dev, "TXDIS: Invalid MODE %x in IISMOD\n", in s3c2412_snd_txctrl()
134 static void s3c2412_snd_rxctrl(struct s3c_i2sv2_info *i2s, int on) in s3c2412_snd_rxctrl() argument
136 void __iomem *regs = i2s->regs; in s3c2412_snd_rxctrl()
164 dev_err(i2s->dev, "RXEN: Invalid MODE %x in IISMOD\n", in s3c2412_snd_rxctrl()
189 dev_err(i2s->dev, "RXDIS: Invalid MODE %x in IISMOD\n", in s3c2412_snd_rxctrl()
207 static int s3c2412_snd_lrsync(struct s3c_i2sv2_info *i2s) in s3c2412_snd_lrsync() argument
215 iiscon = readl(i2s->regs + S3C2412_IISCON); in s3c2412_snd_lrsync()
231 * Set S3C2412 I2S DAI format
236 struct s3c_i2sv2_info *i2s = to_info(cpu_dai); in s3c2412_i2s_set_fmt() local
241 iismod = readl(i2s->regs + S3C2412_IISMOD); in s3c2412_i2s_set_fmt()
246 i2s->master = 0; in s3c2412_i2s_set_fmt()
250 i2s->master = 1; in s3c2412_i2s_set_fmt()
278 writel(iismod, i2s->regs + S3C2412_IISMOD); in s3c2412_i2s_set_fmt()
287 struct s3c_i2sv2_info *i2s = to_info(dai); in s3c_i2sv2_hw_params() local
294 dma_data = i2s->dma_playback; in s3c_i2sv2_hw_params()
296 dma_data = i2s->dma_capture; in s3c_i2sv2_hw_params()
301 iismod = readl(i2s->regs + S3C2412_IISMOD); in s3c_i2sv2_hw_params()
317 writel(iismod, i2s->regs + S3C2412_IISMOD); in s3c_i2sv2_hw_params()
326 struct s3c_i2sv2_info *i2s = to_info(cpu_dai); in s3c_i2sv2_set_sysclk() local
327 u32 iismod = readl(i2s->regs + S3C2412_IISMOD); in s3c_i2sv2_set_sysclk()
343 if (!(i2s->feature & S3C_FEATURE_CDCLKCON)) in s3c_i2sv2_set_sysclk()
362 writel(iismod, i2s->regs + S3C2412_IISMOD); in s3c_i2sv2_set_sysclk()
372 struct s3c_i2sv2_info *i2s = to_info(asoc_rtd_to_cpu(rtd, 0)); in s3c2412_i2s_trigger() local
384 i2s->regs + S3C2412_IISFIC); in s3c2412_i2s_trigger()
387 writel(0x0, i2s->regs + S3C2412_IISFIC); in s3c2412_i2s_trigger()
393 if (!i2s->master) { in s3c2412_i2s_trigger()
394 ret = s3c2412_snd_lrsync(i2s); in s3c2412_i2s_trigger()
402 s3c2412_snd_rxctrl(i2s, 1); in s3c2412_i2s_trigger()
404 s3c2412_snd_txctrl(i2s, 1); in s3c2412_i2s_trigger()
416 s3c2412_snd_rxctrl(i2s, 0); in s3c2412_i2s_trigger()
418 s3c2412_snd_txctrl(i2s, 0); in s3c2412_i2s_trigger()
437 struct s3c_i2sv2_info *i2s = to_info(cpu_dai); in s3c2412_i2s_set_clkdiv() local
465 reg = readl(i2s->regs + S3C2412_IISMOD); in s3c2412_i2s_set_clkdiv()
467 writel(reg | div, i2s->regs + S3C2412_IISMOD); in s3c2412_i2s_set_clkdiv()
469 pr_debug("%s: MOD=%08x\n", __func__, readl(i2s->regs + S3C2412_IISMOD)); in s3c2412_i2s_set_clkdiv()
494 reg = readl(i2s->regs + S3C2412_IISMOD); in s3c2412_i2s_set_clkdiv()
496 writel(reg | div, i2s->regs + S3C2412_IISMOD); in s3c2412_i2s_set_clkdiv()
497 pr_debug("%s: MOD=%08x\n", __func__, readl(i2s->regs + S3C2412_IISMOD)); in s3c2412_i2s_set_clkdiv()
503 i2s->regs + S3C2412_IISPSR); in s3c2412_i2s_set_clkdiv()
505 writel(0x0, i2s->regs + S3C2412_IISPSR); in s3c2412_i2s_set_clkdiv()
507 pr_debug("%s: PSR=%08x\n", __func__, readl(i2s->regs + S3C2412_IISPSR)); in s3c2412_i2s_set_clkdiv()
520 struct s3c_i2sv2_info *i2s = to_info(dai); in s3c2412_i2s_delay() local
521 u32 reg = readl(i2s->regs + S3C2412_IISFIC); in s3c2412_i2s_delay()
534 struct s3c_i2sv2_info *i2s = to_info(cpu_dai); in s3c_i2sv2_get_clock() local
535 u32 iismod = readl(i2s->regs + S3C2412_IISMOD); in s3c_i2sv2_get_clock()
538 return i2s->iis_cclk; in s3c_i2sv2_get_clock()
540 return i2s->iis_pclk; in s3c_i2sv2_get_clock()
610 struct s3c_i2sv2_info *i2s) in s3c_i2sv2_probe() argument
615 i2s->dev = dev; in s3c_i2sv2_probe()
617 /* record our i2s structure for later use in the callbacks */ in s3c_i2sv2_probe()
618 snd_soc_dai_set_drvdata(dai, i2s); in s3c_i2sv2_probe()
620 i2s->iis_pclk = clk_get(dev, "iis"); in s3c_i2sv2_probe()
621 if (IS_ERR(i2s->iis_pclk)) { in s3c_i2sv2_probe()
626 clk_prepare_enable(i2s->iis_pclk); in s3c_i2sv2_probe()
630 iismod = readl(i2s->regs + S3C2412_IISMOD); in s3c_i2sv2_probe()
632 writel(iismod, i2s->regs + S3C2412_IISMOD); in s3c_i2sv2_probe()
633 s3c2412_snd_txctrl(i2s, 0); in s3c_i2sv2_probe()
634 s3c2412_snd_rxctrl(i2s, 0); in s3c_i2sv2_probe()
641 struct s3c_i2sv2_info *i2s) in s3c_i2sv2_cleanup() argument
643 clk_disable_unprepare(i2s->iis_pclk); in s3c_i2sv2_cleanup()
644 clk_put(i2s->iis_pclk); in s3c_i2sv2_cleanup()
645 i2s->iis_pclk = NULL; in s3c_i2sv2_cleanup()