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 5E4CBC433EF for ; Wed, 6 Oct 2021 16:57:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BD03F610E5 for ; Wed, 6 Oct 2021 16:57:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BD03F610E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 401921678; Wed, 6 Oct 2021 18:56:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 401921678 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1633539464; bh=kviJjdPslXksPN9BfPY8XCmCdjg5SPeAndDnUpa3t6U=; h=Subject:To:References:From:Date:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fq6vBAPXpylvr0ZgszgAgJwskK/+jjym8KS9KsOeRdDOsc38ttL5hP12S9OmUk4JF rbZqzHsPLjmDpCO8pmJdeD+mcud1gPDOVI5T6sZPQOiF6eNW8SraHoBkIP+4RXT6KX XpHssrU8WBMALnzUQcETjRk2T7CDGVcH1F/gUj+U= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C64C5F804E2; Wed, 6 Oct 2021 18:56:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 44F34F80424; Wed, 6 Oct 2021 18:56:49 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 53A7FF8010B for ; Wed, 6 Oct 2021 18:56:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 53A7FF8010B X-IronPort-AV: E=McAfee;i="6200,9189,10129"; a="226357118" X-IronPort-AV: E=Sophos;i="5.85,352,1624345200"; d="scan'208";a="226357118" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2021 09:52:58 -0700 X-IronPort-AV: E=Sophos;i="5.85,352,1624345200"; d="scan'208";a="439186776" Received: from nbasa-mobl2.amr.corp.intel.com (HELO [10.213.170.135]) ([10.213.170.135]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2021 09:52:54 -0700 Subject: Re: [PATCH 0/3] Multiple headphone codec driver support To: Brent Lu , alsa-devel@alsa-project.org References: <20211006161805.938950-1-brent.lu@intel.com> From: Pierre-Louis Bossart Message-ID: <33538866-03a3-4866-2edc-f5fb5928b08f@linux.intel.com> Date: Wed, 6 Oct 2021 11:50:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211006161805.938950-1-brent.lu@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Cc: Libin Yang , Guennadi Liakhovetski , Cezary Rojewski , Malik_Hsu , Charles Keepax , Kai Vehmanen , Rander Wang , linux-kernel@vger.kernel.org, Jie Yang , Takashi Iwai , Liam Girdwood , Hans de Goede , Mac Chiang , Mark Brown , Bard Liao , Paul Olaru , Curtis Malainey , Gongjun Song , Vamshi Krishna Gopal , Yong Zhi X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On 10/6/21 11:18 AM, Brent Lu wrote: > Support multiple headphone drivers in same machine driver. In this > case, both rt5682 and rt5682s are supported and enumerated by different > ACPI HID "10EC5682" and "RTL5682". Ah, now I get what you're trying to do. I like this a lot! This is really a 'compatible_id' that the machine driver is capable of handling. It would be quite useful indeed to prune some of the tables we have, e.g. "10EC5640" "10EC5642", "INTCCFFD" "10EC5645" "10EC5648", etc In your case you pushed the logic a bit further in that the codec driver might be different, but the machine driver can deal with it with run-time autodetection. Would you mind going through the tables and suggest additional simplifications with more patches when relevant? > Brent Lu (3): > ASoC: soc-acpi: add alternative id field for machine driver matching > ASoC: Intel: sof_rt5682: detect codec variant in probe function > ASoC: Intel: sof_rt5682: use id_alt to enumerate rt5682s > > include/sound/soc-acpi.h | 2 ++ > sound/soc/intel/boards/sof_rt5682.c | 34 +++---------------- > .../intel/common/soc-acpi-intel-adl-match.c | 8 +++++ > .../intel/common/soc-acpi-intel-byt-match.c | 6 ++++ > .../intel/common/soc-acpi-intel-cht-match.c | 6 ++++ > .../intel/common/soc-acpi-intel-cml-match.c | 8 +++++ > .../intel/common/soc-acpi-intel-icl-match.c | 6 ++++ > .../intel/common/soc-acpi-intel-jsl-match.c | 32 +++++------------ > .../intel/common/soc-acpi-intel-tgl-match.c | 8 +++++ > sound/soc/soc-acpi.c | 21 +++++++++++- > 10 files changed, 76 insertions(+), 55 deletions(-) >