Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1aee1d8 authored by Sathyanarayana Nujella's avatar Sathyanarayana Nujella Committed by Mark Brown
Browse files

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: default avatarSathyanarayana Nujella <sathyanarayana.nujella@intel.com>
Signed-off-by: default avatarHarsha Priya <harshapriya.n@intel.com>
Acked-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent da91723c
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#define BXT_DIALOG_CODEC_DAI	"da7219-hifi"
#define BXT_MAXIM_CODEC_DAI	"HiFi"
#define DUAL_CHANNEL		2
#define QUAD_CHANNEL		4

static struct snd_soc_jack broxton_headset;

@@ -182,6 +183,16 @@ static struct snd_pcm_hw_constraint_list constraints_channels = {
	.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)
{
	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,
						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;
}
@@ -267,9 +281,9 @@ static int broxton_dmic_startup(struct snd_pcm_substream *substream)
{
	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,
			&constraints_channels);
			&constraints_channels_quad);

	return snd_pcm_hw_constraint_list(substream->runtime, 0,
			SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);