]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
ASoC: Intel: kbl_rt5663_rt5514_max98927: Add dmic format constraint
authorYu-Hsuan Hsu <yuhsuan@chromium.org>
Mon, 23 Sep 2019 16:29:40 +0000 (00:29 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 6 Jan 2020 14:16:19 +0000 (08:16 -0600)
BugLink: https://bugs.launchpad.net/bugs/1858428
[ Upstream commit e2db787bdcb4f2722ecf410168f0583764634e45 ]

On KBL platform, the microphone is attached to external codec(rt5514)
instead of PCH. However, TDM slot between PCH and codec is 16 bits only.
In order to avoid setting wrong format, we should add a constraint to
force to use 16 bits format forever.

Signed-off-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20190923162940.199580-1-yuhsuan@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

index 74dda8784f1a016b2bae4fb98bdc3a0433400f98..67b276a65a8d2dcd8c22438e2bf92dd96c8805c7 100644 (file)
@@ -400,6 +400,9 @@ static int kabylake_dmic_startup(struct snd_pcm_substream *substream)
        snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
                        dmic_constraints);
 
+       runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE;
+       snd_pcm_hw_constraint_msbits(runtime, 0, 16, 16);
+
        return snd_pcm_hw_constraint_list(substream->runtime, 0,
                        SNDRV_PCM_HW_PARAM_RATE, &constraints_rates);
 }