[PATCH AUTOSEL 6.17-5.4] ASoC: pxa: add GPIOLIB_LEGACY dependency
Sasha Levin
sashal at kernel.org
Sat Oct 25 08:55:02 PDT 2025
From: Arnd Bergmann <arnd at arndb.de>
[ Upstream commit 2d86d2585ab929a143d1e6f8963da1499e33bf13 ]
The pxa27x platform uses the legacy gpiolib interfaces, including
in its sound drivers:
sound/arm/pxa2xx-ac97-lib.c: In function 'pxa2xx_ac97_hw_probe':
sound/arm/pxa2xx-ac97-lib.c:374:23: error: implicit declaration of function 'gpio_request_one' [-Wimplicit-function-declaration]
374 | ret = gpio_request_one(reset_gpio, GPIOF_OUT_INIT_HIGH,
Make sure we don't select those drivers for compile-testing unless
we are building for a pxa27x system, or CONFIG_GPIOLIB_LEGACY is
already enabled.
The SND_PXA_SOC_SSP driver accidentally used a dependency on PLAT_PXA,
which includes both ARCH_PXA and ARCH_MMP, but it is only used on
the former.
Signed-off-by: Arnd Bergmann <arnd at arndb.de>
Link: https://patch.msgid.link/20250808151822.536879-21-arnd@kernel.org
Signed-off-by: Mark Brown <broonie at kernel.org>
Signed-off-by: Sasha Levin <sashal at kernel.org>
---
LLM Generated explanations, may be completely bogus:
YES
Rationale
- Fixes a real build failure during COMPILE_TEST when legacy GPIO APIs
are disabled. The failure stems from `gpio_request_one()` in the PXA
AC97 support code: `sound/arm/pxa2xx-ac97-lib.c:374` uses legacy GPIO
(gpio_request_one/`GPIOF_OUT_INIT_HIGH`). When `GPIOLIB_LEGACY` is not
enabled, these legacy interfaces are not available, leading to the
implicit declaration error cited in the commit message.
- Targeted Kconfig gating avoids the bad configuration instead of
changing runtime code:
- `sound/soc/pxa/Kconfig:2` changes `SND_PXA2XX_SOC` from `depends on
ARCH_PXA || COMPILE_TEST` to `depends on ARCH_PXA || (COMPILE_TEST
&& GPIOLIB_LEGACY)`. This ensures the PXA SoC audio stack (which
selects `SND_PXA2XX_LIB_AC97` and builds `pxa2xx-ac97-lib.c`) is not
compile-tested unless legacy GPIO support is present, eliminating
the build break.
- `sound/soc/pxa/Kconfig:27` changes `SND_PXA_SOC_SSP` from `depends
on PLAT_PXA` to `depends on ARCH_PXA`. `PLAT_PXA` is selected by
both PXA and MMP (`drivers/soc/pxa/Kconfig:2`, selected in
`arch/arm/mach-pxa/Kconfig:13` and `arch/arm/mach-mmp/Kconfig:8`),
which caused the PXA-specific SSP DAI driver (`sound/soc/pxa/pxa-
ssp.c` includes `<linux/pxa2xx_ssp.h>`) to be selectable on MMP
inadvertently. Tightening to `ARCH_PXA` corrects that misdependency.
Why this suits stable
- Small, contained Kconfig-only change; no runtime behavior or ABI
change.
- Fixes a concrete build error affecting users of `COMPILE_TEST`
configurations without `GPIOLIB_LEGACY`.
- Reduces accidental driver enablement on the wrong SoC family (MMP) by
replacing `PLAT_PXA` with `ARCH_PXA` for `SND_PXA_SOC_SSP`.
- Minimal regression risk: only affects visibility of options under
specific Kconfig combinations. It does not introduce new features or
architectural changes.
Notes on applicability
- This backport is most relevant to stable series that already have the
`GPIOLIB_LEGACY` split. Older stable trees that predate
`GPIOLIB_LEGACY` either won’t need this change (no build break) or may
require adjusting the dependency accordingly.
sound/soc/pxa/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index e026f9912a6d1..e54abcd39f792 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -3,7 +3,7 @@ menu "PXA"
config SND_PXA2XX_SOC
tristate "SoC Audio for the Intel PXA2xx chip"
- depends on ARCH_PXA || COMPILE_TEST
+ depends on ARCH_PXA || (COMPILE_TEST && GPIOLIB_LEGACY)
select SND_PXA2XX_LIB
help
Say Y or M if you want to add support for codecs attached to
@@ -26,7 +26,7 @@ config SND_PXA2XX_SOC_I2S
config SND_PXA_SOC_SSP
tristate "Soc Audio via PXA2xx/PXA3xx SSP ports"
- depends on PLAT_PXA
+ depends on ARCH_PXA
select PXA_SSP
select SND_PXA2XX_LIB
--
2.51.0
More information about the linux-arm-kernel
mailing list