diff options
-rw-r--r-- | sound/soc/intel/sst-mfld-platform-pcm.c | 21 | ||||
-rw-r--r-- | sound/soc/intel/sst-mfld-platform.h | 19 |
2 files changed, 15 insertions, 25 deletions
diff --git a/sound/soc/intel/sst-mfld-platform-pcm.c b/sound/soc/intel/sst-mfld-platform-pcm.c index 706212a6a68c..42766a51c17e 100644 --- a/sound/soc/intel/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/sst-mfld-platform-pcm.c | |||
@@ -314,8 +314,7 @@ static int sst_platform_init_stream(struct snd_pcm_substream *substream) | |||
314 | stream->stream_info.arg = substream; | 314 | stream->stream_info.arg = substream; |
315 | stream->stream_info.buffer_ptr = 0; | 315 | stream->stream_info.buffer_ptr = 0; |
316 | stream->stream_info.sfreq = substream->runtime->rate; | 316 | stream->stream_info.sfreq = substream->runtime->rate; |
317 | ret_val = stream->ops->device_control( | 317 | ret_val = stream->ops->stream_init(&stream->stream_info); |
318 | SST_SND_STREAM_INIT, &stream->stream_info); | ||
319 | if (ret_val) | 318 | if (ret_val) |
320 | pr_err("control_set ret error %d\n", ret_val); | 319 | pr_err("control_set ret error %d\n", ret_val); |
321 | return ret_val; | 320 | return ret_val; |
@@ -403,8 +402,7 @@ static int sst_media_prepare(struct snd_pcm_substream *substream, | |||
403 | stream = substream->runtime->private_data; | 402 | stream = substream->runtime->private_data; |
404 | str_id = stream->stream_info.str_id; | 403 | str_id = stream->stream_info.str_id; |
405 | if (stream->stream_info.str_id) { | 404 | if (stream->stream_info.str_id) { |
406 | ret_val = stream->ops->device_control( | 405 | ret_val = stream->ops->stream_drop(str_id); |
407 | SST_SND_DROP, &str_id); | ||
408 | return ret_val; | 406 | return ret_val; |
409 | } | 407 | } |
410 | 408 | ||
@@ -461,7 +459,7 @@ static int sst_platform_pcm_trigger(struct snd_pcm_substream *substream, | |||
461 | { | 459 | { |
462 | int ret_val = 0, str_id; | 460 | int ret_val = 0, str_id; |
463 | struct sst_runtime_stream *stream; | 461 | struct sst_runtime_stream *stream; |
464 | int str_cmd, status; | 462 | int status; |
465 | 463 | ||
466 | pr_debug("sst_platform_pcm_trigger called\n"); | 464 | pr_debug("sst_platform_pcm_trigger called\n"); |
467 | stream = substream->runtime->private_data; | 465 | stream = substream->runtime->private_data; |
@@ -469,29 +467,29 @@ static int sst_platform_pcm_trigger(struct snd_pcm_substream *substream, | |||
469 | switch (cmd) { | 467 | switch (cmd) { |
470 | case SNDRV_PCM_TRIGGER_START: | 468 | case SNDRV_PCM_TRIGGER_START: |
471 | pr_debug("sst: Trigger Start\n"); | 469 | pr_debug("sst: Trigger Start\n"); |
472 | str_cmd = SST_SND_START; | ||
473 | status = SST_PLATFORM_RUNNING; | 470 | status = SST_PLATFORM_RUNNING; |
474 | stream->stream_info.arg = substream; | 471 | stream->stream_info.arg = substream; |
472 | ret_val = stream->ops->stream_start(str_id); | ||
475 | break; | 473 | break; |
476 | case SNDRV_PCM_TRIGGER_STOP: | 474 | case SNDRV_PCM_TRIGGER_STOP: |
477 | pr_debug("sst: in stop\n"); | 475 | pr_debug("sst: in stop\n"); |
478 | str_cmd = SST_SND_DROP; | ||
479 | status = SST_PLATFORM_DROPPED; | 476 | status = SST_PLATFORM_DROPPED; |
477 | ret_val = stream->ops->stream_drop(str_id); | ||
480 | break; | 478 | break; |
481 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 479 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
482 | pr_debug("sst: in pause\n"); | 480 | pr_debug("sst: in pause\n"); |
483 | str_cmd = SST_SND_PAUSE; | ||
484 | status = SST_PLATFORM_PAUSED; | 481 | status = SST_PLATFORM_PAUSED; |
482 | ret_val = stream->ops->stream_pause(str_id); | ||
485 | break; | 483 | break; |
486 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 484 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
487 | pr_debug("sst: in pause release\n"); | 485 | pr_debug("sst: in pause release\n"); |
488 | str_cmd = SST_SND_RESUME; | ||
489 | status = SST_PLATFORM_RUNNING; | 486 | status = SST_PLATFORM_RUNNING; |
487 | ret_val = stream->ops->stream_pause_release(str_id); | ||
490 | break; | 488 | break; |
491 | default: | 489 | default: |
492 | return -EINVAL; | 490 | return -EINVAL; |
493 | } | 491 | } |
494 | ret_val = stream->ops->device_control(str_cmd, &str_id); | 492 | |
495 | if (!ret_val) | 493 | if (!ret_val) |
496 | sst_set_stream_status(stream, status); | 494 | sst_set_stream_status(stream, status); |
497 | 495 | ||
@@ -511,8 +509,7 @@ static snd_pcm_uframes_t sst_platform_pcm_pointer | |||
511 | if (status == SST_PLATFORM_INIT) | 509 | if (status == SST_PLATFORM_INIT) |
512 | return 0; | 510 | return 0; |
513 | str_info = &stream->stream_info; | 511 | str_info = &stream->stream_info; |
514 | ret_val = stream->ops->device_control( | 512 | ret_val = stream->ops->stream_read_tstamp(str_info); |
515 | SST_SND_BUFFER_POINTER, str_info); | ||
516 | if (ret_val) { | 513 | if (ret_val) { |
517 | pr_err("sst: error code = %d\n", ret_val); | 514 | pr_err("sst: error code = %d\n", ret_val); |
518 | return ret_val; | 515 | return ret_val; |
diff --git a/sound/soc/intel/sst-mfld-platform.h b/sound/soc/intel/sst-mfld-platform.h index cc3a088df7dd..2d6e65bbbc49 100644 --- a/sound/soc/intel/sst-mfld-platform.h +++ b/sound/soc/intel/sst-mfld-platform.h | |||
@@ -54,18 +54,6 @@ enum sst_drv_status { | |||
54 | SST_PLATFORM_DROPPED, | 54 | SST_PLATFORM_DROPPED, |
55 | }; | 55 | }; |
56 | 56 | ||
57 | enum sst_controls { | ||
58 | SST_SND_ALLOC = 0x00, | ||
59 | SST_SND_PAUSE = 0x01, | ||
60 | SST_SND_RESUME = 0x02, | ||
61 | SST_SND_DROP = 0x03, | ||
62 | SST_SND_FREE = 0x04, | ||
63 | SST_SND_BUFFER_POINTER = 0x05, | ||
64 | SST_SND_STREAM_INIT = 0x06, | ||
65 | SST_SND_START = 0x07, | ||
66 | SST_MAX_CONTROLS = 0x07, | ||
67 | }; | ||
68 | |||
69 | enum sst_stream_ops { | 57 | enum sst_stream_ops { |
70 | STREAM_OPS_PLAYBACK = 0, | 58 | STREAM_OPS_PLAYBACK = 0, |
71 | STREAM_OPS_CAPTURE, | 59 | STREAM_OPS_CAPTURE, |
@@ -126,7 +114,12 @@ struct compress_sst_ops { | |||
126 | 114 | ||
127 | struct sst_ops { | 115 | struct sst_ops { |
128 | int (*open) (struct snd_sst_params *str_param); | 116 | int (*open) (struct snd_sst_params *str_param); |
129 | int (*device_control) (int cmd, void *arg); | 117 | int (*stream_init) (struct pcm_stream_info *str_info); |
118 | int (*stream_start) (int str_id); | ||
119 | int (*stream_drop) (int str_id); | ||
120 | int (*stream_pause) (int str_id); | ||
121 | int (*stream_pause_release) (int str_id); | ||
122 | int (*stream_read_tstamp) (struct pcm_stream_info *str_info); | ||
130 | int (*send_byte_stream)(struct snd_sst_bytes_v2 *bytes); | 123 | int (*send_byte_stream)(struct snd_sst_bytes_v2 *bytes); |
131 | int (*close) (unsigned int str_id); | 124 | int (*close) (unsigned int str_id); |
132 | }; | 125 | }; |