Lines Matching +full:dai +full:- +full:format

31 	u32 format;  member
52 writel(ctrl, host->io_base + SPDIF_IN_CTRL); in spdif_in_configure()
53 writel(0xF, host->io_base + SPDIF_IN_IRQ_MASK); in spdif_in_configure()
56 static int spdif_in_dai_probe(struct snd_soc_dai *dai) in spdif_in_dai_probe() argument
58 struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai); in spdif_in_dai_probe()
60 host->dma_params_rx.filter_data = &host->dma_params; in spdif_in_dai_probe()
61 dai->capture_dma_data = &host->dma_params_rx; in spdif_in_dai_probe()
67 struct snd_soc_dai *dai) in spdif_in_shutdown() argument
69 struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai); in spdif_in_shutdown()
71 if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) in spdif_in_shutdown()
74 writel(0x0, host->io_base + SPDIF_IN_IRQ_MASK); in spdif_in_shutdown()
77 static void spdif_in_format(struct spdif_in_dev *host, u32 format) in spdif_in_format() argument
79 u32 ctrl = readl(host->io_base + SPDIF_IN_CTRL); in spdif_in_format()
81 switch (format) { in spdif_in_format()
91 writel(ctrl, host->io_base + SPDIF_IN_CTRL); in spdif_in_format()
96 struct snd_soc_dai *dai) in spdif_in_hw_params() argument
98 struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai); in spdif_in_hw_params()
99 u32 format; in spdif_in_hw_params() local
101 if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) in spdif_in_hw_params()
102 return -EINVAL; in spdif_in_hw_params()
104 format = params_format(params); in spdif_in_hw_params()
105 host->saved_params.format = format; in spdif_in_hw_params()
111 struct snd_soc_dai *dai) in spdif_in_trigger() argument
113 struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai); in spdif_in_trigger()
117 if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) in spdif_in_trigger()
118 return -EINVAL; in spdif_in_trigger()
124 clk_enable(host->clk); in spdif_in_trigger()
126 spdif_in_format(host, host->saved_params.format); in spdif_in_trigger()
128 ctrl = readl(host->io_base + SPDIF_IN_CTRL); in spdif_in_trigger()
130 writel(ctrl, host->io_base + SPDIF_IN_CTRL); in spdif_in_trigger()
131 writel(0xF, host->io_base + SPDIF_IN_IRQ_MASK); in spdif_in_trigger()
137 ctrl = readl(host->io_base + SPDIF_IN_CTRL); in spdif_in_trigger()
139 writel(ctrl, host->io_base + SPDIF_IN_CTRL); in spdif_in_trigger()
140 writel(0x0, host->io_base + SPDIF_IN_IRQ_MASK); in spdif_in_trigger()
142 if (host->reset_perip) in spdif_in_trigger()
143 host->reset_perip(); in spdif_in_trigger()
144 clk_disable(host->clk); in spdif_in_trigger()
148 ret = -EINVAL; in spdif_in_trigger()
175 .name = "spdif-in",
183 u32 irq_status = readl(host->io_base + SPDIF_IN_IRQ); in spdif_in_irq()
189 dev_err(host->dev, "spdif in: fifo write error"); in spdif_in_irq()
191 dev_err(host->dev, "spdif in: empty fifo read error"); in spdif_in_irq()
193 dev_err(host->dev, "spdif in: fifo full error"); in spdif_in_irq()
195 dev_err(host->dev, "spdif in: out of range error"); in spdif_in_irq()
197 writel(0, host->io_base + SPDIF_IN_IRQ); in spdif_in_irq()
216 return -EINVAL; in spdif_in_probe()
218 host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); in spdif_in_probe()
220 return -ENOMEM; in spdif_in_probe()
222 host->io_base = io_base; in spdif_in_probe()
223 host->irq = platform_get_irq(pdev, 0); in spdif_in_probe()
224 if (host->irq < 0) { in spdif_in_probe()
225 dev_warn(&pdev->dev, "failed to get IRQ: %d\n", host->irq); in spdif_in_probe()
226 return host->irq; in spdif_in_probe()
229 host->clk = devm_clk_get(&pdev->dev, NULL); in spdif_in_probe()
230 if (IS_ERR(host->clk)) in spdif_in_probe()
231 return PTR_ERR(host->clk); in spdif_in_probe()
233 pdata = dev_get_platdata(&pdev->dev); in spdif_in_probe()
236 return -EINVAL; in spdif_in_probe()
238 host->dma_params.data = pdata->dma_params; in spdif_in_probe()
239 host->dma_params.addr = res_fifo->start; in spdif_in_probe()
240 host->dma_params.max_burst = 16; in spdif_in_probe()
241 host->dma_params.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; in spdif_in_probe()
242 host->reset_perip = pdata->reset_perip; in spdif_in_probe()
244 host->dev = &pdev->dev; in spdif_in_probe()
245 dev_set_drvdata(&pdev->dev, host); in spdif_in_probe()
247 ret = devm_request_irq(&pdev->dev, host->irq, spdif_in_irq, 0, in spdif_in_probe()
248 "spdif-in", host); in spdif_in_probe()
250 dev_warn(&pdev->dev, "request_irq failed\n"); in spdif_in_probe()
254 ret = devm_snd_soc_register_component(&pdev->dev, &spdif_in_component, in spdif_in_probe()
259 return devm_spear_pcm_platform_register(&pdev->dev, &host->config, in spdif_in_probe()
260 pdata->filter); in spdif_in_probe()
266 .name = "spdif-in",