public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Harry Pan <harry.pan@intel.com>
To: linux-audio-intel@eclists.intel.com
Cc: sathyanarayana.nujella@intel.com, Harry Pan <harry.pan@intel.com>,
	lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.com, vinod.koul@intel.com, jeeja.kp@intel.com,
	harshapriya.n@intel.com, yong.zhi@intel.com,
	Adam.Thomson.Opensource@diasemi.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] ASoC: Intel: bxt: Refine the HW contraint of Ref capture.
Date: Wed,  6 Dec 2017 03:21:27 +0800	[thread overview]
Message-ID: <20171205192127.16210-1-harry.pan@intel.com> (raw)

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

             reply	other threads:[~2017-12-05 19:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05 19:21 Harry Pan [this message]
2017-12-13  3:31 ` [alsa-devel] [PATCH] ASoC: Intel: bxt: Refine the HW contraint of Ref capture Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171205192127.16210-1-harry.pan@intel.com \
    --to=harry.pan@intel.com \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=harshapriya.n@intel.com \
    --cc=jeeja.kp@intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-audio-intel@eclists.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=sathyanarayana.nujella@intel.com \
    --cc=tiwai@suse.com \
    --cc=vinod.koul@intel.com \
    --cc=yong.zhi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox