Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3131169rdb; Sat, 9 Dec 2023 12:41:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IGphNrbPbgG49+eUtcVIme6OW2MqyPrscStLXnc2jAa8UPrbuhpSTcbe1mVAJ0w3IgWH9XZ X-Received: by 2002:a05:6a20:a890:b0:18f:1d8b:fadc with SMTP id ca16-20020a056a20a89000b0018f1d8bfadcmr2598042pzb.19.1702154512459; Sat, 09 Dec 2023 12:41:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702154512; cv=none; d=google.com; s=arc-20160816; b=kOE+B6TtPl8dty6V+C9OPMdc2GGMw64cnjlcRzq2HsgopQBULaYhXHIVBEBTOTGemm vqhpULpnT/v3IxpGGkSto6jS2NlMw/4cxRTT4ou1xk4r4rj1V7w0eLcjH3MoaPrX+fTn NGucc1AxhPn/zqftk9i8nzkCR/hxis9PhhRhEFAi9wISnecgrNLgKdv7vhtmJOd4rYNh /5nFAIYWZMq07yjhO/Bjj/Hvm7TkMspbRxRvUUm+tsNNkpwR5wDI7Xlh/1ylReWuXmhW UV6lKYqmG6S6ifK0658a0oDUFvLQWYCvSG/vOKVc7eQ9m5tGYcLSJkLp37HIfEM8ICDL 39gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CS2SMbmYgBb5ypYFwXJ6bvwb0RvDIlgoTnYpIEf1mKI=; fh=dgKPqND1yeOHgkZYdqBEc/bnLAqKRm9rpHM8U4GA+Yk=; b=KrwVs8Lihf073osqIh7wna6ml5ywZgfbYKb5cLws1ya5ezJL4dqQY5IGR2ibm9B8XT XmQIep0UKZ31shS62rFFoKNQoA9XmbguQ8d94cXyQ6BEZlRMxEyPObtpB284wfvRmd/G dBWc6YOS3XAMq2UBHnCvxMoaGz6OMXbAgeNr2j8yuzcPRBu4A+WeNEDnr8dVw9x/sJfM JQcSf5yKR0ZyUz/neKyvksczHSYrC2AS3S990DNH11bz6+S5hS1O5K/B6uGhkMMjPIvc X8DXOfYPlKPiK2ux659kNr5P8L+NwTm0KSwSYKjHIF3UgKju0IYHq8ulXQC2tG0KPfw3 N/iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nlHLkOkF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m19-20020a656a13000000b005c663eae37asi3780838pgu.252.2023.12.09.12.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 12:41:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nlHLkOkF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A851F807C748; Sat, 9 Dec 2023 12:41:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230505AbjLIUke (ORCPT + 99 others); Sat, 9 Dec 2023 15:40:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230478AbjLIUk0 (ORCPT ); Sat, 9 Dec 2023 15:40:26 -0500 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14AD81A1; Sat, 9 Dec 2023 12:40:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702153980; bh=sIlCWiBKcvvpf7yqKhWxYi3/+vptlEShe0kQnwJBPzI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nlHLkOkFNVgGOwNF9ebHckGuk+HGEseeWGdr82SOBTEo9ncTuQ3tSZN3nmJAxt69u eLFVouyG9kBlerm5fP1CS4Iia9tOtxPtALoL9PYxXmocwLixkOCI9WakBILb6/mkd4 UIOsDT2RHppq0dwft8P4dSIe60qaPcCldIPA5rNzlnsezW0nfyxUn1IML7wEhek64M MdlgI7DBq07cjpSnT+lF4eq5UmXcwBWr6cVFNdEnL7adUgCTeGSf6K5g8Xg0f8pUvW XKmqOZ+Qf91kjNvRN8VNbw2rcyuzns/VR1ETO6SoxHqZ0Vi3qxO67nCUAZuiRs64V6 u1ZXjX++YqPUw== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 2A35B37813DB; Sat, 9 Dec 2023 20:33:00 +0000 (UTC) From: Cristian Ciocaltea To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Venkata Prasad Potturu , Marian Postevca , Vijendar Mukunda , Syed Saba Kareem , Alper Nebi Yasak , Kuninori Morimoto , Rander Wang , Pierre-Louis Bossart , Daniel Baluta , Ajit Kumar Pandey , Bard Liao , Kai Vehmanen Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: [PATCH 2/5] ASoC: amd: vangogh: Allow probing ACP PCI when SOF is disabled Date: Sat, 9 Dec 2023 22:32:20 +0200 Message-ID: <20231209203229.878730-3-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231209203229.878730-1-cristian.ciocaltea@collabora.com> References: <20231209203229.878730-1-cristian.ciocaltea@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 09 Dec 2023 12:41:22 -0800 (PST) Since commit e89f45edb747 ("ASoC: amd: vangogh: Add check for acp config flags in vangogh platform"), the Vangogh ACP PCI driver could not be used anymore for boards which happen to have a matching entry in acp-config list. Commit f18818eb0dbe ("ASoC: amd: vangogh: Add condition check for acp config flag") slightly changed the behaviour to permit loading the driver if AMD_LEGACY flag is set. However, for AMD_SOF flag the probing is still denied, even if SOF support is disabled in kernel configuration. While this helps preventing conflicts between SOF and generic ACP drivers, there are cases where a fallback to the generic non-SOF support would still be needed or useful, e.g. SOF firmware is not available or doesn't work properly, SOF driver is broken or doesn't provide full support for a particular hardware, or simply for testing/debugging the alternative solution. A real-life example is Steam Deck OLED, which works with both drivers. Prevent returning from probe() when ACP config indicates SOF support for the current board *and* the Vangogh SOF driver is not enabled in kernel configuration. Signed-off-by: Cristian Ciocaltea --- sound/soc/amd/vangogh/pci-acp5x.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/amd/vangogh/pci-acp5x.c b/sound/soc/amd/vangogh/pci-acp5x.c index 3826443d77b9..10755c07949c 100644 --- a/sound/soc/amd/vangogh/pci-acp5x.c +++ b/sound/soc/amd/vangogh/pci-acp5x.c @@ -130,9 +130,13 @@ static int snd_acp5x_probe(struct pci_dev *pci, int ret, i; u32 addr, val; - /* Return if acp config flag is defined */ + /* + * Return if ACP config flag is defined, except when board + * supports SOF while it is not being enabled in kernel config. + */ flag = snd_amd_acp_find_config(pci); - if (flag != FLAG_AMD_LEGACY) + if (flag != FLAG_AMD_LEGACY && + (flag != FLAG_AMD_SOF || IS_ENABLED(CONFIG_SND_SOC_SOF_AMD_VANGOGH))) return -ENODEV; irqflags = IRQF_SHARED; -- 2.43.0