Discussion:
[PATCH] ASoC: Intel: HSW/BDW only support S16 and S24 formats.
Liam Girdwood
2014-10-16 14:29:14 UTC
Permalink
Fix driver with correct formats.

Signed-off-by: Liam Girdwood <***@linux.intel.com>
---
sound/soc/intel/sst-haswell-pcm.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c
index 33fc5c3..4df867c 100644
--- a/sound/soc/intel/sst-haswell-pcm.c
+++ b/sound/soc/intel/sst-haswell-pcm.c
@@ -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[] = {
{
--
1.9.1
Liam Girdwood
2014-10-16 14:29:15 UTC
Permalink
Add TDM support to SSP port via DSP IPC SetDeviceFormat message.

Signed-off-by: Liam Girdwood <***@linux.intel.com>
---
sound/soc/intel/sst-haswell-ipc.c | 4 ++++
sound/soc/intel/sst-haswell-ipc.h | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c
index b629151..92d625a 100644
--- a/sound/soc/intel/sst-haswell-ipc.c
+++ b/sound/soc/intel/sst-haswell-ipc.c
@@ -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);

diff --git a/sound/soc/intel/sst-haswell-ipc.h b/sound/soc/intel/sst-haswell-ipc.h
index 2ac194a..063dd6b 100644
--- a/sound/soc/intel/sst-haswell-ipc.h
+++ b/sound/soc/intel/sst-haswell-ipc.h
@@ -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 */
--
1.9.1
Mark Brown
2014-10-16 14:49:32 UTC
Permalink
Post by Liam Girdwood
Add TDM support to SSP port via DSP IPC SetDeviceFormat message.
Applied, thanks.
Liam Girdwood
2014-10-16 14:29:16 UTC
Permalink
DSP can now support 4 channels in certain use cases.

Signed-off-by: Liam Girdwood <***@linux.intel.com>
---
sound/soc/intel/sst-haswell-ipc.c | 4 ----
sound/soc/intel/sst-haswell-pcm.c | 8 +-------
2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c
index 92d625a..4799768 100644
--- a/sound/soc/intel/sst-haswell-ipc.c
+++ b/sound/soc/intel/sst-haswell-ipc.c
@@ -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;
}
diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c
index 4df867c..9a51987 100644
--- a/sound/soc/intel/sst-haswell-pcm.c
+++ b/sound/soc/intel/sst-haswell-pcm.c
@@ -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,
},
--
1.9.1
Mark Brown
2014-10-16 14:49:39 UTC
Permalink
Post by Liam Girdwood
DSP can now support 4 channels in certain use cases.
Applied, thanks.
Liam Girdwood
2014-10-16 14:29:17 UTC
Permalink
Improve the debug SNR by making the positional pointer debug more verbose.

Signed-off-by: Liam Girdwood <***@linux.intel.com>
---
sound/soc/intel/sst-haswell-pcm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/sst-haswell-pcm.c b/sound/soc/intel/sst-haswell-pcm.c
index 9a51987..2dc72a2 100644
--- a/sound/soc/intel/sst-haswell-pcm.c
+++ b/sound/soc/intel/sst-haswell-pcm.c
@@ -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;
}
--
1.9.1
Mark Brown
2014-10-16 14:50:04 UTC
Permalink
Post by Liam Girdwood
Improve the debug SNR by making the positional pointer debug more verbose.
Applied, thanks.
Mark Brown
2014-10-16 14:48:04 UTC
Permalink
Post by Liam Girdwood
Fix driver with correct formats.
Applied, thanks.

Loading...