Skip to contentSkip to conversation

ASoC: Intel: rework the mfld platform driver

PATCH Applied Vinod Koul 3 participants 12 messages May 5, 2014 – May 8, 2014

Subsystems (3)

v2 of 3 Applied Latest is v3 →

lore
Share & tools
lore

Vinod Koul

author
#0 lore raw

v2 cover ASoC: Intel: rework the mfld platform driver

This patch series reworks and reformats the existing platform driver we use. This is stepping support for seconds series of patches which will support Merrifield platform with DPCM based implementation

Not much logical changes in code except adding drain support for compressed audio. Most is mere modularization of the existing code

Fixes in v2:
- add two more patches
- fix makefile addition is 4th patch
- dropped name change in platform ops patch

Vinod Koul (8):
ASoC: Intel: remove FSF snail mail address
ASoc: Intel: rename sst-mfld-platform.c
ASoC: Intel: mark sst_set_stream_status as non static
ASoC: Intel: split the pcm and compress to different files
ASoC: Intel: remove unused sst-mfld platform dais
ASoC: Intel: add drain_notify support
ASoC: Intel: remove codec memeber from codec structs
ASoC: Intel: move component registration blob

 sound/soc/intel/Makefile                           |   14 +-
 sound/soc/intel/sst-mfld-dsp.h                     |    8 -
 sound/soc/intel/sst-mfld-platform-compress.c       |  237 +++++++++++++++++++
 ...sst-mfld-platform.c => sst-mfld-platform-pcm.c} |  250 +-------------------
 sound/soc/intel/sst-mfld-platform.h                |   11 +-
 5 files changed, 263 insertions(+), 257 deletions(-)
 create mode 100644 sound/soc/intel/sst-mfld-platform-compress.c
 rename sound/soc/intel/{sst-mfld-platform.c => sst-mfld-platform-pcm.c} (67%)
author
#1 lore raw

PATCH v2 1/8 ASoC: Intel: remove FSF snail mail address

As this address can move

---
 sound/soc/intel/sst-mfld-dsp.h      |    4 ----
 sound/soc/intel/sst-mfld-platform.c |    6 ------
 sound/soc/intel/sst-mfld-platform.h |    6 ------
 3 files changed, 0 insertions(+), 16 deletions(-)
sound/soc/intel/sst-mfld-dsp.h +0 -4
index 3b63edc..a74477a 100644
@@ -16,10 +16,6 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
sound/soc/intel/sst-mfld-platform.c +0 -6
index 840306c..ec499ae 100644
@@ -15,13 +15,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *
  */
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
sound/soc/intel/sst-mfld-platform.h +0 -6
index 0c4e2dd..5bf8f9d 100644
@@ -15,13 +15,7 @@
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  *  General Public License for more details.
  *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- *
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *
  */
 
 #ifndef __SST_PLATFORMDRV_H__
Signature · 1 line
1.7.0.4
author
#2 lore raw

PATCH v2 2/8 ASoc: Intel: rename sst-mfld-platform.c

In reply to Vinod Koul

to sst-mfld-platform-pcm.c so that we can split pcm and compress to different files for upcoming changes to support more platforms

---
 sound/soc/intel/Makefile                           |    2 +-
 ...sst-mfld-platform.c => sst-mfld-platform-pcm.c} |    0
 2 files changed, 1 insertions(+), 1 deletions(-)
 rename sound/soc/intel/{sst-mfld-platform.c => sst-mfld-platform-pcm.c} (100%)
sound/soc/intel/Makefile +1 -1
index edeb79a..5d3fb6f 100644
@@ -2,7 +2,7 @@
 snd-soc-sst-dsp-objs := sst-dsp.o sst-firmware.o
 snd-soc-sst-acpi-objs := sst-acpi.o
 
-snd-soc-sst-mfld-platform-objs := sst-mfld-platform.o
+snd-soc-sst-mfld-platform-objs := sst-mfld-platform-pcm.o
 snd-soc-mfld-machine-objs := mfld_machine.o
 
 obj-$(CONFIG_SND_SST_MFLD_PLATFORM) += snd-soc-sst-mfld-platform.o
sound/soc/intel/sst-mfld-platform-pcm.c renamed from sound/soc/intel/sst-mfld-platform.c +0 -0
similarity index 100%
rename from sound/soc/intel/sst-mfld-platform.c
rename to sound/soc/intel/sst-mfld-platform-pcm.c
Signature · 1 line
1.7.0.4
author
#3 lore raw

PATCH v2 3/8 ASoC: Intel: mark sst_set_stream_status as non static

In reply to Vinod Koul

as this will be used in compressed split file in subsequent patch

