aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam Girdwood <liam.r.girdwood@linux.intel.com>2014-05-14 10:20:53 -0400
committerMark Brown <broonie@linaro.org>2014-05-14 11:57:26 -0400
commit3a46c7b7cc09ace471f9ccb4d11950fb2f7f2d96 (patch)
tree8f95dfea46f4e0b60ed127398f6a3871d794861e
parent8bee1fd482622718fcc1a537db1d7ca48d7f52f8 (diff)
ASoC: Intel: Make Baytrail PCM data per stream rather than per DAI device
Prepare for single Baytrail DAI playback/capture link by accessing PCM data using stream ID instead of rtd->dev. Now rtd->dev is unique for playback and capture since they are exported as separate DAIs but not once converted to single DAI. [Jarkko: Separated from another commit with updated commit log] Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/intel/sst-baytrail-pcm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sound/soc/intel/sst-baytrail-pcm.c b/sound/soc/intel/sst-baytrail-pcm.c
index 0afb3491f5f0..73bb68119b9e 100644
--- a/sound/soc/intel/sst-baytrail-pcm.c
+++ b/sound/soc/intel/sst-baytrail-pcm.c
@@ -68,7 +68,7 @@ static int sst_byt_pcm_hw_params(struct snd_pcm_substream *substream,
68 struct snd_soc_pcm_runtime *rtd = substream->private_data; 68 struct snd_soc_pcm_runtime *rtd = substream->private_data;
69 struct sst_byt_priv_data *pdata = 69 struct sst_byt_priv_data *pdata =
70 snd_soc_platform_get_drvdata(rtd->platform); 70 snd_soc_platform_get_drvdata(rtd->platform);
71 struct sst_byt_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(rtd); 71 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
72 struct sst_byt *byt = pdata->byt; 72 struct sst_byt *byt = pdata->byt;
73 u32 rate, bits; 73 u32 rate, bits;
74 u8 channels; 74 u8 channels;
@@ -140,7 +140,7 @@ static int sst_byt_pcm_restore_stream_context(struct snd_pcm_substream *substrea
140 struct snd_soc_pcm_runtime *rtd = substream->private_data; 140 struct snd_soc_pcm_runtime *rtd = substream->private_data;
141 struct sst_byt_priv_data *pdata = 141 struct sst_byt_priv_data *pdata =
142 snd_soc_platform_get_drvdata(rtd->platform); 142 snd_soc_platform_get_drvdata(rtd->platform);
143 struct sst_byt_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(rtd); 143 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
144 struct sst_byt *byt = pdata->byt; 144 struct sst_byt *byt = pdata->byt;
145 int ret; 145 int ret;
146 146
@@ -172,7 +172,7 @@ static int sst_byt_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
172 struct snd_soc_pcm_runtime *rtd = substream->private_data; 172 struct snd_soc_pcm_runtime *rtd = substream->private_data;
173 struct sst_byt_priv_data *pdata = 173 struct sst_byt_priv_data *pdata =
174 snd_soc_platform_get_drvdata(rtd->platform); 174 snd_soc_platform_get_drvdata(rtd->platform);
175 struct sst_byt_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(rtd); 175 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
176 struct sst_byt *byt = pdata->byt; 176 struct sst_byt *byt = pdata->byt;
177 177
178 dev_dbg(rtd->dev, "PCM: trigger %d\n", cmd); 178 dev_dbg(rtd->dev, "PCM: trigger %d\n", cmd);
@@ -229,7 +229,9 @@ static snd_pcm_uframes_t sst_byt_pcm_pointer(struct snd_pcm_substream *substream
229{ 229{
230 struct snd_soc_pcm_runtime *rtd = substream->private_data; 230 struct snd_soc_pcm_runtime *rtd = substream->private_data;
231 struct snd_pcm_runtime *runtime = substream->runtime; 231 struct snd_pcm_runtime *runtime = substream->runtime;
232 struct sst_byt_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(rtd); 232 struct sst_byt_priv_data *pdata =
233 snd_soc_platform_get_drvdata(rtd->platform);
234 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
233 235
234 dev_dbg(rtd->dev, "PCM: DMA pointer %u bytes\n", pcm_data->hw_ptr); 236 dev_dbg(rtd->dev, "PCM: DMA pointer %u bytes\n", pcm_data->hw_ptr);
235 237
@@ -241,15 +243,13 @@ static int sst_byt_pcm_open(struct snd_pcm_substream *substream)
241 struct snd_soc_pcm_runtime *rtd = substream->private_data; 243 struct snd_soc_pcm_runtime *rtd = substream->private_data;
242 struct sst_byt_priv_data *pdata = 244 struct sst_byt_priv_data *pdata =
243 snd_soc_platform_get_drvdata(rtd->platform); 245 snd_soc_platform_get_drvdata(rtd->platform);
244 struct sst_byt_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(rtd); 246 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
245 struct sst_byt *byt = pdata->byt; 247 struct sst_byt *byt = pdata->byt;
246 248
247 dev_dbg(rtd->dev, "PCM: open\n"); 249 dev_dbg(rtd->dev, "PCM: open\n");
248 250
249 pcm_data = &pdata->pcm[rtd->cpu_dai->id];
250 mutex_lock(&pcm_data->mutex); 251 mutex_lock(&pcm_data->mutex);
251 252
252 snd_soc_pcm_set_drvdata(rtd, pcm_data);
253 pcm_data->substream = substream; 253 pcm_data->substream = substream;
254 254
255 snd_soc_set_runtime_hwparams(substream, &sst_byt_pcm_hardware); 255 snd_soc_set_runtime_hwparams(substream, &sst_byt_pcm_hardware);
@@ -271,7 +271,7 @@ static int sst_byt_pcm_close(struct snd_pcm_substream *substream)
271 struct snd_soc_pcm_runtime *rtd = substream->private_data; 271 struct snd_soc_pcm_runtime *rtd = substream->private_data;
272 struct sst_byt_priv_data *pdata = 272 struct sst_byt_priv_data *pdata =
273 snd_soc_platform_get_drvdata(rtd->platform); 273 snd_soc_platform_get_drvdata(rtd->platform);
274 struct sst_byt_pcm_data *pcm_data = snd_soc_pcm_get_drvdata(rtd); 274 struct sst_byt_pcm_data *pcm_data = &pdata->pcm[substream->stream];
275 struct sst_byt *byt = pdata->byt; 275 struct sst_byt *byt = pdata->byt;
276 int ret; 276 int ret;
277 277