Lines Matching full:spdif
18 #include "spdif.h"
71 * @pclk: The peri-clock pointer for spdif master operation.
105 static void spdif_snd_txctrl(struct samsung_spdif_info *spdif, int on) in spdif_snd_txctrl() argument
107 void __iomem *regs = spdif->regs; in spdif_snd_txctrl()
110 dev_dbg(spdif->dev, "Entered %s\n", __func__); in spdif_snd_txctrl()
122 struct samsung_spdif_info *spdif = to_info(cpu_dai); in spdif_set_sysclk() local
125 dev_dbg(spdif->dev, "Entered %s\n", __func__); in spdif_set_sysclk()
127 clkcon = readl(spdif->regs + CLKCON); in spdif_set_sysclk()
134 writel(clkcon, spdif->regs + CLKCON); in spdif_set_sysclk()
136 spdif->clk_rate = freq; in spdif_set_sysclk()
145 struct samsung_spdif_info *spdif = to_info(snd_soc_rtd_to_cpu(rtd, 0)); in spdif_trigger() local
148 dev_dbg(spdif->dev, "Entered %s\n", __func__); in spdif_trigger()
154 spin_lock_irqsave(&spdif->lock, flags); in spdif_trigger()
155 spdif_snd_txctrl(spdif, 1); in spdif_trigger()
156 spin_unlock_irqrestore(&spdif->lock, flags); in spdif_trigger()
161 spin_lock_irqsave(&spdif->lock, flags); in spdif_trigger()
162 spdif_snd_txctrl(spdif, 0); in spdif_trigger()
163 spin_unlock_irqrestore(&spdif->lock, flags); in spdif_trigger()
181 struct samsung_spdif_info *spdif = to_info(snd_soc_rtd_to_cpu(rtd, 0)); in spdif_hw_params() local
182 void __iomem *regs = spdif->regs; in spdif_hw_params()
188 dev_dbg(spdif->dev, "Entered %s\n", __func__); in spdif_hw_params()
191 dma_data = spdif->dma_playback; in spdif_hw_params()
193 dev_err(spdif->dev, "Capture is not supported\n"); in spdif_hw_params()
199 spin_lock_irqsave(&spdif->lock, flags); in spdif_hw_params()
216 dev_err(spdif->dev, "Unsupported data size.\n"); in spdif_hw_params()
220 ratio = spdif->clk_rate / params_rate(params); in spdif_hw_params()
225 dev_err(spdif->dev, "Invalid clock ratio %ld/%d\n", in spdif_hw_params()
226 spdif->clk_rate, params_rate(params)); in spdif_hw_params()
258 dev_err(spdif->dev, "Invalid sampling rate %d\n", in spdif_hw_params()
271 spin_unlock_irqrestore(&spdif->lock, flags); in spdif_hw_params()
275 spin_unlock_irqrestore(&spdif->lock, flags); in spdif_hw_params()
283 struct samsung_spdif_info *spdif = to_info(snd_soc_rtd_to_cpu(rtd, 0)); in spdif_shutdown() local
284 void __iomem *regs = spdif->regs; in spdif_shutdown()
287 dev_dbg(spdif->dev, "Entered %s\n", __func__); in spdif_shutdown()
301 struct samsung_spdif_info *spdif = component_to_info(component); in spdif_suspend() local
302 u32 con = spdif->saved_con; in spdif_suspend()
304 dev_dbg(spdif->dev, "Entered %s\n", __func__); in spdif_suspend()
306 spdif->saved_clkcon = readl(spdif->regs + CLKCON) & CLKCTL_MASK; in spdif_suspend()
307 spdif->saved_con = readl(spdif->regs + CON) & CON_MASK; in spdif_suspend()
308 spdif->saved_cstas = readl(spdif->regs + CSTAS) & CSTAS_MASK; in spdif_suspend()
310 writel(con | CON_SW_RESET, spdif->regs + CON); in spdif_suspend()
318 struct samsung_spdif_info *spdif = component_to_info(component); in spdif_resume() local
320 dev_dbg(spdif->dev, "Entered %s\n", __func__); in spdif_resume()
322 writel(spdif->saved_clkcon, spdif->regs + CLKCON); in spdif_resume()
323 writel(spdif->saved_con, spdif->regs + CON); in spdif_resume()
324 writel(spdif->saved_cstas, spdif->regs + CSTAS); in spdif_resume()
341 .name = "samsung-spdif",
355 .name = "samsung-spdif",
365 struct samsung_spdif_info *spdif; in spdif_probe() local
385 spdif = &spdif_info; in spdif_probe()
386 spdif->dev = &pdev->dev; in spdif_probe()
388 spin_lock_init(&spdif->lock); in spdif_probe()
390 spdif->pclk = devm_clk_get(&pdev->dev, "spdif"); in spdif_probe()
391 if (IS_ERR(spdif->pclk)) { in spdif_probe()
396 ret = clk_prepare_enable(spdif->pclk); in spdif_probe()
400 spdif->sclk = devm_clk_get(&pdev->dev, "sclk_spdif"); in spdif_probe()
401 if (IS_ERR(spdif->sclk)) { in spdif_probe()
406 ret = clk_prepare_enable(spdif->sclk); in spdif_probe()
412 resource_size(mem_res), "samsung-spdif")) { in spdif_probe()
418 spdif->regs = ioremap(mem_res->start, 0x100); in spdif_probe()
419 if (spdif->regs == NULL) { in spdif_probe()
432 spdif->dma_playback = &spdif_stereo_out; in spdif_probe()
441 dev_set_drvdata(&pdev->dev, spdif); in spdif_probe()
452 iounmap(spdif->regs); in spdif_probe()
456 clk_disable_unprepare(spdif->sclk); in spdif_probe()
458 clk_disable_unprepare(spdif->pclk); in spdif_probe()
465 struct samsung_spdif_info *spdif = &spdif_info; in spdif_remove() local
468 iounmap(spdif->regs); in spdif_remove()
473 clk_disable_unprepare(spdif->sclk); in spdif_remove()
474 clk_disable_unprepare(spdif->pclk); in spdif_remove()
481 .name = "samsung-spdif",
490 MODULE_ALIAS("platform:samsung-spdif");