---
 sound/soc/intel/sst-mfld-platform-pcm.c |    2 +-
 sound/soc/intel/sst-mfld-platform.h     |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)
sound/soc/intel/sst-mfld-platform-pcm.c +1 -1
index ec499ae..3600003 100644
@@ -156,7 +156,7 @@ static const struct snd_soc_component_driver sst_component = {
 };
 
 /* helper functions */
-static inline void sst_set_stream_status(struct sst_runtime_stream *stream,
+void sst_set_stream_status(struct sst_runtime_stream *stream,
 					int state)
 {
 	unsigned long flags;
sound/soc/intel/sst-mfld-platform.h +1 -0
index 5bf8f9d..1005f55 100644
@@ -142,6 +142,7 @@ struct sst_device {
 	struct compress_sst_ops *compr_ops;
 };
 
+void sst_set_stream_status(struct sst_runtime_stream *stream, int state);
 int sst_register_dsp(struct sst_device *sst);
 int sst_unregister_dsp(struct sst_device *sst);
 #endif
Signature · 1 line
1.7.0.4
author
#4 lore raw

PATCH v2 4/8 ASoC: Intel: split the pcm and compress to different files

In reply to Vinod Koul

For managing them and adding support for more platforms

---
 sound/soc/intel/Makefile                     |   14 ++-
 sound/soc/intel/sst-mfld-platform-compress.c |  228 ++++++++++++++++++++++++++
 sound/soc/intel/sst-mfld-platform-pcm.c      |  202 +----------------------
 sound/soc/intel/sst-mfld-platform.h          |    2 +
 4 files changed, 245 insertions(+), 201 deletions(-)
 create mode 100644 sound/soc/intel/sst-mfld-platform-compress.c
sound/soc/intel/Makefile +13 -1
index 5d3fb6f..57242c4 100644
@@ -2,7 +2,7 @@
 snd-soc-sst-dsp-objs := sst-dsp.o sst-firmware.o
 snd-soc-sst-acpi-objs := sst-acpi.o
 
-snd-soc-sst-mfld-platform-objs := sst-mfld-platform-pcm.o
+snd-soc-sst-mfld-platform-objs := sst-mfld-platform-pcm.o sst-mfld-platform-compress.o
 snd-soc-mfld-machine-objs := mfld_machine.o
 
 obj-$(CONFIG_SND_SST_MFLD_PLATFORM) += snd-soc-sst-mfld-platform.o
@@ -26,3 +26,15 @@ snd-soc-sst-byt-rt5640-mach-objs := byt-rt5640.o
 
 obj-$(CONFIG_SND_SOC_INTEL_HASWELL_MACH) += snd-soc-sst-haswell.o
 obj-$(CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH) += snd-soc-sst-byt-rt5640-mach.o
+
+# SST Platform Driver
+PLATFORM_LIBS = platform-libs/controls_v2_dpcm.o
+
+snd-soc-sst-platform-objs := pcm.o compress.o $(PLATFORM_LIBS)
+obj-$(CONFIG_SND_SST_PLATFORM) += snd-soc-sst-platform.o
+
+# Relevant Machine driver
+obj-$(CONFIG_SND_SST_MACHINE) += board/
+
+# IPC driver
+obj-$(CONFIG_SND_INTEL_SST) += sst/
sound/soc/intel/sst-mfld-platform-compress.c new file +228 -0

228 lines not on this page · raw message

sound/soc/intel/sst-mfld-platform-pcm.c +2 -200

215 lines not on this page · raw message

sound/soc/intel/sst-mfld-platform.h +2 -0
index 1005f55..3ea4fee 100644
@@ -23,6 +23,8 @@
 
 #include "sst-mfld-dsp.h"
 
+extern struct sst_device *sst;
+
 #define SST_MONO		1
 #define SST_STEREO		2
 #define SST_MAX_CAP		5
Signature · 1 line
1.7.0.4
author
#5 lore raw

PATCH v2 5/8 ASoC: Intel: remove unused sst-mfld platform dais

In reply to Vinod Koul

With DPCM we have media dai used and no sperate headset and speaker dai so remove the speaker dai
The vibra is no longer supported thru audio, so remove

---
 sound/soc/intel/sst-mfld-platform-pcm.c |   30 ------------------------------
 1 files changed, 0 insertions(+), 30 deletions(-)
sound/soc/intel/sst-mfld-platform-pcm.c +0 -30
index 2beb959..3f9cd77 100644
@@ -111,36 +111,6 @@ static struct snd_soc_dai_driver sst_platform_dai[] = {
 	},
 },
 {
-	.name = "Speaker-cpu-dai",
-	.id = 1,
-	.playback = {
-		.channels_min = SST_MONO,
-		.channels_max = SST_STEREO,
-		.rates = SNDRV_PCM_RATE_48000,
-		.formats = SNDRV_PCM_FMTBIT_S24_LE,
-	},
-},
-{
-	.name = "Vibra1-cpu-dai",
-	.id = 2,
-	.playback = {
-		.channels_min = SST_MONO,
-		.channels_max = SST_MONO,
-		.rates = SNDRV_PCM_RATE_48000,
-		.formats = SNDRV_PCM_FMTBIT_S24_LE,
-	},
-},
-{
-	.name = "Vibra2-cpu-dai",
-	.id = 3,
-	.playback = {
-		.channels_min = SST_MONO,
-		.channels_max = SST_STEREO,
-		.rates = SNDRV_PCM_RATE_48000,
-		.formats = SNDRV_PCM_FMTBIT_S24_LE,
-	},
-},
-{
 	.name = "Compress-cpu-dai",
 	.compress_dai = 1,
 	.playback = {
Signature · 1 line
1.7.0.4
author
#6 lore raw

PATCH v2 6/8 ASoC: Intel: add drain_notify support

In reply to Vinod Koul
---
 sound/soc/intel/sst-mfld-platform-compress.c |   11 +++++++++++
 sound/soc/intel/sst-mfld-platform.h          |    2 ++
 2 files changed, 13 insertions(+), 0 deletions(-)
sound/soc/intel/sst-mfld-platform-compress.c +11 -0
index 16d79fb..5c3e234 100644
@@ -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) {
sound/soc/intel/sst-mfld-platform.h +2 -0
index 3ea4fee..6c5e7dc 100644
@@ -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 {
Signature · 1 line
1.7.0.4
author
#7 lore raw

PATCH v2 7/8 ASoC: Intel: remove codec memeber from codec structs

In reply to Vinod Koul

as we already have a memeber struct snd_sst_params.codec to fill this. so removing duplicate instance

---
 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(-)
sound/soc/intel/sst-mfld-dsp.h +0 -4
index a74477a..8d482d7 100644
@@ -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. */
sound/soc/intel/sst-mfld-platform-compress.c +0 -2
index 5c3e234..02abd19 100644
@@ -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)
sound/soc/intel/sst-mfld-platform-pcm.c +0 -1
index 3f9cd77..380802a 100644
@@ -151,7 +151,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;
Signature · 1 line
1.7.0.4
author
#8 lore raw

PATCH v2 8/8 ASoC: Intel: move component registration blob

In reply to Vinod Koul

to the place near it is used

---
 sound/soc/intel/sst-mfld-platform-pcm.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
sound/soc/intel/sst-mfld-platform-pcm.c +5 -4
index 380802a..7c790f5 100644
@@ -122,10 +122,6 @@ static struct snd_soc_dai_driver sst_platform_dai[] = {
 },
 };
 
-static const struct snd_soc_component_driver sst_component = {
-	.name		= "sst",
-};
-
 /* helper functions */
 void sst_set_stream_status(struct sst_runtime_stream *stream,
 					int state)
@@ -442,6 +438,11 @@ static struct snd_soc_platform_driver sst_soc_platform_drv = {
 	.pcm_free	= sst_pcm_free,
 };
 
+static const struct snd_soc_component_driver sst_component = {
+	.name		= "sst",
+};
+
+
 static int sst_platform_probe(struct platform_device *pdev)
 {
 	int ret;
Signature · 1 line
1.7.0.4
maintainer Applied
#9 lore raw
In reply to Vinod Koul
Quoted 3 lines · Vinod Koul

This patch series reworks and reformats the existing platform driver we use. This is stepping support for seconds series of patches which will support Merrifield platform with DPCM based implementation

Applied all, thanks. Please make the body of your commit message standalone, don't continue a sentance from the subject line - it makes it look like something got corrupted.

Acked-by on the v2 series
#10 lore raw
In reply to Vinod Koul
Quoted 4 lines · Vinod Koul

This patch series reworks and reformats the existing platform driver we use. This is stepping support for seconds series of patches which will support Merrifield platform with DPCM based implementation

Quoted 8 lines

Not much logical changes in code except adding drain support for compressed audio. Most is mere modularization of the existing code

Fixes in v2:
- add two more patches
- fix makefile addition is 4th patch
- dropped name change in platform ops patch

All

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

maintainer
#11 lore raw
In reply to Vinod Koul
Quoted 3 lines · Vinod Koul

This patch series reworks and reformats the existing platform driver we use. This is stepping support for seconds series of patches which will support Merrifield platform with DPCM based implementation

I've dropped this series since it broke the build in -next by adding recursion into a board subdirectory and there wasn't a response - please fix and resend.