Lines Matching full:spdif
3 * tegra20_spdif.c - Tegra20 SPDIF driver
30 struct tegra20_spdif *spdif = dev_get_drvdata(dev); in tegra20_spdif_runtime_suspend() local
32 regcache_cache_only(spdif->regmap, true); in tegra20_spdif_runtime_suspend()
34 clk_disable_unprepare(spdif->clk_spdif_out); in tegra20_spdif_runtime_suspend()
41 struct tegra20_spdif *spdif = dev_get_drvdata(dev); in tegra20_spdif_runtime_resume() local
44 ret = reset_control_assert(spdif->reset); in tegra20_spdif_runtime_resume()
48 ret = clk_prepare_enable(spdif->clk_spdif_out); in tegra20_spdif_runtime_resume()
56 ret = reset_control_deassert(spdif->reset); in tegra20_spdif_runtime_resume()
60 regcache_cache_only(spdif->regmap, false); in tegra20_spdif_runtime_resume()
61 regcache_mark_dirty(spdif->regmap); in tegra20_spdif_runtime_resume()
63 ret = regcache_sync(spdif->regmap); in tegra20_spdif_runtime_resume()
70 clk_disable_unprepare(spdif->clk_spdif_out); in tegra20_spdif_runtime_resume()
79 struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); in tegra20_spdif_hw_params() local
95 regmap_update_bits(spdif->regmap, TEGRA20_SPDIF_CTRL, mask, val); in tegra20_spdif_hw_params()
101 regmap_update_bits(spdif->regmap, TEGRA20_SPDIF_DATA_FIFO_CSR, in tegra20_spdif_hw_params()
131 ret = clk_set_rate(spdif->clk_spdif_out, spdifclock); in tegra20_spdif_hw_params()
133 dev_err(dai->dev, "Can't set SPDIF clock rate: %d\n", ret); in tegra20_spdif_hw_params()
137 rate = clk_get_rate(spdif->clk_spdif_out); in tegra20_spdif_hw_params()
140 "SPDIF clock rate %d doesn't match requested rate %lu\n", in tegra20_spdif_hw_params()
146 static void tegra20_spdif_start_playback(struct tegra20_spdif *spdif) in tegra20_spdif_start_playback() argument
148 regmap_update_bits(spdif->regmap, TEGRA20_SPDIF_CTRL, in tegra20_spdif_start_playback()
153 static void tegra20_spdif_stop_playback(struct tegra20_spdif *spdif) in tegra20_spdif_stop_playback() argument
155 regmap_update_bits(spdif->regmap, TEGRA20_SPDIF_CTRL, in tegra20_spdif_stop_playback()
162 struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); in tegra20_spdif_trigger() local
168 tegra20_spdif_start_playback(spdif); in tegra20_spdif_trigger()
173 tegra20_spdif_stop_playback(spdif); in tegra20_spdif_trigger()
187 struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); in tegra20_spdif_filter_rates() local
188 struct clk *parent = clk_get_parent(spdif->clk_spdif_out); in tegra20_spdif_filter_rates()
220 * SPDIF and I2S share audio PLL. HDMI takes audio packets from SPDIF in tegra20_spdif_startup()
224 * don't match PLL rate at the start of stream to allow both SPDIF in tegra20_spdif_startup()
236 struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); in tegra20_spdif_probe() local
238 snd_soc_dai_init_dma_data(dai, &spdif->playback_dma_data, NULL); in tegra20_spdif_probe()
251 .name = "tegra20-spdif",
264 .name = "tegra20-spdif",
345 struct tegra20_spdif *spdif; in tegra20_spdif_platform_probe() local
350 spdif = devm_kzalloc(&pdev->dev, sizeof(struct tegra20_spdif), in tegra20_spdif_platform_probe()
352 if (!spdif) in tegra20_spdif_platform_probe()
355 dev_set_drvdata(&pdev->dev, spdif); in tegra20_spdif_platform_probe()
357 spdif->reset = devm_reset_control_get_exclusive(&pdev->dev, NULL); in tegra20_spdif_platform_probe()
358 if (IS_ERR(spdif->reset)) { in tegra20_spdif_platform_probe()
359 dev_err(&pdev->dev, "Can't retrieve spdif reset\n"); in tegra20_spdif_platform_probe()
360 return PTR_ERR(spdif->reset); in tegra20_spdif_platform_probe()
363 spdif->clk_spdif_out = devm_clk_get(&pdev->dev, "out"); in tegra20_spdif_platform_probe()
364 if (IS_ERR(spdif->clk_spdif_out)) { in tegra20_spdif_platform_probe()
365 dev_err(&pdev->dev, "Could not retrieve spdif clock\n"); in tegra20_spdif_platform_probe()
366 return PTR_ERR(spdif->clk_spdif_out); in tegra20_spdif_platform_probe()
373 spdif->regmap = devm_regmap_init_mmio(&pdev->dev, regs, in tegra20_spdif_platform_probe()
375 if (IS_ERR(spdif->regmap)) { in tegra20_spdif_platform_probe()
377 return PTR_ERR(spdif->regmap); in tegra20_spdif_platform_probe()
380 spdif->playback_dma_data.addr = mem->start + TEGRA20_SPDIF_DATA_OUT; in tegra20_spdif_platform_probe()
381 spdif->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; in tegra20_spdif_platform_probe()
382 spdif->playback_dma_data.maxburst = 4; in tegra20_spdif_platform_probe()
413 { .compatible = "nvidia,tegra20-spdif", },
420 .name = "tegra20-spdif",
429 MODULE_DESCRIPTION("Tegra20 SPDIF ASoC driver");