From patchwork Mon Feb 8 09:37:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 12074529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83502C433DB for ; Mon, 8 Feb 2021 09:39:07 +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 40B8464E7E for ; Mon, 8 Feb 2021 09:39:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40B8464E7E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@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 C9E6685D; Mon, 8 Feb 2021 10:38:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C9E6685D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1612777143; bh=pr10r41ETmzCz+PeMSqUqL/+QGEqTmrBgui7zRFvqfM=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=IyopBN6+Ev6crCGNlmYe3RZOyrbELexjNhR1P2HVaMWiUHUnDyEFKmNubxcnpBsnj tAVqAChPqMXn0urlL1cIn++1q3QHW4lufKhmOLztPaANWZbR4qA8bP0WiMH5HyZrcm HAmgTuP9/v2IczeFUczi8D5Wbz7kWUOizGLlF+l0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4EA85F80169; Mon, 8 Feb 2021 10:38:13 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 34F83F8022B; Mon, 8 Feb 2021 10:38:11 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EB1A4F80114 for ; Mon, 8 Feb 2021 10:38:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EB1A4F80114 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="KgK/Kn1E" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612777086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=G8tnDuY2tKq+vxpS7eSamRY6LX3bxSsGUSKC7QvdPaw=; b=KgK/Kn1ESTO1JHeC++9SJ3wFi+FHwSMXMjRQK+DBlKITDTuZ8mhgjgg4VWSLMcLaf9wJND V3bcqZunn1U/OvuzisQey0KzAVsWlY2LzFrfgGfyc3DdN19OPaU65FHJGtx+8aBOYXXebD TDrA/QaSyARoG0DmXve0+Ny2zCkMCLw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-413-jKFWsyDoMLekSGut3AnIMw-1; Mon, 08 Feb 2021 04:38:04 -0500 X-MC-Unique: jKFWsyDoMLekSGut3AnIMw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 95BB779EC1; Mon, 8 Feb 2021 09:38:03 +0000 (UTC) Received: from x1.localdomain.com (ovpn-115-119.ams2.redhat.com [10.36.115.119]) by smtp.corp.redhat.com (Postfix) with ESMTP id 534815D9D5; Mon, 8 Feb 2021 09:38:01 +0000 (UTC) From: Hans de Goede To: Cezary Rojewski , Pierre-Louis Bossart , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 1/2] ALSA: hda: intel-dsp-config: Add FLAG_BYT_FIRST / _SECOND defines Date: Mon, 8 Feb 2021 10:37:59 +0100 Message-Id: <20210208093800.62099-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hdegoede@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Hans de Goede , alsa-devel@alsa-project.org 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" Instead of hardcording the SST driver having the highest prio, add FLAG_BYT_FIRST and FLAG_BYT_SECOND defines, which get set like this when both drivers are enabled: #define FLAG_BYT_FIRST FLAG_SST #define FLAG_BYT_SECOND FLAG_SOF And when only 1 driver is enabled then FLAG_BYT_FIRST gets set to the flag for that driver. This is a preparation patch for making which driver is preferred configurable through Kconfig. Signed-off-by: Hans de Goede --- sound/hda/intel-dsp-config.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c index c45686172517..2201a1e6944e 100644 --- a/sound/hda/intel-dsp-config.c +++ b/sound/hda/intel-dsp-config.c @@ -452,6 +452,16 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci) } EXPORT_SYMBOL_GPL(snd_intel_dsp_driver_probe); +/* FLAG_BYT_FIRST / _SECOND determine which driver is preferred on BYT/CHT when both are enabled */ +#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) +#define FLAG_BYT_FIRST FLAG_SST +#define FLAG_BYT_SECOND FLAG_SOF +#elif IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) +#define FLAG_BYT_FIRST FLAG_SST +#elif IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) +#define FLAG_BYT_FIRST FLAG_SOF +#endif + /* * configuration table * - the order of similar ACPI ID entries is important! @@ -459,28 +469,28 @@ EXPORT_SYMBOL_GPL(snd_intel_dsp_driver_probe); */ static const struct config_entry acpi_config_table[] = { /* BayTrail */ -#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) +#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) || IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) { - .flags = FLAG_SST, + .flags = FLAG_BYT_FIRST, .acpi_hid = "80860F28", }, #endif -#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) +#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) { - .flags = FLAG_SOF, + .flags = FLAG_BYT_SECOND, .acpi_hid = "80860F28", }, #endif /* CherryTrail */ -#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) +#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) || IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) { - .flags = FLAG_SST, + .flags = FLAG_BYT_FIRST, .acpi_hid = "808622A8", }, #endif -#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) +#if IS_ENABLED(CONFIG_SND_SST_ATOM_HIFI2_PLATFORM_ACPI) && IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL) { - .flags = FLAG_SOF, + .flags = FLAG_BYT_SECOND, .acpi_hid = "808622A8", }, #endif