[alsa-devel] [PATCH v3 0/3] ASoC: Intel: rework the mfld platform driver
This is the remaining bits of the v2 which were removed last time around. One patch was wrongly applied so reverting that and adding two other missed in the series.
Also added Liam's ack
Vinod Koul (3): Revert "ASoC: Intel: rename pcm dias to media dai" ASoC: Intel: add drain_notify support ASoC: Intel: remove codec memeber from codec structs
sound/soc/intel/sst-mfld-dsp.h | 4 -- sound/soc/intel/sst-mfld-platform-compress.c | 13 +++++++- sound/soc/intel/sst-mfld-platform-pcm.c | 39 ++++++++++++------------- sound/soc/intel/sst-mfld-platform.h | 2 + 4 files changed, 32 insertions(+), 26 deletions(-)
This reverts commit 0cac6fc3eb5218fe40d1c2910abc643ab21d9f19. This comiit was dropped from rev2 and would not be required as it renames the platform ops as well which is not required.
Signed-off-by: Vinod Koul vinod.koul@intel.com --- sound/soc/intel/sst-mfld-platform-pcm.c | 38 +++++++++++++++--------------- 1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/sound/soc/intel/sst-mfld-platform-pcm.c b/sound/soc/intel/sst-mfld-platform-pcm.c index 72d0fae..d0bc328 100644 --- a/sound/soc/intel/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/sst-mfld-platform-pcm.c @@ -95,7 +95,7 @@ static struct snd_pcm_hardware sst_platform_pcm_hw = { /* MFLD - MSIC */ static struct snd_soc_dai_driver sst_platform_dai[] = { { - .name = "media-cpu-dai", + .name = "Headset-cpu-dai", .id = 0, .playback = { .channels_min = SST_STEREO, @@ -231,13 +231,13 @@ static int sst_platform_init_stream(struct snd_pcm_substream *substream) } /* end -- helper functions */
-static int sst_platform_media_open(struct snd_pcm_substream *substream) +static int sst_platform_open(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; struct sst_runtime_stream *stream; int ret_val;
- pr_debug("sst_platform_media_open called\n"); + pr_debug("sst_platform_open called\n");
snd_soc_set_runtime_hwparams(substream, &sst_platform_pcm_hw); ret_val = snd_pcm_hw_constraint_integer(runtime, @@ -275,12 +275,12 @@ static int sst_platform_media_open(struct snd_pcm_substream *substream) return 0; }
-static int sst_platform_media_close(struct snd_pcm_substream *substream) +static int sst_platform_close(struct snd_pcm_substream *substream) { struct sst_runtime_stream *stream; int ret_val = 0, str_id;
- pr_debug("sst_platform_media_close called\n"); + pr_debug("sst_platform_close called\n"); stream = substream->runtime->private_data; str_id = stream->stream_info.str_id; if (str_id) @@ -290,12 +290,12 @@ static int sst_platform_media_close(struct snd_pcm_substream *substream) return ret_val; }
-static int sst_platform_pcm_media_prepare(struct snd_pcm_substream *substream) +static int sst_platform_pcm_prepare(struct snd_pcm_substream *substream) { struct sst_runtime_stream *stream; int ret_val = 0, str_id;
- pr_debug("sst_platform_pcm_media_prepare called\n"); + pr_debug("sst_platform_pcm_prepare called\n"); stream = substream->runtime->private_data; str_id = stream->stream_info.str_id; if (stream->stream_info.str_id) { @@ -317,14 +317,14 @@ static int sst_platform_pcm_media_prepare(struct snd_pcm_substream *substream) return ret_val; }
-static int sst_platform_pcm_media_trigger(struct snd_pcm_substream *substream, +static int sst_platform_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { int ret_val = 0, str_id; struct sst_runtime_stream *stream; int str_cmd, status;
- pr_debug("sst_platform_pcm_media_trigger called\n"); + pr_debug("sst_platform_pcm_trigger called\n"); stream = substream->runtime->private_data; str_id = stream->stream_info.str_id; switch (cmd) { @@ -360,7 +360,7 @@ static int sst_platform_pcm_media_trigger(struct snd_pcm_substream *substream, }
-static snd_pcm_uframes_t sst_platform_pcm_media_pointer +static snd_pcm_uframes_t sst_platform_pcm_pointer (struct snd_pcm_substream *substream) { struct sst_runtime_stream *stream; @@ -381,7 +381,7 @@ static snd_pcm_uframes_t sst_platform_pcm_media_pointer return stream->stream_info.buffer_ptr; }
-static int sst_platform_pcm_media_hw_params(struct snd_pcm_substream *substream, +static int sst_platform_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); @@ -390,20 +390,20 @@ static int sst_platform_pcm_media_hw_params(struct snd_pcm_substream *substream, return 0; }
-static int sst_platform_pcm_media_hw_free(struct snd_pcm_substream *substream) +static int sst_platform_pcm_hw_free(struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); }
static struct snd_pcm_ops sst_platform_ops = { - .open = sst_platform_media_open, - .close = sst_platform_media_close, + .open = sst_platform_open, + .close = sst_platform_close, .ioctl = snd_pcm_lib_ioctl, - .prepare = sst_platform_pcm_media_prepare, - .trigger = sst_platform_pcm_media_trigger, - .pointer = sst_platform_pcm_media_pointer, - .hw_params = sst_platform_pcm_media_hw_params, - .hw_free = sst_platform_pcm_media_hw_free, + .prepare = sst_platform_pcm_prepare, + .trigger = sst_platform_pcm_trigger, + .pointer = sst_platform_pcm_pointer, + .hw_params = sst_platform_pcm_hw_params, + .hw_free = sst_platform_pcm_hw_free, };
static void sst_pcm_free(struct snd_pcm *pcm)
This patch adds the support to implement drain_notify in Intels mfld driver
Signed-off-by: Vinod Koul vinod.koul@intel.com Acked-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- sound/soc/intel/sst-mfld-platform-compress.c | 11 +++++++++++ sound/soc/intel/sst-mfld-platform.h | 2 ++ 2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/sound/soc/intel/sst-mfld-platform-compress.c b/sound/soc/intel/sst-mfld-platform-compress.c index 16d79fb..5c3e234 100644 --- a/sound/soc/intel/sst-mfld-platform-compress.c +++ b/sound/soc/intel/sst-mfld-platform-compress.c @@ -38,6 +38,15 @@ static void sst_compr_fragment_elapsed(void *arg) snd_compr_fragment_elapsed(cstream); }
+static void sst_drain_notify(void *arg) +{ + struct snd_compr_stream *cstream = (struct snd_compr_stream *)arg; + + pr_debug("drain notify by driver\n"); + if (cstream) + snd_compr_drain_notify(cstream); +} + static int sst_platform_compr_open(struct snd_compr_stream *cstream) {
@@ -143,6 +152,8 @@ static int sst_platform_compr_set_params(struct snd_compr_stream *cstream,
cb.param = cstream; cb.compr_cb = sst_compr_fragment_elapsed; + cb.drain_cb_param = cstream; + cb.drain_notify = sst_drain_notify;
retval = stream->compr_ops->open(&str_params, &cb); if (retval < 0) { diff --git a/sound/soc/intel/sst-mfld-platform.h b/sound/soc/intel/sst-mfld-platform.h index 3ea4fee..6c5e7dc 100644 --- a/sound/soc/intel/sst-mfld-platform.h +++ b/sound/soc/intel/sst-mfld-platform.h @@ -104,6 +104,8 @@ struct sst_stream_params { struct sst_compress_cb { void *param; void (*compr_cb)(void *param); + void *drain_cb_param; + void (*drain_notify)(void *param); };
struct compress_sst_ops {
As we already have a memeber struct snd_sst_params.codec to fill this. so removing duplicate instance
Signed-off-by: Vinod Koul vinod.koul@intel.com Acked-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- sound/soc/intel/sst-mfld-dsp.h | 4 ---- sound/soc/intel/sst-mfld-platform-compress.c | 2 -- sound/soc/intel/sst-mfld-platform-pcm.c | 1 - 3 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/sound/soc/intel/sst-mfld-dsp.h b/sound/soc/intel/sst-mfld-dsp.h index a74477a..8d482d7 100644 --- a/sound/soc/intel/sst-mfld-dsp.h +++ b/sound/soc/intel/sst-mfld-dsp.h @@ -36,7 +36,6 @@ enum stream_type { };
struct snd_pcm_params { - u16 codec; /* codec type */ u8 num_chan; /* 1=Mono, 2=Stereo */ u8 pcm_wd_sz; /* 16/24 - bit*/ u32 reserved; /* Bitrate in bits per second */ @@ -49,7 +48,6 @@ struct snd_pcm_params {
/* MP3 Music Parameters Message */ struct snd_mp3_params { - u16 codec; u8 num_chan; /* 1=Mono, 2=Stereo */ u8 pcm_wd_sz; /* 16/24 - bit*/ u8 crc_check; /* crc_check - disable (0) or enable (1) */ @@ -63,7 +61,6 @@ struct snd_mp3_params {
/* AAC Music Parameters Message */ struct snd_aac_params { - u16 codec; u8 num_chan; /* 1=Mono, 2=Stereo*/ u8 pcm_wd_sz; /* 16/24 - bit*/ u8 bdownsample; /*SBR downsampling 0 - disable 1 -enabled AAC+ only */ @@ -77,7 +74,6 @@ struct snd_aac_params {
/* WMA Music Parameters Message */ struct snd_wma_params { - u16 codec; u8 num_chan; /* 1=Mono, 2=Stereo */ u8 pcm_wd_sz; /* 16/24 - bit*/ u32 brate; /* Use the hard coded value. */ diff --git a/sound/soc/intel/sst-mfld-platform-compress.c b/sound/soc/intel/sst-mfld-platform-compress.c index 5c3e234..02abd19 100644 --- a/sound/soc/intel/sst-mfld-platform-compress.c +++ b/sound/soc/intel/sst-mfld-platform-compress.c @@ -112,7 +112,6 @@ static int sst_platform_compr_set_params(struct snd_compr_stream *cstream, switch (params->codec.id) { case SND_AUDIOCODEC_MP3: { str_params.codec = SST_CODEC_TYPE_MP3; - str_params.sparams.uc.mp3_params.codec = SST_CODEC_TYPE_MP3; str_params.sparams.uc.mp3_params.num_chan = params->codec.ch_in; str_params.sparams.uc.mp3_params.pcm_wd_sz = 16; break; @@ -120,7 +119,6 @@ static int sst_platform_compr_set_params(struct snd_compr_stream *cstream,
case SND_AUDIOCODEC_AAC: { str_params.codec = SST_CODEC_TYPE_AAC; - str_params.sparams.uc.aac_params.codec = SST_CODEC_TYPE_AAC; str_params.sparams.uc.aac_params.num_chan = params->codec.ch_in; str_params.sparams.uc.aac_params.pcm_wd_sz = 16; if (params->codec.format == SND_AUDIOSTREAMFORMAT_MP4ADTS) diff --git a/sound/soc/intel/sst-mfld-platform-pcm.c b/sound/soc/intel/sst-mfld-platform-pcm.c index d0bc328..7c790f5 100644 --- a/sound/soc/intel/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/sst-mfld-platform-pcm.c @@ -147,7 +147,6 @@ static void sst_fill_pcm_params(struct snd_pcm_substream *substream, struct sst_pcm_params *param) {
- param->codec = SST_CODEC_TYPE_PCM; param->num_chan = (u8) substream->runtime->channels; param->pcm_wd_sz = substream->runtime->sample_bits; param->reserved = 0;
On Thu, May 15, 2014 at 09:38:14PM +0530, Vinod Koul wrote:
This is the remaining bits of the v2 which were removed last time around. One patch was wrongly applied so reverting that and adding two other missed in the series.
Applied all, thanks.
participants (2)
-
Mark Brown
-
Vinod Koul