diff mbox series

[1/1] snd: enable building max98357a driver with ACPIGEN=n

Message ID 20220612131305.22515-1-xypron.glpk@gmx.de
State Accepted
Commit 3ca32c806b266d8fb0a3f4d7b8c7f6ef75f43cb3
Delegated to: Tom Rini
Headers show
Series [1/1] snd: enable building max98357a driver with ACPIGEN=n | expand

Commit Message

Heinrich Schuchardt June 12, 2022, 1:13 p.m. UTC
sandbox_defconfig builds the max98357a driver. It should be possible to
build the sandbox without ACPI support.

ACPI support in the max98357a driver is only needed when creating an ACPI
table. Fix building with ACPIGEN=n.

Fixes: 54bcca29737f ("sound: Add an ACPI driver for Maxim MAX98357ac")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/sound/max98357a.c | 3 +++
 1 file changed, 3 insertions(+)

--
2.36.1

Comments

Tom Rini July 8, 2022, 4:38 p.m. UTC | #1
On Sun, Jun 12, 2022 at 01:13:05PM +0000, Heinrich Schuchardt wrote:

> sandbox_defconfig builds the max98357a driver. It should be possible to
> build the sandbox without ACPI support.
> 
> ACPI support in the max98357a driver is only needed when creating an ACPI
> table. Fix building with ACPIGEN=n.
> 
> Fixes: 54bcca29737f ("sound: Add an ACPI driver for Maxim MAX98357ac")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/drivers/sound/max98357a.c b/drivers/sound/max98357a.c
index a2088f0301..bdf6dc236e 100644
--- a/drivers/sound/max98357a.c
+++ b/drivers/sound/max98357a.c
@@ -38,6 +38,7 @@  static int max98357a_of_to_plat(struct udevice *dev)
 	return 0;
 }

+__maybe_unused
 static int max98357a_acpi_fill_ssdt(const struct udevice *dev,
 				    struct acpi_ctx *ctx)
 {
@@ -137,10 +138,12 @@  static int max98357a_acpi_setup_nhlt(const struct udevice *dev,
 #endif

 struct acpi_ops max98357a_acpi_ops = {
+#ifdef CONFIG_ACPIGEN
 	.fill_ssdt	= max98357a_acpi_fill_ssdt,
 #ifdef CONFIG_X86
 	.setup_nhlt	= max98357a_acpi_setup_nhlt,
 #endif
+#endif
 };

 static const struct audio_codec_ops max98357a_ops = {