From: Arnd Bergmann <arnd@kernel.org>
To: Liam Girdwood <lgirdwood@gmail.com>,
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Daniel Baluta <daniel.baluta@nxp.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Mario Limonciello <mario.limonciello@amd.com>,
sound-open-firmware@alsa-project.org,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ASoC: SOF: amd: fix building without CONFIG_ACPI
Date: Fri, 25 Sep 2026 15:10:57 +0200 [thread overview]
Message-ID: <20260925131104.118993-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
When ACPI is disabled, this driver runs into a build failure:
sound/soc/sof/amd/acp.c:1374:13: error: call to undeclared function 'acpi_find_child_device'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1374 | pdm_dev = acpi_find_child_device(adev, ACP7X_DMIC_ADDR, 0);
The code block is already guarded by an 'if (adev)' check that
can only be true if ACPI is enabled, so add another #ifdef
to match this.
Fixes: 203ea76c4b0a ("ASoC: SOF: amd: add ACP7.B/7.F PDM controller scan and pdata propagation")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I also tried adding ACPI Kconfig dependencies, but that quickly
got out of hand since the acp module is selected by a number of
drivers that then all need the same dependency.
It may be possible to work around this in the ACPI code by adding
a stub macro for acpi_find_child_device() that does nothing.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
sound/soc/sof/amd/acp.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index b059039c9e0d..4b2d7cb244c9 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -1059,6 +1059,7 @@ int amd_sof_acp_resume(struct snd_sof_dev *sdev)
}
EXPORT_SYMBOL_NS(amd_sof_acp_resume, "SND_SOC_SOF_AMD_COMMON");
+#ifdef CONFIG_ACPI
static void acp_sof_scan_pdm_devices(struct snd_sof_dev *sdev,
struct acpi_device *pdm_dev)
{
@@ -1083,6 +1084,7 @@ static void acp_sof_scan_pdm_devices(struct snd_sof_dev *sdev,
}
fwnode_handle_put(child);
}
+#endif
#if IS_ENABLED(CONFIG_SND_SOC_SOF_AMD_SOUNDWIRE)
static int acp_sof_scan_sdw_devices(struct snd_sof_dev *sdev, u64 addr)
@@ -1299,9 +1301,7 @@ int amd_sof_acp7x_probe(struct snd_sof_dev *sdev)
struct pci_dev *pci = to_pci_dev(sdev->dev);
struct acp_dev_data *adata;
const struct sof_amd_acp_desc *chip;
- const union acpi_object *obj;
struct acpi_device *adev;
- struct acpi_device *pdm_dev;
unsigned int addr;
unsigned int irqflags;
int ret;
@@ -1369,7 +1369,11 @@ int amd_sof_acp7x_probe(struct snd_sof_dev *sdev)
adata->is_sdw_dev = true;
skip_soundwire:
+#ifdef CONFIG_ACPI
if (adev) {
+ struct acpi_device *pdm_dev;
+ const union acpi_object *obj;
+
/* DMIC ACPI child address is 2 on ACP7x platforms */
pdm_dev = acpi_find_child_device(adev, ACP7X_DMIC_ADDR, 0);
if (pdm_dev)
@@ -1379,6 +1383,7 @@ int amd_sof_acp7x_probe(struct snd_sof_dev *sdev)
ACPI_TYPE_INTEGER, &obj))
adata->acp_sof_signed_firmware_image = obj->integer.value;
}
+#endif
sdev->dsp_box.offset = 0;
sdev->dsp_box.size = BOX_SIZE_512;
--
2.53.0
next reply other threads:[~2026-09-25 13:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 13:10 Arnd Bergmann [this message]
2026-09-25 13:32 ` [PATCH] ASoC: SOF: amd: fix building without CONFIG_ACPI Mario Limonciello
2026-09-25 16:37 ` Mukunda,Vijendar
2026-09-25 18:10 ` Arnd Bergmann
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=20260925131104.118993-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=Vijendar.Mukunda@amd.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=sound-open-firmware@alsa-project.org \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.