summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorvarun colbert <vcolbert@nvidia.com>2011-10-25 11:15:54 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:32 -0800
commit70f6d30ec32eb34bf645c3a85d4950588febe22e (patch)
tree38802da8385e11fca91f26c3343255624a9b454b /sound
parente5fa81499a1b5c53cf02a947ea3933b144c2231e (diff)
Revert "asoc: tegra: Remove HDMI-SPDIF path support"
This reverts commit 8e151ed243226aa68b1cd5a261694f48d606060f. Change-Id: Iaf3bfab33da1c979c6b6140713e5eac70b632d1f Reviewed-on: http://git-master/r/60269 Reviewed-by: Scott Peterson <speterson@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R7cd2bd07ee7a4783342fff1ccf22b8323ac10194
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra30_spdif.c20
-rw-r--r--sound/soc/tegra/tegra30_spdif.h1
2 files changed, 19 insertions, 2 deletions
diff --git a/sound/soc/tegra/tegra30_spdif.c b/sound/soc/tegra/tegra30_spdif.c
index 038127c0afb0..b934634fb5eb 100644
--- a/sound/soc/tegra/tegra30_spdif.c
+++ b/sound/soc/tegra/tegra30_spdif.c
@@ -61,12 +61,14 @@ static inline u32 tegra30_spdif_read(struct tegra30_spdif *spdif, u32 reg)
static void tegra30_spdif_enable_clocks(struct tegra30_spdif *spdif)
{
clk_enable(spdif->clk_spdif_out);
+ clk_enable(spdif->clk_hda2codec);
tegra30_ahub_enable_clocks();
}
static void tegra30_spdif_disable_clocks(struct tegra30_spdif *spdif)
{
tegra30_ahub_disable_clocks();
+ clk_disable(spdif->clk_hda2codec);
clk_disable(spdif->clk_spdif_out);
}
@@ -282,6 +284,10 @@ static int tegra30_spdif_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
+ // WAR: Apply 2x spdifclock to have proper audio (bug 838569)
+ // Should be removed once HDA is up.
+ spdifclock *= 2;
+
ret = clk_set_rate(spdif->clk_spdif_out, spdifclock);
if (ret) {
dev_err(dev, "Can't set SPDIF clock rate: %d\n", ret);
@@ -399,11 +405,18 @@ static __devinit int tegra30_spdif_platform_probe(struct platform_device *pdev)
goto err_free;
}
+ spdif->clk_hda2codec = clk_get_sys("hda2codec_2x", NULL);
+ if (IS_ERR(spdif->clk_hda2codec)) {
+ dev_err(&pdev->dev, "Can't retrieve hda2codec clock\n");
+ ret = PTR_ERR(spdif->clk_hda2codec);
+ goto err_clk_put_spdif;
+ }
+
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) {
dev_err(&pdev->dev, "No memory resource\n");
ret = -ENODEV;
- goto err_clk_put_spdif;
+ goto err_clk_put_hda;
}
memregion = request_mem_region(mem->start, resource_size(mem),
@@ -411,7 +424,7 @@ static __devinit int tegra30_spdif_platform_probe(struct platform_device *pdev)
if (!memregion) {
dev_err(&pdev->dev, "Memory region already claimed\n");
ret = -EBUSY;
- goto err_clk_put_spdif;
+ goto err_clk_put_hda;
}
spdif->regs = ioremap(mem->start, resource_size(mem));
@@ -449,6 +462,8 @@ err_unmap:
iounmap(spdif->regs);
err_release:
release_mem_region(mem->start, resource_size(mem));
+err_clk_put_hda:
+ clk_put(spdif->clk_hda2codec);
err_clk_put_spdif:
clk_put(spdif->clk_spdif_out);
err_free:
@@ -472,6 +487,7 @@ static int __devexit tegra30_spdif_platform_remove(struct platform_device *pdev)
release_mem_region(res->start, resource_size(res));
clk_put(spdif->clk_spdif_out);
+ clk_put(spdif->clk_hda2codec);
kfree(spdif);
diff --git a/sound/soc/tegra/tegra30_spdif.h b/sound/soc/tegra/tegra30_spdif.h
index c4763c31b257..ce449c5edad4 100644
--- a/sound/soc/tegra/tegra30_spdif.h
+++ b/sound/soc/tegra/tegra30_spdif.h
@@ -765,6 +765,7 @@
struct tegra30_spdif {
struct clk *clk_spdif_out;
+ struct clk *clk_hda2codec;
enum tegra30_ahub_txcif txcif;
struct tegra_pcm_dma_params playback_dma_data;
void __iomem *regs;