aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/generic/simple-card.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/generic/simple-card.c')
-rw-r--r--sound/soc/generic/simple-card.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 54c33204541f..1ded8811598e 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -45,7 +45,7 @@ static int asoc_simple_card_startup(struct snd_pcm_substream *substream)
45 struct snd_soc_pcm_runtime *rtd = substream->private_data; 45 struct snd_soc_pcm_runtime *rtd = substream->private_data;
46 struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card); 46 struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
47 struct simple_dai_props *dai_props = 47 struct simple_dai_props *dai_props =
48 &priv->dai_props[rtd - rtd->card->rtd]; 48 &priv->dai_props[rtd->num];
49 int ret; 49 int ret;
50 50
51 ret = clk_prepare_enable(dai_props->cpu_dai.clk); 51 ret = clk_prepare_enable(dai_props->cpu_dai.clk);
@@ -64,7 +64,7 @@ static void asoc_simple_card_shutdown(struct snd_pcm_substream *substream)
64 struct snd_soc_pcm_runtime *rtd = substream->private_data; 64 struct snd_soc_pcm_runtime *rtd = substream->private_data;
65 struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card); 65 struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
66 struct simple_dai_props *dai_props = 66 struct simple_dai_props *dai_props =
67 &priv->dai_props[rtd - rtd->card->rtd]; 67 &priv->dai_props[rtd->num];
68 68
69 clk_disable_unprepare(dai_props->cpu_dai.clk); 69 clk_disable_unprepare(dai_props->cpu_dai.clk);
70 70
@@ -78,8 +78,7 @@ static int asoc_simple_card_hw_params(struct snd_pcm_substream *substream,
78 struct snd_soc_dai *codec_dai = rtd->codec_dai; 78 struct snd_soc_dai *codec_dai = rtd->codec_dai;
79 struct snd_soc_dai *cpu_dai = rtd->cpu_dai; 79 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
80 struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card); 80 struct simple_card_data *priv = snd_soc_card_get_drvdata(rtd->card);
81 struct simple_dai_props *dai_props = 81 struct simple_dai_props *dai_props = &priv->dai_props[rtd->num];
82 &priv->dai_props[rtd - rtd->card->rtd];
83 unsigned int mclk, mclk_fs = 0; 82 unsigned int mclk, mclk_fs = 0;
84 int ret = 0; 83 int ret = 0;
85 84
@@ -174,10 +173,9 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
174 struct snd_soc_dai *codec = rtd->codec_dai; 173 struct snd_soc_dai *codec = rtd->codec_dai;
175 struct snd_soc_dai *cpu = rtd->cpu_dai; 174 struct snd_soc_dai *cpu = rtd->cpu_dai;
176 struct simple_dai_props *dai_props; 175 struct simple_dai_props *dai_props;
177 int num, ret; 176 int ret;
178 177
179 num = rtd - rtd->card->rtd; 178 dai_props = &priv->dai_props[rtd->num];
180 dai_props = &priv->dai_props[num];
181 ret = __asoc_simple_card_dai_init(codec, &dai_props->codec_dai); 179 ret = __asoc_simple_card_dai_init(codec, &dai_props->codec_dai);
182 if (ret < 0) 180 if (ret < 0)
183 return ret; 181 return ret;