From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4704EC433F5 for ; Fri, 29 Oct 2021 17:16:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D6B1610D2 for ; Fri, 29 Oct 2021 17:16:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230195AbhJ2RTE (ORCPT ); Fri, 29 Oct 2021 13:19:04 -0400 Received: from mga07.intel.com ([134.134.136.100]:3589 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbhJ2RTB (ORCPT ); Fri, 29 Oct 2021 13:19:01 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10152"; a="294170739" X-IronPort-AV: E=Sophos;i="5.87,193,1631602800"; d="scan'208";a="294170739" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2021 10:16:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,193,1631602800"; d="scan'208";a="598276498" Received: from brentlu-brix.itwn.intel.com ([10.5.253.1]) by orsmga004.jf.intel.com with ESMTP; 29 Oct 2021 10:16:02 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Jie Yang , Mark Brown , Jaroslav Kysela , Takashi Iwai , Rander Wang , Kai Vehmanen , Guennadi Liakhovetski , Brent Lu , Curtis Malainey , Mac Chiang , Bard Liao , linux-kernel@vger.kernel.org, Yong Zhi , Vamshi Krishna Gopal , Bard Liao , Malik_Hsu , Libin Yang , Paul Olaru , Christophe JAILLET , Gongjun Song , Liam Girdwood , Rander Wang , Hans de Goede , Charles Keepax Subject: [PATCH v5 2/6] ASoC: Intel: sof_rt5682: detect codec variant in probe function Date: Sat, 30 Oct 2021 01:14:05 +0800 Message-Id: <20211029171409.611600-3-brent.lu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211029171409.611600-1-brent.lu@intel.com> References: <20211029171409.611600-1-brent.lu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- sound/soc/intel/boards/sof_rt5682.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.25.1