aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
authorMengdong Lin <mengdong.lin@linux.intel.com>2015-11-18 02:34:01 -0500
committerMark Brown <broonie@kernel.org>2015-11-18 13:32:24 -0500
commit5015920a1732cabd1178cfe342f09ee3488a1791 (patch)
tree50f1858d48c2a5e4a86e817c595c38213bfe0c47 /sound/soc/fsl
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
ASoC: Vendor drivers get a link's runtime by snd_soc_get_pcm_runtime()
Vendor drivers no longer access a DAI link's runtime by the link index but by matching the link name via snd_soc_get_pcm_runtime(). We assume each DAI link has a unique name. This is preparation for changing runtimes from an array to a list later. Vendor drivers changed: sound/soc/fsl/fsl-asoc-card.c sound/soc/fsl/imx-wm8962.c sound/soc/pxa/mioa701_wm9713.c sound/soc/samsung/bells.c sound/soc/samsung/littlemill.c sound/soc/samsung/odroidx2_max98090.c sound/soc/samsung/snow.c sound/soc/samsung/speyside.c sound/soc/samsung/tobermory.c sound/soc/tegra/tegra_wm8903 Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/fsl-asoc-card.c5
-rw-r--r--sound/soc/fsl/imx-wm8962.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 1b05d1c5d9fd..f4b6c53146d5 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -222,12 +222,15 @@ static int fsl_asoc_card_set_bias_level(struct snd_soc_card *card,
222 enum snd_soc_bias_level level) 222 enum snd_soc_bias_level level)
223{ 223{
224 struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(card); 224 struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(card);
225 struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; 225 struct snd_soc_pcm_runtime *rtd;
226 struct snd_soc_dai *codec_dai;
226 struct codec_priv *codec_priv = &priv->codec_priv; 227 struct codec_priv *codec_priv = &priv->codec_priv;
227 struct device *dev = card->dev; 228 struct device *dev = card->dev;
228 unsigned int pll_out; 229 unsigned int pll_out;
229 int ret; 230 int ret;
230 231
232 rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name);
233 codec_dai = rtd->codec_dai;
231 if (dapm->dev != codec_dai->dev) 234 if (dapm->dev != codec_dai->dev)
232 return 0; 235 return 0;
233 236
diff --git a/sound/soc/fsl/imx-wm8962.c b/sound/soc/fsl/imx-wm8962.c
index b38b98cae855..201a70d1027a 100644
--- a/sound/soc/fsl/imx-wm8962.c
+++ b/sound/soc/fsl/imx-wm8962.c
@@ -69,13 +69,16 @@ static int imx_wm8962_set_bias_level(struct snd_soc_card *card,
69 struct snd_soc_dapm_context *dapm, 69 struct snd_soc_dapm_context *dapm,
70 enum snd_soc_bias_level level) 70 enum snd_soc_bias_level level)
71{ 71{
72 struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; 72 struct snd_soc_pcm_runtime *rtd;
73 struct snd_soc_dai *codec_dai;
73 struct imx_priv *priv = &card_priv; 74 struct imx_priv *priv = &card_priv;
74 struct imx_wm8962_data *data = snd_soc_card_get_drvdata(card); 75 struct imx_wm8962_data *data = snd_soc_card_get_drvdata(card);
75 struct device *dev = &priv->pdev->dev; 76 struct device *dev = &priv->pdev->dev;
76 unsigned int pll_out; 77 unsigned int pll_out;
77 int ret; 78 int ret;
78 79
80 rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name);
81 codec_dai = rtd->codec_dai;
79 if (dapm->dev != codec_dai->dev) 82 if (dapm->dev != codec_dai->dev)
80 return 0; 83 return 0;
81 84
@@ -135,12 +138,15 @@ static int imx_wm8962_set_bias_level(struct snd_soc_card *card,
135 138
136static int imx_wm8962_late_probe(struct snd_soc_card *card) 139static int imx_wm8962_late_probe(struct snd_soc_card *card)
137{ 140{
138 struct snd_soc_dai *codec_dai = card->rtd[0].codec_dai; 141 struct snd_soc_pcm_runtime *rtd;
142 struct snd_soc_dai *codec_dai;
139 struct imx_priv *priv = &card_priv; 143 struct imx_priv *priv = &card_priv;
140 struct imx_wm8962_data *data = snd_soc_card_get_drvdata(card); 144 struct imx_wm8962_data *data = snd_soc_card_get_drvdata(card);
141 struct device *dev = &priv->pdev->dev; 145 struct device *dev = &priv->pdev->dev;
142 int ret; 146 int ret;
143 147
148 rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name);
149 codec_dai = rtd->codec_dai;
144 ret = snd_soc_dai_set_sysclk(codec_dai, WM8962_SYSCLK_MCLK, 150 ret = snd_soc_dai_set_sysclk(codec_dai, WM8962_SYSCLK_MCLK,
145 data->clk_frequency, SND_SOC_CLOCK_IN); 151 data->clk_frequency, SND_SOC_CLOCK_IN);
146 if (ret < 0) 152 if (ret < 0)