From: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Venkata Prasad Potturu <venkataprasad.potturu@amd.com>,
Marian Postevca <posteuca@mutex.one>,
Vijendar Mukunda <Vijendar.Mukunda@amd.com>,
Syed Saba Kareem <Syed.SabaKareem@amd.com>,
Alper Nebi Yasak <alpernebiyasak@gmail.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Rander Wang <rander.wang@intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>,
Bard Liao <bard.liao@intel.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>
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 [thread overview]
Message-ID: <20231209203229.878730-3-cristian.ciocaltea@collabora.com> (raw)
In-Reply-To: <20231209203229.878730-1-cristian.ciocaltea@collabora.com>
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 <cristian.ciocaltea@collabora.com>
---
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
next prev parent reply other threads:[~2023-12-09 20:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-09 20:32 [PATCH 0/5] Improve AMD ACP Vangogh audio support for Steam Deck OLED Cristian Ciocaltea
2023-12-09 20:32 ` [PATCH 1/5] ASoC: amd: vangogh: Drop conflicting ACPI-based probing Cristian Ciocaltea
2023-12-09 20:32 ` Cristian Ciocaltea [this message]
2023-12-09 20:32 ` [PATCH 3/5] ASoC: amd: vangogh: Switch to {RUNTIME,SYSTEM_SLEEP}_PM_OPS Cristian Ciocaltea
2023-12-09 20:32 ` [PATCH 4/5] ASoC: amd: acp-config: Add missing MODULE_DESCRIPTION Cristian Ciocaltea
2023-12-09 20:32 ` [PATCH 5/5] ASoC: amd: acp: Add missing MODULE_DESCRIPTION in mach-common Cristian Ciocaltea
2023-12-11 15:12 ` [PATCH 0/5] Improve AMD ACP Vangogh audio support for Steam Deck OLED Emil Velikov
2023-12-11 17:04 ` Cristian Ciocaltea
2023-12-19 18:06 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231209203229.878730-3-cristian.ciocaltea@collabora.com \
--to=cristian.ciocaltea@collabora.com \
--cc=AjitKumar.Pandey@amd.com \
--cc=Syed.SabaKareem@amd.com \
--cc=Vijendar.Mukunda@amd.com \
--cc=alpernebiyasak@gmail.com \
--cc=bard.liao@intel.com \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=kernel@collabora.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=posteuca@mutex.one \
--cc=rander.wang@intel.com \
--cc=tiwai@suse.com \
--cc=venkataprasad.potturu@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®