ASoC: Intel: sof_sdw: detect DMIC number based on mach params
authorRander Wang <rander.wang@intel.com>
Mon, 8 Feb 2021 23:33:30 +0000 (17:33 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Mar 2021 11:34:13 +0000 (12:34 +0100)
[ Upstream commit f88dcb9b98d3f86ead04d2453475267910448bb8 ]

Current driver create DMIC dai based on quirk for each platforms,
so we need to add quirk for new platforms. Now driver reports DMIC
number to machine driver and machine driver can create DMIC dai based
on this information. The old check is reserved for some platforms
may be failed to set the DMIC number in BIOS.

Reviewed-by: Bard Liao <bard.liao@intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210208233336.59449-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/intel/boards/sof_sdw.c

index d441ef324c06deb5001c81d2aa3ffb65eb6610aa..0f1d845a0ccad5fa8a22ee41dd41d31d82036a23 100644 (file)
@@ -925,7 +925,7 @@ static int sof_card_dai_links_create(struct device *dev,
                ctx->idisp_codec = true;
 
        /* enable dmic01 & dmic16k */
-       dmic_num = (sof_sdw_quirk & SOF_SDW_PCH_DMIC) ? 2 : 0;
+       dmic_num = (sof_sdw_quirk & SOF_SDW_PCH_DMIC || mach_params->dmic_num) ? 2 : 0;
        comp_num += dmic_num;
 
        dev_dbg(dev, "sdw %d, ssp %d, dmic %d, hdmi %d", sdw_be_num, ssp_num,