summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_spdif.c
diff options
context:
space:
mode:
authorViorel Suman <viorel.suman@nxp.com>2018-08-23 13:18:25 +0300
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:54:22 +0800
commit8e013fb268248049cc221513f6562b90882b4fc8 (patch)
treedce7832e3ad28062a92f73400d20d87ea2107e86 /sound/soc/fsl/fsl_spdif.c
parent084c2ca345337bc4a260f33b4561f5c860413381 (diff)
MLK-19154-5: ASoC: fsl_spdif: refine PLL switch handling
Allow PLL switch for playback stream only and remove PLL switch guard with regard to capture stream as the clock for capture stream is provided externally. Signed-off-by: Viorel Suman <viorel.suman@nxp.com> (cherry picked from commit c8213da5fbcd370acb4d764bef5df5981a517c11)
Diffstat (limited to 'sound/soc/fsl/fsl_spdif.c')
-rw-r--r--sound/soc/fsl/fsl_spdif.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index eedf20e03a3f..a91d785461fd 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -123,7 +123,6 @@ struct fsl_spdif_priv {
u32 regcache_srpc;
struct clk *pll8k_clk;
struct clk *pll11k_clk;
- u8 streams;
};
static struct fsl_spdif_soc_data fsl_spdif_vf610 = {
@@ -606,9 +605,6 @@ static int fsl_spdif_hw_params(struct snd_pcm_substream *substream,
ret = spdif_set_rx_clksrc(spdif_priv, SPDIF_DEFAULT_GAINSEL, 1);
}
- if (!ret)
- spdif_priv->streams |= BIT(substream->stream);
-
return ret;
}
@@ -642,17 +638,6 @@ static int fsl_spdif_trigger(struct snd_pcm_substream *substream,
return 0;
}
-static int fsl_spdif_hw_free(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
- struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(rtd->cpu_dai);
-
- spdif_priv->streams &= ~BIT(substream->stream);
-
- return 0;
-}
-
static u32 fsl_spdif_txclk_caldiv(struct fsl_spdif_priv *spdif_priv,
struct clk *clk, u64 savesub,
enum spdif_txrate index, bool round)
@@ -793,18 +778,11 @@ static int fsl_spdif_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
if (pll) {
npll = (do_div(ratio, 8000) ? data->pll11k_clk : data->pll8k_clk);
if (!clk_is_match(pll, npll)) {
- if (!data->streams) {
- ret = clk_set_parent(p, npll);
- if (ret < 0)
- dev_warn(cpu_dai->dev,
- "failed to set parent %s: %d\n",
- __clk_get_name(npll), ret);
- } else {
- dev_err(cpu_dai->dev,
- "PLL %s is in use by a running stream.\n",
- __clk_get_name(pll));
- return -EINVAL;
- }
+ ret = clk_set_parent(p, npll);
+ if (ret < 0)
+ dev_warn(cpu_dai->dev,
+ "failed to set parent %s: %d\n",
+ __clk_get_name(npll), ret);
}
}
@@ -830,7 +808,6 @@ static const struct snd_soc_dai_ops fsl_spdif_dai_ops = {
.hw_params = fsl_spdif_hw_params,
.trigger = fsl_spdif_trigger,
.shutdown = fsl_spdif_shutdown,
- .hw_free = fsl_spdif_hw_free,
};
/*