stream->stream_info.str_id = str_params.stream_id;
- ret_val = stream->ops->open(&str_params);
+ ret_val = stream->ops->open(sst->dev, &str_params);
if (ret_val <= 0)
return ret_val;
stream->stream_info.arg = substream;
stream->stream_info.buffer_ptr = 0;
stream->stream_info.sfreq = substream->runtime->rate;
- ret_val = stream->ops->stream_init(&stream->stream_info);
+ ret_val = stream->ops->stream_init(sst->dev, &stream->stream_info);
if (ret_val)
pr_err("control_set ret error %d\n", ret_val);
return ret_val;
}
-/* end -- helper functions */
static int sst_media_open(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
stream = substream->runtime->private_data;
str_id = stream->stream_info.str_id;
if (str_id)
- ret_val = stream->ops->close(str_id);
+ ret_val = stream->ops->close(sst->dev, str_id);
module_put(sst->dev->driver->owner);
kfree(stream);
}
stream = substream->runtime->private_data;
str_id = stream->stream_info.str_id;
if (stream->stream_info.str_id) {
- ret_val = stream->ops->stream_drop(str_id);
+ ret_val = stream->ops->stream_drop(sst->dev, str_id);
return ret_val;
}
pr_debug("sst: Trigger Start\n");
status = SST_PLATFORM_RUNNING;
stream->stream_info.arg = substream;
- ret_val = stream->ops->stream_start(str_id);
+ ret_val = stream->ops->stream_start(sst->dev, str_id);
break;
case SNDRV_PCM_TRIGGER_STOP:
pr_debug("sst: in stop\n");
status = SST_PLATFORM_DROPPED;
- ret_val = stream->ops->stream_drop(str_id);
+ ret_val = stream->ops->stream_drop(sst->dev, str_id);
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
pr_debug("sst: in pause\n");
status = SST_PLATFORM_PAUSED;
- ret_val = stream->ops->stream_pause(str_id);
+ ret_val = stream->ops->stream_pause(sst->dev, str_id);
break;
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
pr_debug("sst: in pause release\n");
status = SST_PLATFORM_RUNNING;
- ret_val = stream->ops->stream_pause_release(str_id);
+ ret_val = stream->ops->stream_pause_release(sst->dev, str_id);
break;
default:
return -EINVAL;
if (status == SST_PLATFORM_INIT)
return 0;
str_info = &stream->stream_info;
- ret_val = stream->ops->stream_read_tstamp(str_info);
+ ret_val = stream->ops->stream_read_tstamp(sst->dev, str_info);
if (ret_val) {
pr_err("sst: error code = %d\n", ret_val);
return ret_val;
};
struct sst_ops {
- int (*open) (struct snd_sst_params *str_param);
- int (*stream_init) (struct pcm_stream_info *str_info);
- int (*stream_start) (int str_id);
- int (*stream_drop) (int str_id);
- int (*stream_pause) (int str_id);
- int (*stream_pause_release) (int str_id);
- int (*stream_read_tstamp) (struct pcm_stream_info *str_info);
- int (*send_byte_stream)(struct snd_sst_bytes_v2 *bytes);
- int (*close) (unsigned int str_id);
+ int (*open) (struct device *dev, struct snd_sst_params *str_param);
+ int (*stream_init) (struct device *dev, struct pcm_stream_info *str_info);
+ int (*stream_start) (struct device *dev, int str_id);
+ int (*stream_drop) (struct device *dev, int str_id);
+ int (*stream_pause) (struct device *dev, int str_id);
+ int (*stream_pause_release) (struct device *dev, int str_id);
+ int (*stream_read_tstamp) (struct device *dev, struct pcm_stream_info *str_info);
+ int (*send_byte_stream)(struct device *dev, struct snd_sst_bytes_v2 *bytes);
+ int (*close) (struct device *dev, unsigned int str_id);
};
struct sst_runtime_stream {