* [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing
@ 2026-05-05 20:24 Arnd Bergmann
2026-05-05 20:24 ` [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code Arnd Bergmann
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Arnd Bergmann @ 2026-05-05 20:24 UTC (permalink / raw)
To: Mark Brown, Daniel Mack, Haojian Zhuang, Robert Jarzmik
Cc: Jaroslav Kysela, Takashi Iwai, Andy Shevchenko, linux-arm-kernel,
linux-kernel, linux-sound, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
Nothing ever sets pxa2xx_audio_ops_t since the last users were removed
in ce79f3a1ad5f ("ARM: pxa: prune unused device support") , so stop
passing it around through the sound, ac97 code.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/linux/platform_data/asoc-pxa.h | 21 ---------------------
include/sound/ac97/codec.h | 5 ++++-
include/sound/ac97/controller.h | 5 ++---
sound/ac97/bus.c | 26 ++------------------------
sound/soc/pxa/pxa2xx-ac97.c | 3 +--
5 files changed, 9 insertions(+), 51 deletions(-)
diff --git a/include/linux/platform_data/asoc-pxa.h b/include/linux/platform_data/asoc-pxa.h
index 7b5b9e20fbf5..7df78867db49 100644
--- a/include/linux/platform_data/asoc-pxa.h
+++ b/include/linux/platform_data/asoc-pxa.h
@@ -6,27 +6,6 @@
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
-/*
- * @reset_gpio: AC97 reset gpio (normally gpio113 or gpio95)
- * a -1 value means no gpio will be used for reset
- * @codec_pdata: AC97 codec platform_data
-
- * reset_gpio should only be specified for pxa27x CPUs where a silicon
- * bug prevents correct operation of the reset line. If not specified,
- * the default behaviour on these CPUs is to consider gpio 113 as the
- * AC97 reset line, which is the default on most boards.
- */
-typedef struct {
- int (*startup)(struct snd_pcm_substream *, void *);
- void (*shutdown)(struct snd_pcm_substream *, void *);
- void (*suspend)(void *);
- void (*resume)(void *);
- void *priv;
- int reset_gpio;
- void *codec_pdata[AC97_BUS_MAX_DEVICES];
-} pxa2xx_audio_ops_t;
-
-extern void pxa_set_ac97_info(pxa2xx_audio_ops_t *ops);
extern void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio);
#endif
diff --git a/include/sound/ac97/codec.h b/include/sound/ac97/codec.h
index 882b849b9255..69b404c354f5 100644
--- a/include/sound/ac97/codec.h
+++ b/include/sound/ac97/codec.h
@@ -108,6 +108,9 @@ static inline void ac97_set_drvdata(struct ac97_codec_device *adev,
dev_set_drvdata(ac97_codec_dev2dev(adev), data);
}
-void *snd_ac97_codec_get_platdata(const struct ac97_codec_device *adev);
+static inline void *snd_ac97_codec_get_platdata(const struct ac97_codec_device *adev)
+{
+ return NULL;
+}
#endif
diff --git a/include/sound/ac97/controller.h b/include/sound/ac97/controller.h
index 06b5afb7fa6b..d5895ea3922b 100644
--- a/include/sound/ac97/controller.h
+++ b/include/sound/ac97/controller.h
@@ -62,14 +62,13 @@ struct ac97_controller_ops {
#if IS_ENABLED(CONFIG_AC97_BUS_NEW)
struct ac97_controller *snd_ac97_controller_register(
const struct ac97_controller_ops *ops, struct device *dev,
- unsigned short slots_available, void **codecs_pdata);
+ unsigned short slots_available);
void snd_ac97_controller_unregister(struct ac97_controller *ac97_ctrl);
#else
static inline struct ac97_controller *
snd_ac97_controller_register(const struct ac97_controller_ops *ops,
struct device *dev,
- unsigned short slots_available,
- void **codecs_pdata)
+ unsigned short slots_available)
{
return ERR_PTR(-ENODEV);
}
diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c
index 15487837e894..a4d230a19c56 100644
--- a/sound/ac97/bus.c
+++ b/sound/ac97/bus.c
@@ -206,24 +206,6 @@ void snd_ac97_codec_driver_unregister(struct ac97_codec_driver *drv)
}
EXPORT_SYMBOL_GPL(snd_ac97_codec_driver_unregister);
-/**
- * snd_ac97_codec_get_platdata - get platform_data
- * @adev: the ac97 codec device
- *
- * For legacy platforms, in order to have platform_data in codec drivers
- * available, while ac97 device are auto-created upon probe, this retrieves the
- * platdata which was setup on ac97 controller registration.
- *
- * Returns the platform data pointer
- */
-void *snd_ac97_codec_get_platdata(const struct ac97_codec_device *adev)
-{
- struct ac97_controller *ac97_ctrl = adev->ac97_ctrl;
-
- return ac97_ctrl->codecs_pdata[adev->num];
-}
-EXPORT_SYMBOL_GPL(snd_ac97_codec_get_platdata);
-
static void ac97_ctrl_codecs_unregister(struct ac97_controller *ac97_ctrl)
{
int i;
@@ -337,7 +319,6 @@ static int ac97_add_adapter(struct ac97_controller *ac97_ctrl)
* @dev: the device providing the ac97 DC function
* @slots_available: mask of the ac97 codecs that can be scanned and probed
* bit0 => codec 0, bit1 => codec 1 ... bit 3 => codec 3
- * @codecs_pdata: codec platform data
*
* Register a digital controller which can control up to 4 ac97 codecs. This is
* the controller side of the AC97 AC-link, while the slave side are the codecs.
@@ -346,18 +327,15 @@ static int ac97_add_adapter(struct ac97_controller *ac97_ctrl)
*/
struct ac97_controller *snd_ac97_controller_register(
const struct ac97_controller_ops *ops, struct device *dev,
- unsigned short slots_available, void **codecs_pdata)
+ unsigned short slots_available)
{
struct ac97_controller *ac97_ctrl;
- int ret, i;
+ int ret;
ac97_ctrl = kzalloc_obj(*ac97_ctrl);
if (!ac97_ctrl)
return ERR_PTR(-ENOMEM);
- for (i = 0; i < AC97_BUS_MAX_CODECS && codecs_pdata; i++)
- ac97_ctrl->codecs_pdata[i] = codecs_pdata[i];
-
ac97_ctrl->ops = ops;
ac97_ctrl->slots_available = slots_available;
ac97_ctrl->parent = dev;
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index a0c672602918..b0b1293bc849 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -246,8 +246,7 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)
}
ctrl = snd_ac97_controller_register(&pxa2xx_ac97_ops, &pdev->dev,
- AC97_SLOTS_AVAILABLE_ALL,
- NULL);
+ AC97_SLOTS_AVAILABLE_ALL);
if (IS_ERR(ctrl))
return PTR_ERR(ctrl);
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code
2026-05-05 20:24 [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing Arnd Bergmann
@ 2026-05-05 20:24 ` Arnd Bergmann
2026-05-05 23:58 ` Mark Brown
2026-05-06 8:13 ` Andy Shevchenko
2026-05-05 20:24 ` [PATCH v2 3/3] ASoC: pxa: integrate sound/arm/pxa2xx into sound/soc/pxa2xx Arnd Bergmann
2026-05-06 1:14 ` [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing Mark Brown
2 siblings, 2 replies; 7+ messages in thread
From: Arnd Bergmann @ 2026-05-05 20:24 UTC (permalink / raw)
To: Mark Brown, Daniel Mack, Haojian Zhuang, Robert Jarzmik
Cc: Jaroslav Kysela, Takashi Iwai, Andy Shevchenko, linux-arm-kernel,
linux-kernel, linux-sound, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
There are no remaining static platform_device users of pxa2xx ac97,
so the rest of that code path can go away as well.
Since nothing in the driver uses the gpio number now, constrain the use
of the legacy gpio interface to the architecture specific code.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/arm/mach-pxa/pxa27x.c | 9 +++++++-
include/linux/platform_data/asoc-pxa.h | 2 +-
sound/arm/pxa2xx-ac97-lib.c | 29 ++++++++------------------
3 files changed, 18 insertions(+), 22 deletions(-)
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index ff6361979038..c588eeea1485 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -58,8 +58,15 @@ static unsigned long ac97_reset_config[] = {
GPIO95_AC97_nRESET,
};
-void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio)
+void pxa27x_configure_ac97reset(struct gpio_desc *gpiod, bool to_gpio)
{
+ int reset_gpio;
+
+ if (!gpiod)
+ return;
+
+ reset_gpio = desc_to_gpio(gpiod);
+
/*
* This helper function is used to work around a bug in the pxa27x's
* ac97 controller during a warm reset. The configuration of the
diff --git a/include/linux/platform_data/asoc-pxa.h b/include/linux/platform_data/asoc-pxa.h
index 7df78867db49..0d5eaf4b100c 100644
--- a/include/linux/platform_data/asoc-pxa.h
+++ b/include/linux/platform_data/asoc-pxa.h
@@ -6,6 +6,6 @@
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
-extern void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio);
+extern void pxa27x_configure_ac97reset(struct gpio_desc *reset_gpio, bool to_gpio);
#endif
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
index 79eb557d4942..87e0d6b1e160 100644
--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/arm/pxa2xx-ac97-lib.c
@@ -29,7 +29,6 @@ static DECLARE_WAIT_QUEUE_HEAD(gsr_wq);
static volatile long gsr_bits;
static struct clk *ac97_clk;
static struct clk *ac97conf_clk;
-static int reset_gpio;
struct gpio_desc *rst_gpio;
static void __iomem *ac97_reg_base;
@@ -140,10 +139,10 @@ static inline void pxa_ac97_warm_pxa27x(void)
gsr_bits = 0;
/* warm reset broken on Bulverde, so manually keep AC97 reset high */
- pxa27x_configure_ac97reset(reset_gpio, true);
+ pxa27x_configure_ac97reset(rst_gpio, true);
udelay(10);
writel(readl(ac97_reg_base + GCR) | (GCR_WARM_RST), ac97_reg_base + GCR);
- pxa27x_configure_ac97reset(reset_gpio, false);
+ pxa27x_configure_ac97reset(rst_gpio, false);
udelay(500);
}
@@ -328,24 +327,14 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)
return PTR_ERR(ac97_reg_base);
}
- if (dev->dev.of_node) {
+ if (cpu_is_pxa27x()) {
/* Assert reset using GPIOD_OUT_HIGH, because reset is GPIO_ACTIVE_LOW */
- rst_gpio = devm_gpiod_get(&dev->dev, "reset", GPIOD_OUT_HIGH);
- if (IS_ERR(rst_gpio)) {
- ret = PTR_ERR(rst_gpio);
- if (ret == -ENOENT)
- reset_gpio = -1;
- else if (ret)
- return ret;
- } else {
- reset_gpio = desc_to_gpio(rst_gpio);
- }
- } else {
- if (cpu_is_pxa27x())
- reset_gpio = 113;
- }
+ rst_gpio = devm_gpiod_get_optional(&dev->dev, "reset",
+ GPIOD_OUT_HIGH);
+ if (IS_ERR(rst_gpio))
+ return dev_err_probe(&dev->dev, PTR_ERR(rst_gpio),
+ "reset gpio failed\n");
- if (cpu_is_pxa27x()) {
/*
* This gpio is needed for a work-around to a bug in the ac97
* controller during warm reset. The direction and level is set
@@ -353,7 +342,7 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)
* AC97_nRESET alt function to generic gpio.
*/
gpiod_set_consumer_name(rst_gpio, "pxa27x ac97 reset");
- pxa27x_configure_ac97reset(reset_gpio, false);
+ pxa27x_configure_ac97reset(rst_gpio, false);
ac97conf_clk = clk_get(&dev->dev, "AC97CONFCLK");
if (IS_ERR(ac97conf_clk)) {
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] ASoC: pxa: integrate sound/arm/pxa2xx into sound/soc/pxa2xx
2026-05-05 20:24 [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing Arnd Bergmann
2026-05-05 20:24 ` [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code Arnd Bergmann
@ 2026-05-05 20:24 ` Arnd Bergmann
2026-05-06 1:14 ` [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing Mark Brown
2 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2026-05-05 20:24 UTC (permalink / raw)
To: Mark Brown, Daniel Mack, Haojian Zhuang, Robert Jarzmik
Cc: Jaroslav Kysela, Takashi Iwai, Andy Shevchenko, linux-arm-kernel,
linux-kernel, linux-sound, Arnd Bergmann
From: Arnd Bergmann <arnd@arndb.de>
The pxa2xx sound library modules are only used by the ASoC driver since
commit b094de7810f3 ("ASoC: codec: Remove pxa2xx-ac97.c"), so move the
code into the one module that uses as a simpliciation.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
include/sound/pxa2xx-lib.h | 50 +----------------------
sound/arm/Kconfig | 7 ----
sound/arm/Makefile | 4 --
sound/soc/pxa/Kconfig | 6 +++
sound/soc/pxa/Makefile | 4 +-
sound/soc/pxa/mmp-sspa.c | 2 +-
sound/soc/pxa/pxa-ssp.c | 2 +-
sound/{arm => soc/pxa}/pxa2xx-ac97-lib.c | 10 +----
sound/{arm => soc/pxa}/pxa2xx-ac97-regs.h | 0
sound/soc/pxa/pxa2xx-ac97.c | 3 +-
sound/soc/pxa/pxa2xx-i2s.c | 2 +-
sound/soc/pxa/pxa2xx-lib.h | 45 ++++++++++++++++++++
sound/{arm => soc/pxa}/pxa2xx-pcm-lib.c | 26 +++++-------
sound/soc/pxa/pxa2xx-pcm.c | 3 +-
14 files changed, 73 insertions(+), 91 deletions(-)
rename sound/{arm => soc/pxa}/pxa2xx-ac97-lib.c (96%)
rename sound/{arm => soc/pxa}/pxa2xx-ac97-regs.h (100%)
create mode 100644 sound/soc/pxa/pxa2xx-lib.h
rename sound/{arm => soc/pxa}/pxa2xx-pcm-lib.c (86%)
diff --git a/include/sound/pxa2xx-lib.h b/include/sound/pxa2xx-lib.h
index 0a6f8dabf8c4..2d86f62f9408 100644
--- a/include/sound/pxa2xx-lib.h
+++ b/include/sound/pxa2xx-lib.h
@@ -2,55 +2,7 @@
#ifndef PXA2XX_LIB_H
#define PXA2XX_LIB_H
-#include <uapi/sound/asound.h>
-#include <linux/platform_device.h>
-
-/* PCM */
-struct snd_pcm_substream;
-struct snd_pcm_hw_params;
-struct snd_soc_pcm_runtime;
-struct snd_pcm;
-struct snd_soc_component;
-
-extern int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params);
-extern int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd);
-extern snd_pcm_uframes_t pxa2xx_pcm_pointer(struct snd_pcm_substream *substream);
-extern int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream);
-extern int pxa2xx_pcm_open(struct snd_pcm_substream *substream);
-extern int pxa2xx_pcm_close(struct snd_pcm_substream *substream);
-extern int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm);
-extern int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
- struct snd_soc_pcm_runtime *rtd);
-extern int pxa2xx_soc_pcm_open(struct snd_soc_component *component,
- struct snd_pcm_substream *substream);
-extern int pxa2xx_soc_pcm_close(struct snd_soc_component *component,
- struct snd_pcm_substream *substream);
-extern int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component,
- struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params);
-extern int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component,
- struct snd_pcm_substream *substream);
-extern int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component,
- struct snd_pcm_substream *substream, int cmd);
-extern snd_pcm_uframes_t
-pxa2xx_soc_pcm_pointer(struct snd_soc_component *component,
- struct snd_pcm_substream *substream);
-
-/* AC97 */
-
-extern int pxa2xx_ac97_read(int slot, unsigned short reg);
-extern int pxa2xx_ac97_write(int slot, unsigned short reg, unsigned short val);
-
-extern bool pxa2xx_ac97_try_warm_reset(void);
-extern bool pxa2xx_ac97_try_cold_reset(void);
-extern void pxa2xx_ac97_finish_reset(void);
-
-extern int pxa2xx_ac97_hw_suspend(void);
-extern int pxa2xx_ac97_hw_resume(void);
-
-extern int pxa2xx_ac97_hw_probe(struct platform_device *dev);
-extern void pxa2xx_ac97_hw_remove(struct platform_device *dev);
+#include <linux/types.h>
/* modem registers, used by touchscreen driver */
u32 pxa2xx_ac97_read_modr(void);
diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig
index e4d7288d1e1e..09054ce8074f 100644
--- a/sound/arm/Kconfig
+++ b/sound/arm/Kconfig
@@ -19,10 +19,3 @@ config SND_ARMAACI
select SND_AC97_CODEC
endif # SND_ARM
-
-config SND_PXA2XX_LIB
- tristate
- select SND_DMAENGINE_PCM
-
-config SND_PXA2XX_LIB_AC97
- bool
diff --git a/sound/arm/Makefile b/sound/arm/Makefile
index 99325a66cf77..6b91eb796b9b 100644
--- a/sound/arm/Makefile
+++ b/sound/arm/Makefile
@@ -5,7 +5,3 @@
obj-$(CONFIG_SND_ARMAACI) += snd-aaci.o
snd-aaci-y := aaci.o
-
-obj-$(CONFIG_SND_PXA2XX_LIB) += snd-pxa2xx-lib.o
-snd-pxa2xx-lib-y := pxa2xx-pcm-lib.o
-snd-pxa2xx-lib-$(CONFIG_SND_PXA2XX_LIB_AC97) += pxa2xx-ac97-lib.o
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig
index 4bd14ae330d5..2788514be6b1 100644
--- a/sound/soc/pxa/Kconfig
+++ b/sound/soc/pxa/Kconfig
@@ -54,4 +54,10 @@ config SND_PXA910_SOC
Say Y if you want to add support for SoC audio on the
Marvell PXA910 reference platform.
+config SND_PXA2XX_LIB
+ tristate
+ select SND_DMAENGINE_PCM
+
+config SND_PXA2XX_LIB_AC97
+ bool
endmenu
diff --git a/sound/soc/pxa/Makefile b/sound/soc/pxa/Makefile
index 93b4e57eaa5c..bf504a85657c 100644
--- a/sound/soc/pxa/Makefile
+++ b/sound/soc/pxa/Makefile
@@ -1,8 +1,9 @@
# SPDX-License-Identifier: GPL-2.0
# PXA Platform Support
snd-soc-pxa2xx-y := pxa2xx-pcm.o
-snd-soc-pxa2xx-ac97-y := pxa2xx-ac97.o
+snd-soc-pxa2xx-ac97-y := pxa2xx-ac97.o pxa2xx-ac97-lib.o
snd-soc-pxa2xx-i2s-y := pxa2xx-i2s.o
+snd-soc-pxa2xx-lib-y := pxa2xx-pcm-lib.o
snd-soc-pxa-ssp-y := pxa-ssp.o
snd-soc-mmp-sspa-y := mmp-sspa.o
@@ -11,6 +12,7 @@ obj-$(CONFIG_SND_PXA2XX_SOC_AC97) += snd-soc-pxa2xx-ac97.o
obj-$(CONFIG_SND_PXA2XX_SOC_I2S) += snd-soc-pxa2xx-i2s.o
obj-$(CONFIG_SND_PXA_SOC_SSP) += snd-soc-pxa-ssp.o
obj-$(CONFIG_SND_MMP_SOC_SSPA) += snd-soc-mmp-sspa.o
+obj-$(CONFIG_SND_PXA2XX_LIB) += snd-soc-pxa2xx-lib.o
# PXA Machine Support
snd-soc-spitz-y := spitz.o
diff --git a/sound/soc/pxa/mmp-sspa.c b/sound/soc/pxa/mmp-sspa.c
index 73f36c9dd35c..fbbce81680cf 100644
--- a/sound/soc/pxa/mmp-sspa.c
+++ b/sound/soc/pxa/mmp-sspa.c
@@ -20,8 +20,8 @@
#include <sound/initval.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
+#include "pxa2xx-lib.h"
#include "mmp-sspa.h"
/*
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index 37bd8dbd541f..f8054c1c59fa 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -27,9 +27,9 @@
#include <sound/initval.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
+#include "pxa2xx-lib.h"
#include "pxa-ssp.h"
/*
diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/soc/pxa/pxa2xx-ac97-lib.c
similarity index 96%
rename from sound/arm/pxa2xx-ac97-lib.c
rename to sound/soc/pxa/pxa2xx-ac97-lib.c
index 87e0d6b1e160..d9c3935636da 100644
--- a/sound/arm/pxa2xx-ac97-lib.c
+++ b/sound/soc/pxa/pxa2xx-ac97-lib.c
@@ -23,6 +23,7 @@
#include <linux/platform_data/asoc-pxa.h>
#include "pxa2xx-ac97-regs.h"
+#include "pxa2xx-lib.h"
static DEFINE_MUTEX(car_mutex);
static DECLARE_WAIT_QUEUE_HEAD(gsr_wq);
@@ -82,7 +83,6 @@ int pxa2xx_ac97_read(int slot, unsigned short reg)
wait_event_timeout(gsr_wq, (readl(ac97_reg_base + GSR) | gsr_bits) & GSR_SDONE, 1);
return val;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_read);
int pxa2xx_ac97_write(int slot, unsigned short reg, unsigned short val)
{
@@ -112,7 +112,6 @@ int pxa2xx_ac97_write(int slot, unsigned short reg, unsigned short val)
return ret;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_write);
#ifdef CONFIG_PXA25x
static inline void pxa_ac97_warm_pxa25x(void)
@@ -225,7 +224,6 @@ bool pxa2xx_ac97_try_warm_reset(void)
return true;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_warm_reset);
bool pxa2xx_ac97_try_cold_reset(void)
{
@@ -262,7 +260,6 @@ bool pxa2xx_ac97_try_cold_reset(void)
return true;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_cold_reset);
void pxa2xx_ac97_finish_reset(void)
@@ -272,7 +269,6 @@ void pxa2xx_ac97_finish_reset(void)
gcr |= GCR_SDONE_IE|GCR_CDONE_IE;
writel(gcr, ac97_reg_base + GCR);
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_finish_reset);
static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id)
{
@@ -306,14 +302,12 @@ int pxa2xx_ac97_hw_suspend(void)
clk_disable_unprepare(ac97_clk);
return 0;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_suspend);
int pxa2xx_ac97_hw_resume(void)
{
clk_prepare_enable(ac97_clk);
return 0;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume);
#endif
int pxa2xx_ac97_hw_probe(struct platform_device *dev)
@@ -388,7 +382,6 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)
err_conf:
return ret;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_probe);
void pxa2xx_ac97_hw_remove(struct platform_device *dev)
{
@@ -402,7 +395,6 @@ void pxa2xx_ac97_hw_remove(struct platform_device *dev)
clk_put(ac97_clk);
ac97_clk = NULL;
}
-EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_remove);
u32 pxa2xx_ac97_read_modr(void)
{
diff --git a/sound/arm/pxa2xx-ac97-regs.h b/sound/soc/pxa/pxa2xx-ac97-regs.h
similarity index 100%
rename from sound/arm/pxa2xx-ac97-regs.h
rename to sound/soc/pxa/pxa2xx-ac97-regs.h
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index b0b1293bc849..7b9036947dfc 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -18,11 +18,12 @@
#include <sound/core.h>
#include <sound/ac97_codec.h>
#include <sound/soc.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
#include <linux/platform_data/asoc-pxa.h>
+#include "pxa2xx-lib.h"
+
#define PCDR 0x0040 /* PCM FIFO Data Register */
#define MODR 0x0140 /* Modem FIFO Data Register */
#define MCDR 0x0060 /* Mic-in FIFO Data Register */
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index f6ada6cffc88..fe1df78926f5 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -18,11 +18,11 @@
#include <sound/pcm.h>
#include <sound/initval.h>
#include <sound/soc.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
#include <linux/platform_data/asoc-pxa.h>
+#include "pxa2xx-lib.h"
#include "pxa2xx-i2s.h"
/*
diff --git a/sound/soc/pxa/pxa2xx-lib.h b/sound/soc/pxa/pxa2xx-lib.h
new file mode 100644
index 000000000000..3a9d6ac8d367
--- /dev/null
+++ b/sound/soc/pxa/pxa2xx-lib.h
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __PXA2XX_LIB_H
+#define __PXA2XX_LIB_H
+
+#include <uapi/sound/asound.h>
+#include <linux/platform_device.h>
+
+/* PCM */
+struct snd_pcm_substream;
+struct snd_pcm_hw_params;
+struct snd_soc_pcm_runtime;
+struct snd_pcm;
+struct snd_soc_component;
+
+int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
+ struct snd_soc_pcm_runtime *rtd);
+int pxa2xx_soc_pcm_open(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream);
+int pxa2xx_soc_pcm_close(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream);
+int pxa2xx_soc_pcm_hw_params(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params);
+int pxa2xx_soc_pcm_prepare(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream);
+int pxa2xx_soc_pcm_trigger(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream, int cmd);
+snd_pcm_uframes_t pxa2xx_soc_pcm_pointer(struct snd_soc_component *component,
+ struct snd_pcm_substream *substream);
+
+/* AC97 */
+int pxa2xx_ac97_read(int slot, unsigned short reg);
+int pxa2xx_ac97_write(int slot, unsigned short reg, unsigned short val);
+
+bool pxa2xx_ac97_try_warm_reset(void);
+bool pxa2xx_ac97_try_cold_reset(void);
+void pxa2xx_ac97_finish_reset(void);
+
+int pxa2xx_ac97_hw_suspend(void);
+int pxa2xx_ac97_hw_resume(void);
+
+int pxa2xx_ac97_hw_probe(struct platform_device *dev);
+void pxa2xx_ac97_hw_remove(struct platform_device *dev);
+
+#endif
diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/soc/pxa/pxa2xx-pcm-lib.c
similarity index 86%
rename from sound/arm/pxa2xx-pcm-lib.c
rename to sound/soc/pxa/pxa2xx-pcm-lib.c
index 571e9d909cdf..88a9d3226302 100644
--- a/sound/arm/pxa2xx-pcm-lib.c
+++ b/sound/soc/pxa/pxa2xx-pcm-lib.c
@@ -9,9 +9,10 @@
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
+#include "pxa2xx-lib.h"
+
static const struct snd_pcm_hardware pxa2xx_pcm_hardware = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -29,8 +30,8 @@ static const struct snd_pcm_hardware pxa2xx_pcm_hardware = {
.fifo_size = 32,
};
-int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params)
+static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
{
struct dma_chan *chan = snd_dmaengine_pcm_get_chan(substream);
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
@@ -56,28 +57,24 @@ int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
return 0;
}
-EXPORT_SYMBOL(pxa2xx_pcm_hw_params);
-int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
+static int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
{
return snd_dmaengine_pcm_trigger(substream, cmd);
}
-EXPORT_SYMBOL(pxa2xx_pcm_trigger);
-snd_pcm_uframes_t
+static snd_pcm_uframes_t
pxa2xx_pcm_pointer(struct snd_pcm_substream *substream)
{
return snd_dmaengine_pcm_pointer(substream);
}
-EXPORT_SYMBOL(pxa2xx_pcm_pointer);
-int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream)
+static int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream)
{
return 0;
}
-EXPORT_SYMBOL(pxa2xx_pcm_prepare);
-int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
+static int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
@@ -114,22 +111,19 @@ int pxa2xx_pcm_open(struct snd_pcm_substream *substream)
substream, dma_request_slave_channel(snd_soc_rtd_to_cpu(rtd, 0)->dev,
dma_params->chan_name));
}
-EXPORT_SYMBOL(pxa2xx_pcm_open);
-int pxa2xx_pcm_close(struct snd_pcm_substream *substream)
+static int pxa2xx_pcm_close(struct snd_pcm_substream *substream)
{
return snd_dmaengine_pcm_close_release_chan(substream);
}
-EXPORT_SYMBOL(pxa2xx_pcm_close);
-int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm)
+static int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm)
{
size_t size = pxa2xx_pcm_hardware.buffer_bytes_max;
return snd_pcm_set_fixed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV_WC,
pcm->card->dev, size);
}
-EXPORT_SYMBOL(pxa2xx_pcm_preallocate_dma_buffer);
int pxa2xx_soc_pcm_new(struct snd_soc_component *component,
struct snd_soc_pcm_runtime *rtd)
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index ff0fbb61dccd..71b7bd948b5e 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -14,9 +14,10 @@
#include <sound/core.h>
#include <sound/soc.h>
-#include <sound/pxa2xx-lib.h>
#include <sound/dmaengine_pcm.h>
+#include "pxa2xx-lib.h"
+
static const struct snd_soc_component_driver pxa2xx_soc_platform = {
.pcm_new = pxa2xx_soc_pcm_new,
.open = pxa2xx_soc_pcm_open,
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code
2026-05-05 20:24 ` [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code Arnd Bergmann
@ 2026-05-05 23:58 ` Mark Brown
2026-05-06 8:15 ` Andy Shevchenko
2026-05-06 8:13 ` Andy Shevchenko
1 sibling, 1 reply; 7+ messages in thread
From: Mark Brown @ 2026-05-05 23:58 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Jaroslav Kysela,
Takashi Iwai, Andy Shevchenko, linux-arm-kernel, linux-kernel,
linux-sound, Arnd Bergmann
[-- Attachment #1: Type: text/plain, Size: 608 bytes --]
On Tue, May 05, 2026 at 10:24:25PM +0200, Arnd Bergmann wrote:
> index 7df78867db49..0d5eaf4b100c 100644
> --- a/include/linux/platform_data/asoc-pxa.h
> +++ b/include/linux/platform_data/asoc-pxa.h
> @@ -6,6 +6,6 @@
> #include <sound/pcm.h>
> #include <sound/ac97_codec.h>
>
> -extern void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio);
> +extern void pxa27x_configure_ac97reset(struct gpio_desc *reset_gpio, bool to_gpio);
>
> #endif
You're adding a use of struct gpio_desc but not including the header for
it or declaring it. Which won't really matter here but still.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing
2026-05-05 20:24 [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing Arnd Bergmann
2026-05-05 20:24 ` [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code Arnd Bergmann
2026-05-05 20:24 ` [PATCH v2 3/3] ASoC: pxa: integrate sound/arm/pxa2xx into sound/soc/pxa2xx Arnd Bergmann
@ 2026-05-06 1:14 ` Mark Brown
2 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2026-05-06 1:14 UTC (permalink / raw)
To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Arnd Bergmann
Cc: Jaroslav Kysela, Takashi Iwai, Andy Shevchenko, linux-arm-kernel,
linux-kernel, linux-sound, Arnd Bergmann
On Tue, 05 May 2026 22:24:24 +0200, Arnd Bergmann wrote:
> ASoC: arm: pxa2xx: remove platform_data processing
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.2
Thanks!
[1/3] ASoC: arm: pxa2xx: remove platform_data processing
https://git.kernel.org/broonie/sound/c/087623676248
[2/3] ASoC: pxa2xx: push gpio usage into arch code
https://git.kernel.org/broonie/sound/c/a11fbb793ab4
[3/3] ASoC: pxa: integrate sound/arm/pxa2xx into sound/soc/pxa2xx
https://git.kernel.org/broonie/sound/c/42f67e1d1cba
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code
2026-05-05 20:24 ` [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code Arnd Bergmann
2026-05-05 23:58 ` Mark Brown
@ 2026-05-06 8:13 ` Andy Shevchenko
1 sibling, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2026-05-06 8:13 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Mark Brown, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
Jaroslav Kysela, Takashi Iwai, linux-arm-kernel, linux-kernel,
linux-sound, Arnd Bergmann
On Tue, May 05, 2026 at 10:24:25PM +0200, Arnd Bergmann wrote:
> There are no remaining static platform_device users of pxa2xx ac97,
> so the rest of that code path can go away as well.
>
> Since nothing in the driver uses the gpio number now, constrain the use
GPIO
> of the legacy gpio interface to the architecture specific code.
GPIO
...
> #include <sound/pcm.h>
> #include <sound/ac97_codec.h>
>
> -extern void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio);
> +extern void pxa27x_configure_ac97reset(struct gpio_desc *reset_gpio, bool to_gpio);
Looks like this is the only useful line in the header, hence while at it we may
drop 'extern'.
> #endif
...
> + if (cpu_is_pxa27x()) {
> /* Assert reset using GPIOD_OUT_HIGH, because reset is GPIO_ACTIVE_LOW */
> - rst_gpio = devm_gpiod_get(&dev->dev, "reset", GPIOD_OUT_HIGH);
> - if (IS_ERR(rst_gpio)) {
> - ret = PTR_ERR(rst_gpio);
> - if (ret == -ENOENT)
> - reset_gpio = -1;
> - else if (ret)
> - return ret;
> - } else {
> - reset_gpio = desc_to_gpio(rst_gpio);
> - }
> - } else {
> - if (cpu_is_pxa27x())
> - reset_gpio = 113;
> - }
> + rst_gpio = devm_gpiod_get_optional(&dev->dev, "reset",
> + GPIOD_OUT_HIGH);
> + if (IS_ERR(rst_gpio))
> + return dev_err_probe(&dev->dev, PTR_ERR(rst_gpio),
> + "reset gpio failed\n");
I *slightly* tend to have my patch just as preparatory for this one as it does
one logical change, this one does another. But if you think it is not worth it,
okay then.
...
Now looking at this, I am not even sure that we need that if (cpu_is_pxa27x())
since optional GPIO will return NULL and everything should work as long as
there is no mistake in DT or platform code that provides the GPIO.
But such a change should be done carefully.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code
2026-05-05 23:58 ` Mark Brown
@ 2026-05-06 8:15 ` Andy Shevchenko
0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2026-05-06 8:15 UTC (permalink / raw)
To: Mark Brown
Cc: Arnd Bergmann, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
Jaroslav Kysela, Takashi Iwai, linux-arm-kernel, linux-kernel,
linux-sound, Arnd Bergmann
On Wed, May 06, 2026 at 08:58:21AM +0900, Mark Brown wrote:
> On Tue, May 05, 2026 at 10:24:25PM +0200, Arnd Bergmann wrote:
...
> > #include <sound/pcm.h>
> > #include <sound/ac97_codec.h>
> >
> > -extern void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio);
> > +extern void pxa27x_configure_ac97reset(struct gpio_desc *reset_gpio, bool to_gpio);
> >
> > #endif
>
> You're adding a use of struct gpio_desc but not including the header for
> it or declaring it. Which won't really matter here but still.
Usually forward declaration is enough (for clarity).
struct gpio_desc;
and we do that in many headers.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-05-06 8:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 20:24 [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing Arnd Bergmann
2026-05-05 20:24 ` [PATCH v2 2/3] ASoC: pxa2xx: push gpio usage into arch code Arnd Bergmann
2026-05-05 23:58 ` Mark Brown
2026-05-06 8:15 ` Andy Shevchenko
2026-05-06 8:13 ` Andy Shevchenko
2026-05-05 20:24 ` [PATCH v2 3/3] ASoC: pxa: integrate sound/arm/pxa2xx into sound/soc/pxa2xx Arnd Bergmann
2026-05-06 1:14 ` [PATCH v2 1/3] ASoC: arm: pxa2xx: remove platform_data processing Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox