Skip to contentSkip to conversation

ASoC: Intel: HSW/BDW only support S16 and S24 formats.

PATCH Applied Liam Girdwood 2 participants 8 messages Oct 16, 2014

Subsystems (3)
lore
Share & tools
lore

Liam Girdwood

author maintainer
#0 lore raw

PATCH 1/1 ASoC: Intel: HSW/BDW only support S16 and S24 formats.

Fix driver with correct formats.

---
 sound/soc/intel/sst-haswell-pcm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/intel/sst-haswell-pcm.c +1 -3
index 33fc5c3..4df867c 100644
@@ -691,9 +691,7 @@ static int hsw_pcm_new(struct snd_soc_pcm_runtime *rtd)
 }
 
 #define HSW_FORMATS \
-	(SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S24_LE | \
-	SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S16_LE |\
-	SNDRV_PCM_FMTBIT_S8)
+	(SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE)
 
 static struct snd_soc_dai_driver hsw_dais[] = {
 	{
Signature · 1 line
1.9.1
author maintainer
#1 lore raw

PATCH 1/1 ASoC: Intel: Add TDM support to HSW/BDW SSP port

Add TDM support to SSP port via DSP IPC SetDeviceFormat message.

---
 sound/soc/intel/sst-haswell-ipc.c | 4 ++++
 sound/soc/intel/sst-haswell-ipc.h | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
sound/soc/intel/sst-haswell-ipc.c +4 -0
index b629151..92d625a 100644
@@ -1630,6 +1630,10 @@ int sst_hsw_device_set_config(struct sst_hsw *hsw,
 	config.clock_frequency = mclk;
 	config.mode = mode;
 	config.clock_divider = clock_divider;
+	if (mode == SST_HSW_DEVICE_TDM_CLOCK_MASTER)
+		config.channels = 4;
+	else
+		config.channels = 2;
 
 	trace_hsw_device_config_req(&config);
 
sound/soc/intel/sst-haswell-ipc.h +3 -1
index 2ac194a..063dd6b 100644
@@ -84,6 +84,7 @@ enum sst_hsw_device_mclk {
 enum sst_hsw_device_mode {
 	SST_HSW_DEVICE_CLOCK_SLAVE   = 0,
 	SST_HSW_DEVICE_CLOCK_MASTER  = 1,
+	SST_HSW_DEVICE_TDM_CLOCK_MASTER = 2,
 };
 
 /* DX Power State */
@@ -295,7 +296,8 @@ struct sst_hsw_ipc_device_config_req {
 	u32 clock_frequency;
 	u32 mode;
 	u16 clock_divider;
-	u16 reserved;
+	u8 channels;
+	u8 reserved;
 } __attribute__((packed));
 
 /* Audio Data formats */
Signature · 1 line
1.9.1
maintainer Applied
#2 lore raw

Re: [PATCH] ASoC: Intel: Add TDM support to HSW/BDW SSP port

Quoted 1 line · Liam Girdwood

Add TDM support to SSP port via DSP IPC SetDeviceFormat message.

Applied, thanks.

author maintainer
#3 lore raw

PATCH 1/1 ASoC: Intel: Add 4 channel support to DSP.

In reply to Liam Girdwood

DSP can now support 4 channels in certain use cases.

---
 sound/soc/intel/sst-haswell-ipc.c | 4 ----
 sound/soc/intel/sst-haswell-pcm.c | 8 +-------
 2 files changed, 1 insertion(+), 11 deletions(-)
sound/soc/intel/sst-haswell-ipc.c +0 -4
index 92d625a..4799768 100644
@@ -1256,10 +1256,6 @@ int sst_hsw_stream_set_channels(struct sst_hsw *hsw,
 		return -EINVAL;
 	}
 
-	/* stereo is only supported atm */
-	if (channels != 2)
-		return -EINVAL;
-
 	stream->request.format.ch_num = channels;
 	return 0;
 }
sound/soc/intel/sst-haswell-pcm.c +1 -7
index 4df867c..9a51987 100644
@@ -421,13 +421,7 @@ static int hsw_pcm_hw_params(struct snd_pcm_substream *substream,
 		return ret;
 	}
 
-	/* we only support stereo atm */
 	channels = params_channels(params);
-	if (channels != 2) {
-		dev_err(rtd->dev, "error: invalid channels %d\n", channels);
-		return -EINVAL;
-	}
-
 	map = create_channel_map(SST_HSW_CHANNEL_CONFIG_STEREO);
 	sst_hsw_stream_set_map_config(hsw, pcm_data->stream,
 			map, SST_HSW_CHANNEL_CONFIG_STEREO);
@@ -741,7 +735,7 @@ static struct snd_soc_dai_driver hsw_dais[] = {
 		.capture = {
 			.stream_name = "Analog Capture",
 			.channels_min = 2,
-			.channels_max = 2,
+			.channels_max = 4,
 			.rates = SNDRV_PCM_RATE_48000,
 			.formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S16_LE,
 		},
Signature · 1 line
1.9.1
maintainer Applied
#4 lore raw

Re: [PATCH] ASoC: Intel: Add 4 channel support to DSP.

Quoted 1 line · Liam Girdwood

DSP can now support 4 channels in certain use cases.

Applied, thanks.

author maintainer
#5 lore raw

PATCH 1/1 ASoC: Intel: Make HSW/BDW pointer debug verbose

In reply to Liam Girdwood

Improve the debug SNR by making the positional pointer debug more verbose.

---
 sound/soc/intel/sst-haswell-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/intel/sst-haswell-pcm.c +2 -2
index 9a51987..2dc72a2 100644
@@ -552,7 +552,7 @@ static u32 hsw_notify_pointer(struct sst_hsw_stream *stream, void *data)
 	pos = frames_to_bytes(runtime,
 		(runtime->control->appl_ptr % runtime->buffer_size));
 
-	dev_dbg(rtd->dev, "PCM: App pointer %d bytes\n", pos);
+	dev_vdbg(rtd->dev, "PCM: App pointer %d bytes\n", pos);
 
 	/* let alsa know we have play a period */
 	snd_pcm_period_elapsed(substream);
@@ -574,7 +574,7 @@ static snd_pcm_uframes_t hsw_pcm_pointer(struct snd_pcm_substream *substream)
 	offset = bytes_to_frames(runtime, position);
 	ppos = sst_hsw_get_dsp_presentation_position(hsw, pcm_data->stream);
 
-	dev_dbg(rtd->dev, "PCM: DMA pointer %du bytes, pos %llu\n",
+	dev_vdbg(rtd->dev, "PCM: DMA pointer %du bytes, pos %llu\n",
 		position, ppos);
 	return offset;
 }
Signature · 1 line
1.9.1
maintainer Applied
#6 lore raw

Re: [PATCH] ASoC: Intel: Make HSW/BDW pointer debug verbose

Quoted 1 line · Liam Girdwood

Improve the debug SNR by making the positional pointer debug more verbose.

Applied, thanks.