diff options
author | Subhransu S. Prusty <subhransu.s.prusty@intel.com> | 2014-08-04 05:34:21 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-08-16 18:06:30 -0400 |
commit | b12b087c8715286b8759016f1d5c36cac0bb37f6 (patch) | |
tree | 030d9e97cbf5620c4632916cd331b6407c024e48 | |
parent | 5981c2d6db2ef16d96ee4d1c4d3ddff4ad9d8ebc (diff) |
ASoC: Intel: mfld-pcm: Change sst_ops prototypes to take dev parameter
sst_ops need to use the sst driver context. So pass sst device as argument,
which can be used to retrieve sst context.
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/intel/sst-mfld-platform-pcm.c | 19 | ||||
-rw-r--r-- | sound/soc/intel/sst-mfld-platform.h | 18 |
2 files changed, 18 insertions, 19 deletions
diff --git a/sound/soc/intel/sst-mfld-platform-pcm.c b/sound/soc/intel/sst-mfld-platform-pcm.c index 42766a51c17e..a89ff7e18e1a 100644 --- a/sound/soc/intel/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/sst-mfld-platform-pcm.c | |||
@@ -277,7 +277,7 @@ static int sst_platform_alloc_stream(struct snd_pcm_substream *substream, | |||
277 | 277 | ||
278 | stream->stream_info.str_id = str_params.stream_id; | 278 | stream->stream_info.str_id = str_params.stream_id; |
279 | 279 | ||
280 | ret_val = stream->ops->open(&str_params); | 280 | ret_val = stream->ops->open(sst->dev, &str_params); |
281 | if (ret_val <= 0) | 281 | if (ret_val <= 0) |
282 | return ret_val; | 282 | return ret_val; |
283 | 283 | ||
@@ -314,13 +314,12 @@ 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->stream_init(&stream->stream_info); | 317 | ret_val = stream->ops->stream_init(sst->dev, &stream->stream_info); |
318 | if (ret_val) | 318 | if (ret_val) |
319 | pr_err("control_set ret error %d\n", ret_val); | 319 | pr_err("control_set ret error %d\n", ret_val); |
320 | return ret_val; | 320 | return ret_val; |
321 | 321 | ||
322 | } | 322 | } |
323 | /* end -- helper functions */ | ||
324 | 323 | ||
325 | static int sst_media_open(struct snd_pcm_substream *substream, | 324 | static int sst_media_open(struct snd_pcm_substream *substream, |
326 | struct snd_soc_dai *dai) | 325 | struct snd_soc_dai *dai) |
@@ -372,7 +371,7 @@ static void sst_media_close(struct snd_pcm_substream *substream, | |||
372 | stream = substream->runtime->private_data; | 371 | stream = substream->runtime->private_data; |
373 | str_id = stream->stream_info.str_id; | 372 | str_id = stream->stream_info.str_id; |
374 | if (str_id) | 373 | if (str_id) |
375 | ret_val = stream->ops->close(str_id); | 374 | ret_val = stream->ops->close(sst->dev, str_id); |
376 | module_put(sst->dev->driver->owner); | 375 | module_put(sst->dev->driver->owner); |
377 | kfree(stream); | 376 | kfree(stream); |
378 | } | 377 | } |
@@ -402,7 +401,7 @@ static int sst_media_prepare(struct snd_pcm_substream *substream, | |||
402 | stream = substream->runtime->private_data; | 401 | stream = substream->runtime->private_data; |
403 | str_id = stream->stream_info.str_id; | 402 | str_id = stream->stream_info.str_id; |
404 | if (stream->stream_info.str_id) { | 403 | if (stream->stream_info.str_id) { |
405 | ret_val = stream->ops->stream_drop(str_id); | 404 | ret_val = stream->ops->stream_drop(sst->dev, str_id); |
406 | return ret_val; | 405 | return ret_val; |
407 | } | 406 | } |
408 | 407 | ||
@@ -469,22 +468,22 @@ static int sst_platform_pcm_trigger(struct snd_pcm_substream *substream, | |||
469 | pr_debug("sst: Trigger Start\n"); | 468 | pr_debug("sst: Trigger Start\n"); |
470 | status = SST_PLATFORM_RUNNING; | 469 | status = SST_PLATFORM_RUNNING; |
471 | stream->stream_info.arg = substream; | 470 | stream->stream_info.arg = substream; |
472 | ret_val = stream->ops->stream_start(str_id); | 471 | ret_val = stream->ops->stream_start(sst->dev, str_id); |
473 | break; | 472 | break; |
474 | case SNDRV_PCM_TRIGGER_STOP: | 473 | case SNDRV_PCM_TRIGGER_STOP: |
475 | pr_debug("sst: in stop\n"); | 474 | pr_debug("sst: in stop\n"); |
476 | status = SST_PLATFORM_DROPPED; | 475 | status = SST_PLATFORM_DROPPED; |
477 | ret_val = stream->ops->stream_drop(str_id); | 476 | ret_val = stream->ops->stream_drop(sst->dev, str_id); |
478 | break; | 477 | break; |
479 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: | 478 | case SNDRV_PCM_TRIGGER_PAUSE_PUSH: |
480 | pr_debug("sst: in pause\n"); | 479 | pr_debug("sst: in pause\n"); |
481 | status = SST_PLATFORM_PAUSED; | 480 | status = SST_PLATFORM_PAUSED; |
482 | ret_val = stream->ops->stream_pause(str_id); | 481 | ret_val = stream->ops->stream_pause(sst->dev, str_id); |
483 | break; | 482 | break; |
484 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: | 483 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
485 | pr_debug("sst: in pause release\n"); | 484 | pr_debug("sst: in pause release\n"); |
486 | status = SST_PLATFORM_RUNNING; | 485 | status = SST_PLATFORM_RUNNING; |
487 | ret_val = stream->ops->stream_pause_release(str_id); | 486 | ret_val = stream->ops->stream_pause_release(sst->dev, str_id); |
488 | break; | 487 | break; |
489 | default: | 488 | default: |
490 | return -EINVAL; | 489 | return -EINVAL; |
@@ -509,7 +508,7 @@ static snd_pcm_uframes_t sst_platform_pcm_pointer | |||
509 | if (status == SST_PLATFORM_INIT) | 508 | if (status == SST_PLATFORM_INIT) |
510 | return 0; | 509 | return 0; |
511 | str_info = &stream->stream_info; | 510 | str_info = &stream->stream_info; |
512 | ret_val = stream->ops->stream_read_tstamp(str_info); | 511 | ret_val = stream->ops->stream_read_tstamp(sst->dev, str_info); |
513 | if (ret_val) { | 512 | if (ret_val) { |
514 | pr_err("sst: error code = %d\n", ret_val); | 513 | pr_err("sst: error code = %d\n", ret_val); |
515 | return ret_val; | 514 | return ret_val; |
diff --git a/sound/soc/intel/sst-mfld-platform.h b/sound/soc/intel/sst-mfld-platform.h index 2d6e65bbbc49..d4c28b8fb471 100644 --- a/sound/soc/intel/sst-mfld-platform.h +++ b/sound/soc/intel/sst-mfld-platform.h | |||
@@ -113,15 +113,15 @@ struct compress_sst_ops { | |||
113 | }; | 113 | }; |
114 | 114 | ||
115 | struct sst_ops { | 115 | struct sst_ops { |
116 | int (*open) (struct snd_sst_params *str_param); | 116 | int (*open) (struct device *dev, struct snd_sst_params *str_param); |
117 | int (*stream_init) (struct pcm_stream_info *str_info); | 117 | int (*stream_init) (struct device *dev, struct pcm_stream_info *str_info); |
118 | int (*stream_start) (int str_id); | 118 | int (*stream_start) (struct device *dev, int str_id); |
119 | int (*stream_drop) (int str_id); | 119 | int (*stream_drop) (struct device *dev, int str_id); |
120 | int (*stream_pause) (int str_id); | 120 | int (*stream_pause) (struct device *dev, int str_id); |
121 | int (*stream_pause_release) (int str_id); | 121 | int (*stream_pause_release) (struct device *dev, int str_id); |
122 | int (*stream_read_tstamp) (struct pcm_stream_info *str_info); | 122 | int (*stream_read_tstamp) (struct device *dev, struct pcm_stream_info *str_info); |
123 | int (*send_byte_stream)(struct snd_sst_bytes_v2 *bytes); | 123 | int (*send_byte_stream)(struct device *dev, struct snd_sst_bytes_v2 *bytes); |
124 | int (*close) (unsigned int str_id); | 124 | int (*close) (struct device *dev, unsigned int str_id); |
125 | }; | 125 | }; |
126 | 126 | ||
127 | struct sst_runtime_stream { | 127 | struct sst_runtime_stream { |