diff mbox

[08/19] ASoC: Intel: use common stream allocation method for compressed stream

Message ID 1402662848-24534-9-git-send-email-vinod.koul@intel.com (mailing list archive)
State Accepted
Commit 0ec66fed40e31e74a762dd7166a9bf62ebbae5da
Headers show

Commit Message

Vinod Koul June 13, 2014, 12:33 p.m. UTC
As added in previosu patch along with stream to piep conversion si required for
compressed audio too

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 sound/soc/intel/sst-mfld-platform-compress.c |   11 ++++++++---
 sound/soc/intel/sst-mfld-platform.h          |    7 +++----
 2 files changed, 11 insertions(+), 7 deletions(-)

Comments

Mark Brown June 23, 2014, 11:24 a.m. UTC | #1
On Fri, Jun 13, 2014 at 06:03:57PM +0530, Vinod Koul wrote:
> As added in previosu patch along with stream to piep conversion si required for
> compressed audio too

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/intel/sst-mfld-platform-compress.c b/sound/soc/intel/sst-mfld-platform-compress.c
index 02abd19..29c059c 100644
--- a/sound/soc/intel/sst-mfld-platform-compress.c
+++ b/sound/soc/intel/sst-mfld-platform-compress.c
@@ -100,14 +100,19 @@  static int sst_platform_compr_set_params(struct snd_compr_stream *cstream,
 	int retval;
 	struct snd_sst_params str_params;
 	struct sst_compress_cb cb;
+	struct snd_soc_pcm_runtime *rtd = cstream->private_data;
+	struct snd_soc_platform *platform = rtd->platform;
+	struct sst_data *ctx = snd_soc_platform_get_drvdata(platform);
 
 	stream = cstream->runtime->private_data;
 	/* construct fw structure for this*/
 	memset(&str_params, 0, sizeof(str_params));
 
-	str_params.ops = STREAM_OPS_PLAYBACK;
-	str_params.stream_type = SST_STREAM_TYPE_MUSIC;
-	str_params.device_type = SND_SST_DEVICE_COMPRESS;
+	/* fill the device type and stream id to pass to SST driver */
+	retval = sst_fill_stream_params(cstream, ctx, &str_params, true);
+	pr_debug("compr_set_params: fill stream params ret_val = 0x%x\n", retval);
+	if (retval < 0)
+		return retval;
 
 	switch (params->codec.id) {
 	case SND_AUDIOCODEC_MP3: {
diff --git a/sound/soc/intel/sst-mfld-platform.h b/sound/soc/intel/sst-mfld-platform.h
index 33891a8..9dc962f 100644
--- a/sound/soc/intel/sst-mfld-platform.h
+++ b/sound/soc/intel/sst-mfld-platform.h
@@ -149,8 +149,10 @@  struct sst_device {
 };
 
 struct sst_data;
-
 void sst_set_stream_status(struct sst_runtime_stream *stream, int state);
+int sst_fill_stream_params(void *substream, const struct sst_data *ctx,
+			   struct snd_sst_params *str_params, bool is_compress);
+
 struct sst_algo_int_control_v2 {
 	struct soc_mixer_control mc;
 	u16 module_id; /* module identifieer */
@@ -158,14 +160,11 @@  struct sst_algo_int_control_v2 {
 	u16 instance_id;
 	unsigned int value; /* Value received is stored here */
 };
-
 struct sst_data {
 	struct platform_device *pdev;
 	struct sst_platform_data *pdata;
 	struct mutex lock;
 };
-
 int sst_register_dsp(struct sst_device *sst);
 int sst_unregister_dsp(struct sst_device *sst);
-
 #endif