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>
This commit is contained in:
parent
da91723ce0
commit
c1aee1d828
@ -30,6 +30,7 @@
|
|||||||
#define BXT_DIALOG_CODEC_DAI "da7219-hifi"
|
#define BXT_DIALOG_CODEC_DAI "da7219-hifi"
|
||||||
#define BXT_MAXIM_CODEC_DAI "HiFi"
|
#define BXT_MAXIM_CODEC_DAI "HiFi"
|
||||||
#define DUAL_CHANNEL 2
|
#define DUAL_CHANNEL 2
|
||||||
|
#define QUAD_CHANNEL 4
|
||||||
|
|
||||||
static struct snd_soc_jack broxton_headset;
|
static struct snd_soc_jack broxton_headset;
|
||||||
|
|
||||||
@ -182,6 +183,16 @@ static struct snd_pcm_hw_constraint_list constraints_channels = {
|
|||||||
.mask = 0,
|
.mask = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static unsigned int channels_quad[] = {
|
||||||
|
QUAD_CHANNEL,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct snd_pcm_hw_constraint_list constraints_channels_quad = {
|
||||||
|
.count = ARRAY_SIZE(channels_quad),
|
||||||
|
.list = channels_quad,
|
||||||
|
.mask = 0,
|
||||||
|
};
|
||||||
|
|
||||||
static int bxt_fe_startup(struct snd_pcm_substream *substream)
|
static int bxt_fe_startup(struct snd_pcm_substream *substream)
|
||||||
{
|
{
|
||||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||||
@ -258,7 +269,10 @@ static int broxton_dmic_fixup(struct snd_soc_pcm_runtime *rtd,
|
|||||||
{
|
{
|
||||||
struct snd_interval *channels = hw_param_interval(params,
|
struct snd_interval *channels = hw_param_interval(params,
|
||||||
SNDRV_PCM_HW_PARAM_CHANNELS);
|
SNDRV_PCM_HW_PARAM_CHANNELS);
|
||||||
channels->min = channels->max = DUAL_CHANNEL;
|
if (params_channels(params) == 2)
|
||||||
|
channels->min = channels->max = 2;
|
||||||
|
else
|
||||||
|
channels->min = channels->max = 4;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -267,9 +281,9 @@ static int broxton_dmic_startup(struct snd_pcm_substream *substream)
|
|||||||
{
|
{
|
||||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||||
|
|
||||||
runtime->hw.channels_max = DUAL_CHANNEL;
|
runtime->hw.channels_min = runtime->hw.channels_max = QUAD_CHANNEL;
|
||||||
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
|
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
|
||||||
&constraints_channels);
|
&constraints_channels_quad);
|
||||||
|
|
||||||
return snd_pcm_hw_constraint_list(substream->runtime, 0,
|
return snd_pcm_hw_constraint_list(substream->runtime, 0,
|
||||||
SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
|
SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user