From c127918db23dbaeaa356071cd92d2ace05977671 Mon Sep 17 00:00:00 2001 From: Humberto Silva Naves Date: Sun, 13 Jul 2014 04:59:26 +0200 Subject: [PATCH] ASoC: exynos: Issues with the EPLL clock in daisy_max98095. --- sound/soc/samsung/daisy_max98095.c | 40 ++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/sound/soc/samsung/daisy_max98095.c b/sound/soc/samsung/daisy_max98095.c index b15b9fd65324..2ad7ab36b0ed 100644 --- a/sound/soc/samsung/daisy_max98095.c +++ b/sound/soc/samsung/daisy_max98095.c @@ -54,7 +54,7 @@ static int set_audio_clock_hierarchy(struct platform_device *pdev) { struct clk *fout_epll, *sclk_epll, *mout_audio0, *sclk_audio0; - struct clk *mout_audss, *mout_i2s; + struct clk *mout_audss, *mout_i2s, *dout_srp, *dout_bus; int ret = 0; fout_epll = clk_get(&pdev->dev, "fout_epll"); @@ -101,6 +101,22 @@ static int set_audio_clock_hierarchy(struct platform_device *pdev) goto out5; } + dout_srp = clk_get(&pdev->dev, "dout_srp"); + if (IS_ERR(dout_srp)) { + printk(KERN_WARNING + "%s: Cannot find dout_srp clocks.\n", __func__); + ret = -EINVAL; + goto out6; + } + + dout_bus = clk_get(&pdev->dev, "dout_bus"); + if (IS_ERR(dout_bus)) { + printk(KERN_WARNING + "%s: Cannot find dout_bus clocks.\n", __func__); + ret = -EINVAL; + goto out7; + } + /* * fout_epll may have been initialized to operate at a frequency higher * than the audio block's maximum (192Mhz on 5250, 200Mhz on 5420), @@ -112,29 +128,29 @@ static int set_audio_clock_hierarchy(struct platform_device *pdev) ret = clk_set_rate(fout_epll, DEFAULT_EPLL_RATE); if (ret < 0) { printk(KERN_WARNING "Failed to set epll rate.\n"); - goto out6; + goto out8; } /* Set audio clock hierarchy for S/PDIF */ ret = clk_set_parent(sclk_epll, fout_epll); if (ret < 0) { printk(KERN_WARNING "Failed to set parent of epll.\n"); - goto out6; + goto out8; } ret = clk_set_parent(mout_audio0, sclk_epll); if (ret < 0) { printk(KERN_WARNING "Failed to set parent of mout audio0.\n"); - goto out6; + goto out8; } ret = clk_set_parent(mout_audss, fout_epll); if (ret < 0) { printk(KERN_WARNING "Failed to set parent of audss.\n"); - goto out6; + goto out8; } ret = clk_set_parent(mout_i2s, sclk_audio0); if (ret < 0) { printk(KERN_WARNING "Failed to set parent of mout i2s.\n"); - goto out6; + goto out8; } /* Ensure that the divider between mout_audio0 and sclk_audio0 is 1. */ @@ -143,6 +159,14 @@ static int set_audio_clock_hierarchy(struct platform_device *pdev) printk(KERN_WARNING "Failed to set audio bus rate (%d).\n", ret); + clk_set_rate(dout_srp, DEFAULT_EPLL_RATE / 2); + clk_set_rate(dout_bus, DEFAULT_EPLL_RATE / 4); + clk_set_rate(fout_epll, 200000000); + +out8: + clk_put(dout_bus); +out7: + clk_put(dout_srp); out6: clk_put(mout_i2s); out5: @@ -174,11 +198,11 @@ static int set_epll_rate(struct device *card_dev, unsigned long rate) if (rate == clk_get_rate(fout_epll)) goto out; - ret = clk_set_rate(fout_epll, rate); + /* ret = clk_set_rate(fout_epll, rate); if (ret < 0) { printk(KERN_ERR "failed to clk_set_rate of fout_epll for audio\n"); goto out; - } + } */ out: clk_put(fout_epll);