pr_debug("Capture stream,Device %d\n",
substream->pcm->device);
}
- ret_val = stream->sstdrv_ops->control_set(SST_SND_ALLOC, &str_params);
+ ret_val = stream->sstdrv_ops->pcm_control->open(&str_params);
pr_debug("SST_SND_PLAY/CAPTURE ret_val = %x\n", ret_val);
if (ret_val < 0)
return ret_val;
stream->stream_info.mad_substream = substream;
stream->stream_info.buffer_ptr = 0;
stream->stream_info.sfreq = substream->runtime->rate;
- ret_val = stream->sstdrv_ops->control_set(SST_SND_STREAM_INIT,
- &stream->stream_info);
+ ret_val = stream->sstdrv_ops->pcm_control->device_control(
+ SST_SND_STREAM_INIT, &stream->stream_info);
if (ret_val)
pr_err("control_set ret error %d\n", ret_val);
return ret_val;
stream = substream->runtime->private_data;
str_id = stream->stream_info.str_id;
if (str_id)
- ret_val = stream->sstdrv_ops->control_set(
- SST_SND_FREE, &str_id);
+ ret_val = stream->sstdrv_ops->pcm_control->close(str_id);
kfree(stream->sstdrv_ops);
kfree(stream);
return ret_val;
stream = substream->runtime->private_data;
str_id = stream->stream_info.str_id;
if (stream->stream_info.str_id) {
- ret_val = stream->sstdrv_ops->control_set(
+ ret_val = stream->sstdrv_ops->pcm_control->device_control(
SST_SND_DROP, &str_id);
return ret_val;
}
{
int ret_val = 0, str_id;
struct sst_runtime_stream *stream;
+ int str_cmd, status;
pr_debug("sst_platform_pcm_trigger called\n");
stream = substream->runtime->private_data;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
pr_debug("sst: Trigger Start\n");
- ret_val = stream->sstdrv_ops->control_set(
- SST_SND_START, &str_id);
- if (ret_val)
- break;
- sst_set_stream_status(stream, SST_PLATFORM_RUNNING);
+ str_cmd = SST_SND_START;
+ status = SST_PLATFORM_RUNNING;
stream->stream_info.mad_substream = substream;
break;
case SNDRV_PCM_TRIGGER_STOP:
pr_debug("sst: in stop\n");
- ret_val = stream->sstdrv_ops->control_set(
- SST_SND_DROP, &str_id);
- if (ret_val)
- break;
- sst_set_stream_status(stream, SST_PLATFORM_DROPPED);
+ str_cmd = SST_SND_DROP;
+ status = SST_PLATFORM_DROPPED;
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
pr_debug("sst: in pause\n");
- ret_val = stream->sstdrv_ops->control_set(
- SST_SND_PAUSE, &str_id);
- if (ret_val)
- break;
- sst_set_stream_status(stream, SST_PLATFORM_PAUSED);
+ str_cmd = SST_SND_PAUSE;
+ status = SST_PLATFORM_PAUSED;
break;
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
pr_debug("sst: in pause release\n");
- ret_val = stream->sstdrv_ops->control_set(
- SST_SND_RESUME, &str_id);
- if (ret_val)
- break;
- sst_set_stream_status(stream, SST_PLATFORM_RUNNING);
+ str_cmd = SST_SND_RESUME;
+ status = SST_PLATFORM_RUNNING;
break;
default:
- ret_val = -EINVAL;
+ return -EINVAL;
}
+ ret_val = stream->sstdrv_ops->pcm_control->device_control(str_cmd,
+ &str_id);
+ if (!ret_val)
+ sst_set_stream_status(stream, status);
+
return ret_val;
}
if (status == SST_PLATFORM_INIT)
return 0;
str_info = &stream->stream_info;
- ret_val = stream->sstdrv_ops->control_set(
+ ret_val = stream->sstdrv_ops->pcm_control->device_control(
SST_SND_BUFFER_POINTER, str_info);
if (ret_val) {
pr_err("sst: error code = %d\n", ret_val);