diff options
author | Sathyanarayana Nujella <sathyanarayana.nujella@intel.com> | 2016-12-06 10:08:36 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-12-06 10:13:11 -0500 |
commit | c1aee1d828caa86a663c57a56eead7fd5f22d80f (patch) | |
tree | e9273f4f59eac96d36369a8727b93902c73e4ba4 | |
parent | da91723ce0c5e0bbd5dc91d66447ba165241c257 (diff) |
ASoC: Intel: update bxt_da7219_max98357a to support quad ch dmic capture
This patch updates FE channel constraints & BE fixup to support
quad channel DMIC capture.
DMIC pin's BE fixup is configured based on channel input, i.e.
either stereo or quad.
Signed-off-by: Sathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: Harsha Priya <harshapriya.n@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/boards/bxt_da7219_max98357a.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c index bff80b467262..3a8c24a59020 100644 --- a/sound/soc/intel/boards/bxt_da7219_max98357a.c +++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #define BXT_DIALOG_CODEC_DAI "da7219-hifi" | 30 | #define BXT_DIALOG_CODEC_DAI "da7219-hifi" |
31 | #define BXT_MAXIM_CODEC_DAI "HiFi" | 31 | #define BXT_MAXIM_CODEC_DAI "HiFi" |
32 | #define DUAL_CHANNEL 2 | 32 | #define DUAL_CHANNEL 2 |
33 | #define QUAD_CHANNEL 4 | ||
33 | 34 | ||
34 | static struct snd_soc_jack broxton_headset; | 35 | static struct snd_soc_jack broxton_headset; |
35 | 36 | ||
@@ -182,6 +183,16 @@ static struct snd_pcm_hw_constraint_list constraints_channels = { | |||
182 | .mask = 0, | 183 | .mask = 0, |
183 | }; | 184 | }; |
184 | 185 | ||
186 | static unsigned int channels_quad[] = { | ||
187 | QUAD_CHANNEL, | ||
188 | }; | ||
189 | |||
190 | static struct snd_pcm_hw_constraint_list constraints_channels_quad = { | ||
191 | .count = ARRAY_SIZE(channels_quad), | ||
192 | .list = channels_quad, | ||
193 | .mask = 0, | ||
194 | }; | ||
195 | |||
185 | static int bxt_fe_startup(struct snd_pcm_substream *substream) | 196 | static int bxt_fe_startup(struct snd_pcm_substream *substream) |
186 | { | 197 | { |
187 | struct snd_pcm_runtime *runtime = substream->runtime; | 198 | struct snd_pcm_runtime *runtime = substream->runtime; |
@@ -258,7 +269,10 @@ static int broxton_dmic_fixup(struct snd_soc_pcm_runtime *rtd, | |||
258 | { | 269 | { |
259 | struct snd_interval *channels = hw_param_interval(params, | 270 | struct snd_interval *channels = hw_param_interval(params, |
260 | SNDRV_PCM_HW_PARAM_CHANNELS); | 271 | SNDRV_PCM_HW_PARAM_CHANNELS); |
261 | channels->min = channels->max = DUAL_CHANNEL; | 272 | if (params_channels(params) == 2) |
273 | channels->min = channels->max = 2; | ||
274 | else | ||
275 | channels->min = channels->max = 4; | ||
262 | 276 | ||
263 | return 0; | 277 | return 0; |
264 | } | 278 | } |
@@ -267,9 +281,9 @@ static int broxton_dmic_startup(struct snd_pcm_substream *substream) | |||
267 | { | 281 | { |
268 | struct snd_pcm_runtime *runtime = substream->runtime; | 282 | struct snd_pcm_runtime *runtime = substream->runtime; |
269 | 283 | ||
270 | runtime->hw.channels_max = DUAL_CHANNEL; | 284 | runtime->hw.channels_min = runtime->hw.channels_max = QUAD_CHANNEL; |
271 | snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, | 285 | snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, |
272 | &constraints_channels); | 286 | &constraints_channels_quad); |
273 | 287 | ||
274 | return snd_pcm_hw_constraint_list(substream->runtime, 0, | 288 | return snd_pcm_hw_constraint_list(substream->runtime, 0, |
275 | SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); | 289 | SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); |