summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorBrent Lu <brent.lu@intel.com>2021-10-30 01:14:05 +0800
committerMark Brown <broonie@kernel.org>2021-10-29 18:55:18 +0100
commit8fe6ec03183ac04fa6529fdf0d4da1328946a9d0 (patch)
tree36b0660060a001bdad084fadc6abf1eed0e0d9e6 /sound
parentcafa39b650ec3ba8e9efa0825f1c08e029b5a1ed (diff)
ASoC: Intel: sof_rt5682: detect codec variant in probe function
Detect whether the headphone codec is ALC5682I-VS or not in probe function so we don't need to duplicate all board configs for this new variant. Signed-off-by: Brent Lu <brent.lu@intel.com> Link: https://lore.kernel.org/r/20211029171409.611600-3-brent.lu@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/intel/boards/sof_rt5682.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
index 613662eedd0d..c41c584379d9 100644
--- a/sound/soc/intel/boards/sof_rt5682.c
+++ b/sound/soc/intel/boards/sof_rt5682.c
@@ -864,6 +864,10 @@ static int sof_audio_probe(struct platform_device *pdev)
if ((sof_rt5682_quirk & SOF_SPEAKER_AMP_PRESENT) && !mach->quirk_data)
sof_rt5682_quirk &= ~SOF_SPEAKER_AMP_PRESENT;
+ /* Detect the headset codec variant */
+ if (acpi_dev_present("RTL5682", NULL, -1))
+ sof_rt5682_quirk |= SOF_RT5682S_HEADPHONE_CODEC_PRESENT;
+
if (soc_intel_is_byt() || soc_intel_is_cht()) {
is_legacy_cpu = 1;
dmic_be_num = 0;