public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: bxt: Refine the HW contraint of Ref capture.
@ 2017-12-05 19:21 Harry Pan
  2017-12-13  3:31 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Harry Pan @ 2017-12-05 19:21 UTC (permalink / raw)
  To: linux-audio-intel
  Cc: alsa-devel, lgirdwood, vinod.koul, linux-kernel, tiwai, Harry Pan,
	broonie, sathyanarayana.nujella, jeeja.kp,
	Adam.Thomson.Opensource, harshapriya.n, yong.zhi

The patch restricts the HW contraint of the refcap of WoV stream
in single channel (mono) and 16k Hz based on platform implementation.

Such that, the userspace program can rely on correct HW parameters
through the ALSA library call to manipulate the device.

Signed-off-by: Harry Pan <harry.pan@intel.com>
---
 sound/soc/intel/boards/bxt_da7219_max98357a.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c
index ce35ec7884d1..382f71228807 100644
--- a/sound/soc/intel/boards/bxt_da7219_max98357a.c
+++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c
@@ -338,8 +338,23 @@ static const struct snd_pcm_hw_constraint_list constraints_16000 = {
 	.list  = rates_16000,
 };
 
+static const unsigned int ch_mono[] = {
+	1,
+};
+
+static const struct snd_pcm_hw_constraint_list constraints_refcap = {
+	.count = ARRAY_SIZE(ch_mono),
+	.list  = ch_mono,
+};
+
 static int broxton_refcap_startup(struct snd_pcm_substream *substream)
 {
+	substream->runtime->hw.channels_max = 1;
+
+	snd_pcm_hw_constraint_list(substream->runtime, 0,
+					SNDRV_PCM_HW_PARAM_CHANNELS,
+					&constraints_refcap);
+
 	return snd_pcm_hw_constraint_list(substream->runtime, 0,
 			SNDRV_PCM_HW_PARAM_RATE,
 			&constraints_16000);
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-13  3:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-05 19:21 [PATCH] ASoC: Intel: bxt: Refine the HW contraint of Ref capture Harry Pan
2017-12-13  3:31 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox