aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/mid-x86/sst_platform.c
diff options
context:
space:
mode:
authorHarsha Priya <priya.harsha@intel.com>2011-01-11 04:20:59 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-01-19 06:28:11 -0500
commita211701eb1e4a41bbee22d61f35dba8e55925db4 (patch)
tree9326f5a915ea4f5e395ea25fb17b02943f85da02 /sound/soc/mid-x86/sst_platform.c
parenta1926d1745114789687ac029ae8c58944b7d2256 (diff)
ASoC: sst_platform porting sst dsp driver interface as per latest in Greg's staging tree
The interface between sst platform driver and intel sst dsp driver have been changed in Greg's staging tree - next branch This patch adds the interface changes compatible with the new interface in Greg's staging tree Signed-off-by: Harsha Priya <priya.harsha@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/mid-x86/sst_platform.c')
-rw-r--r--sound/soc/mid-x86/sst_platform.c49
1 files changed, 21 insertions, 28 deletions
diff --git a/sound/soc/mid-x86/sst_platform.c b/sound/soc/mid-x86/sst_platform.c
index a4e3fa3761fa..1d1f5447b338 100644
--- a/sound/soc/mid-x86/sst_platform.c
+++ b/sound/soc/mid-x86/sst_platform.c
@@ -168,7 +168,7 @@ static int sst_platform_alloc_stream(struct snd_pcm_substream *substream)
168 pr_debug("Capture stream,Device %d\n", 168 pr_debug("Capture stream,Device %d\n",
169 substream->pcm->device); 169 substream->pcm->device);
170 } 170 }
171 ret_val = stream->sstdrv_ops->control_set(SST_SND_ALLOC, &str_params); 171 ret_val = stream->sstdrv_ops->pcm_control->open(&str_params);
172 pr_debug("SST_SND_PLAY/CAPTURE ret_val = %x\n", ret_val); 172 pr_debug("SST_SND_PLAY/CAPTURE ret_val = %x\n", ret_val);
173 if (ret_val < 0) 173 if (ret_val < 0)
174 return ret_val; 174 return ret_val;
@@ -207,8 +207,8 @@ static int sst_platform_init_stream(struct snd_pcm_substream *substream)
207 stream->stream_info.mad_substream = substream; 207 stream->stream_info.mad_substream = substream;
208 stream->stream_info.buffer_ptr = 0; 208 stream->stream_info.buffer_ptr = 0;
209 stream->stream_info.sfreq = substream->runtime->rate; 209 stream->stream_info.sfreq = substream->runtime->rate;
210 ret_val = stream->sstdrv_ops->control_set(SST_SND_STREAM_INIT, 210 ret_val = stream->sstdrv_ops->pcm_control->device_control(
211 &stream->stream_info); 211 SST_SND_STREAM_INIT, &stream->stream_info);
212 if (ret_val) 212 if (ret_val)
213 pr_err("control_set ret error %d\n", ret_val); 213 pr_err("control_set ret error %d\n", ret_val);
214 return ret_val; 214 return ret_val;
@@ -261,8 +261,7 @@ static int sst_platform_close(struct snd_pcm_substream *substream)
261 stream = substream->runtime->private_data; 261 stream = substream->runtime->private_data;
262 str_id = stream->stream_info.str_id; 262 str_id = stream->stream_info.str_id;
263 if (str_id) 263 if (str_id)
264 ret_val = stream->sstdrv_ops->control_set( 264 ret_val = stream->sstdrv_ops->pcm_control->close(str_id);
265 SST_SND_FREE, &str_id);
266 kfree(stream->sstdrv_ops); 265 kfree(stream->sstdrv_ops);
267 kfree(stream); 266 kfree(stream);
268 return ret_val; 267 return ret_val;
@@ -277,7 +276,7 @@ static int sst_platform_pcm_prepare(struct snd_pcm_substream *substream)
277 stream = substream->runtime->private_data; 276 stream = substream->runtime->private_data;
278 str_id = stream->stream_info.str_id; 277 str_id = stream->stream_info.str_id;
279 if (stream->stream_info.str_id) { 278 if (stream->stream_info.str_id) {
280 ret_val = stream->sstdrv_ops->control_set( 279 ret_val = stream->sstdrv_ops->pcm_control->device_control(
281 SST_SND_DROP, &str_id); 280 SST_SND_DROP, &str_id);
282 return ret_val; 281 return ret_val;
283 } 282 }
@@ -300,6 +299,7 @@ static int sst_platform_pcm_trigger(struct snd_pcm_substream *substream,
300{ 299{
301 int ret_val = 0, str_id; 300 int ret_val = 0, str_id;
302 struct sst_runtime_stream *stream; 301 struct sst_runtime_stream *stream;
302 int str_cmd, status;
303 303
304 pr_debug("sst_platform_pcm_trigger called\n"); 304 pr_debug("sst_platform_pcm_trigger called\n");
305 stream = substream->runtime->private_data; 305 stream = substream->runtime->private_data;
@@ -307,40 +307,33 @@ static int sst_platform_pcm_trigger(struct snd_pcm_substream *substream,
307 switch (cmd) { 307 switch (cmd) {
308 case SNDRV_PCM_TRIGGER_START: 308 case SNDRV_PCM_TRIGGER_START:
309 pr_debug("sst: Trigger Start\n"); 309 pr_debug("sst: Trigger Start\n");
310 ret_val = stream->sstdrv_ops->control_set( 310 str_cmd = SST_SND_START;
311 SST_SND_START, &str_id); 311 status = SST_PLATFORM_RUNNING;
312 if (ret_val)
313 break;
314 sst_set_stream_status(stream, SST_PLATFORM_RUNNING);
315 stream->stream_info.mad_substream = substream; 312 stream->stream_info.mad_substream = substream;
316 break; 313 break;
317 case SNDRV_PCM_TRIGGER_STOP: 314 case SNDRV_PCM_TRIGGER_STOP:
318 pr_debug("sst: in stop\n"); 315 pr_debug("sst: in stop\n");
319 ret_val = stream->sstdrv_ops->control_set( 316 str_cmd = SST_SND_DROP;
320 SST_SND_DROP, &str_id); 317 status = SST_PLATFORM_DROPPED;
321 if (ret_val)
322 break;
323 sst_set_stream_status(stream, SST_PLATFORM_DROPPED);
324 break; 318 break;
325 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 319 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
326 pr_debug("sst: in pause\n"); 320 pr_debug("sst: in pause\n");
327 ret_val = stream->sstdrv_ops->control_set( 321 str_cmd = SST_SND_PAUSE;
328 SST_SND_PAUSE, &str_id); 322 status = SST_PLATFORM_PAUSED;
329 if (ret_val)
330 break;
331 sst_set_stream_status(stream, SST_PLATFORM_PAUSED);
332 break; 323 break;
333 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 324 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
334 pr_debug("sst: in pause release\n"); 325 pr_debug("sst: in pause release\n");
335 ret_val = stream->sstdrv_ops->control_set( 326 str_cmd = SST_SND_RESUME;
336 SST_SND_RESUME, &str_id); 327 status = SST_PLATFORM_RUNNING;
337 if (ret_val)
338 break;
339 sst_set_stream_status(stream, SST_PLATFORM_RUNNING);
340 break; 328 break;
341 default: 329 default:
342 ret_val = -EINVAL; 330 return -EINVAL;
343 } 331 }
332 ret_val = stream->sstdrv_ops->pcm_control->device_control(str_cmd,
333 &str_id);
334 if (!ret_val)
335 sst_set_stream_status(stream, status);
336
344 return ret_val; 337 return ret_val;
345} 338}
346 339
@@ -357,7 +350,7 @@ static snd_pcm_uframes_t sst_platform_pcm_pointer
357 if (status == SST_PLATFORM_INIT) 350 if (status == SST_PLATFORM_INIT)
358 return 0; 351 return 0;
359 str_info = &stream->stream_info; 352 str_info = &stream->stream_info;
360 ret_val = stream->sstdrv_ops->control_set( 353 ret_val = stream->sstdrv_ops->pcm_control->device_control(
361 SST_SND_BUFFER_POINTER, str_info); 354 SST_SND_BUFFER_POINTER, str_info);
362 if (ret_val) { 355 if (ret_val) {
363 pr_err("sst: error code = %d\n", ret_val); 356 pr_err("sst: error code = %d\n", ret_val);