mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] ASoC: drop some mach-types.h inclusions
@ 2026-06-03 12:09 Sascha Hauer
  2026-06-03 12:09 ` [PATCH 1/4] ASoC: fsl: eukrea-tlv320: drop unused machine support Sascha Hauer
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Sascha Hauer @ 2026-06-03 12:09 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Sen Wang, Jarkko Nikula
  Cc: linux-sound, linux-kernel, linux-omap, Sascha Hauer

This series drops some mach-types.h inclusions by
- removing dead machine_is_* macros because the boards are converted to
  dt
- removing a driver that entirely hangs on a machine_is_* macro for a
  machine that is converted to dt
- removing unnecessary inclusion because nothing from the header is
  used.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Sascha Hauer (4):
      ASoC: fsl: eukrea-tlv320: drop unused machine support
      ASoC: ti: omap3pandora: remove
      ASoC: ti: rx51: drop unnecessary machine checks
      ASoC: ti: n810: drop unused header inclusion

 sound/soc/fsl/eukrea-tlv320.c |  12 +-
 sound/soc/ti/Kconfig          |   9 --
 sound/soc/ti/Makefile         |   2 -
 sound/soc/ti/n810.c           |   1 -
 sound/soc/ti/omap3pandora.c   | 290 ------------------------------------------
 sound/soc/ti/rx51.c           |   5 -
 6 files changed, 3 insertions(+), 316 deletions(-)
---
base-commit: ba3e43a9e601636f5edb54e259a74f96ca3b8fd8
change-id: 20260603-asoc-remove-mach-types-h-d9293eafe2c8

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/4] ASoC: fsl: eukrea-tlv320: drop unused machine support
  2026-06-03 12:09 [PATCH 0/4] ASoC: drop some mach-types.h inclusions Sascha Hauer
@ 2026-06-03 12:09 ` Sascha Hauer
  2026-06-03 12:09 ` [PATCH 2/4] ASoC: ti: omap3pandora: remove Sascha Hauer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2026-06-03 12:09 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Sen Wang, Jarkko Nikula
  Cc: linux-sound, linux-kernel, linux-omap, Sascha Hauer

The Eukrea boards are dt only, platform support has been removed in [1].
Drop the machine_is_* macros which always expand to 0 and remove no
longer needed asm/mach-types.h inclusion.

[1]
8da4d6b2f7988 ("ARM: mx51: Remove mach-cpuimx51sd board file")
f2f55499942a0 ("ARM: imx: Remove eukrea_mbimxsd35 non-dt support")
3877942b0c7f3 ("ARM: imx25: Remove eukrea mx25 board files")
7c5deaf775265 ("ARM: i.MX: Remove mach-cpuimx27sd board file")

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 sound/soc/fsl/eukrea-tlv320.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c
index 6be074ea0b3f0..551d5c102240b 100644
--- a/sound/soc/fsl/eukrea-tlv320.c
+++ b/sound/soc/fsl/eukrea-tlv320.c
@@ -19,7 +19,6 @@
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/soc.h>
-#include <asm/mach-types.h>
 
 #include "../codecs/tlv320aic23.h"
 #include "imx-ssi.h"
@@ -142,8 +141,7 @@ static int eukrea_tlv320_probe(struct platform_device *pdev)
 		eukrea_tlv320.name = "cpuimx-audio";
 	}
 
-	if (machine_is_eukrea_cpuimx27() ||
-	    (tmp_np = of_find_compatible_node(NULL, NULL, "fsl,imx21-audmux"))) {
+	if ((tmp_np = of_find_compatible_node(NULL, NULL, "fsl,imx21-audmux"))) {
 		imx_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
 			IMX_AUDMUX_V1_PCR_SYN |
 			IMX_AUDMUX_V1_PCR_TFSDIR |
@@ -159,13 +157,9 @@ static int eukrea_tlv320_probe(struct platform_device *pdev)
 			IMX_AUDMUX_V1_PCR_RXDSEL(MX27_AUDMUX_HPCR1_SSI0)
 		);
 		of_node_put(tmp_np);
-	} else if (machine_is_eukrea_cpuimx25sd() ||
-		   machine_is_eukrea_cpuimx35sd() ||
-		   machine_is_eukrea_cpuimx51sd() ||
-		   (tmp_np = of_find_compatible_node(NULL, NULL, "fsl,imx31-audmux"))) {
+	} else if ((tmp_np = of_find_compatible_node(NULL, NULL, "fsl,imx31-audmux"))) {
 		if (!np)
-			ext_port = machine_is_eukrea_cpuimx25sd() ?
-				4 : 3;
+			ext_port = 3;
 
 		imx_audmux_v2_configure_port(int_port,
 			IMX_AUDMUX_V2_PTCR_SYN |

-- 
2.47.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/4] ASoC: ti: omap3pandora: remove
  2026-06-03 12:09 [PATCH 0/4] ASoC: drop some mach-types.h inclusions Sascha Hauer
  2026-06-03 12:09 ` [PATCH 1/4] ASoC: fsl: eukrea-tlv320: drop unused machine support Sascha Hauer
@ 2026-06-03 12:09 ` Sascha Hauer
  2026-06-03 14:00   ` Andreas Kemnade
  2026-06-19  5:12   ` H. Nikolaus Schaller
  2026-06-03 12:09 ` [PATCH 3/4] ASoC: ti: rx51: drop unnecessary machine checks Sascha Hauer
  2026-06-03 12:09 ` [PATCH 4/4] ASoC: ti: n810: drop unused header inclusion Sascha Hauer
  3 siblings, 2 replies; 11+ messages in thread
From: Sascha Hauer @ 2026-06-03 12:09 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Sen Wang, Jarkko Nikula
  Cc: linux-sound, linux-kernel, linux-omap, Sascha Hauer

The omap3pandora driver entirely depends on machine_is_omap3_pandora().
Pandora has been converted to device tree:

7fcf7e061edd3 ("ARM: OMAP2+: Remove legacy booting support for Pandora")

Since then machine_is_omap3_pandora() always expands to 0. Remove the
long unused driver.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 sound/soc/ti/Kconfig        |   9 --
 sound/soc/ti/Makefile       |   2 -
 sound/soc/ti/omap3pandora.c | 290 --------------------------------------------
 3 files changed, 301 deletions(-)

diff --git a/sound/soc/ti/Kconfig b/sound/soc/ti/Kconfig
index 3323cf96e3095..e5b165e0fc6cc 100644
--- a/sound/soc/ti/Kconfig
+++ b/sound/soc/ti/Kconfig
@@ -83,15 +83,6 @@ config SND_SOC_NOKIA_RX51
 	  Say Y or M if you want to add support for SoC audio on Nokia RX-51
 	  hardware. This is also known as Nokia N900 product.
 
-config SND_SOC_OMAP3_PANDORA
-	tristate "SoC Audio support for OMAP3 Pandora"
-	depends on ARCH_OMAP3
-	depends on TWL4030_CORE
-	select SND_SOC_OMAP_MCBSP
-	select SND_SOC_TWL4030
-	help
-	  Say Y or M if you want to add support for SoC audio on the OMAP3 Pandora.
-
 config SND_SOC_OMAP3_TWL4030
 	tristate "SoC Audio support for OMAP3 based boards with twl4030 codec"
 	depends on ARCH_OMAP3 || COMPILE_TEST && COMMON_CLK
diff --git a/sound/soc/ti/Makefile b/sound/soc/ti/Makefile
index 421e13bc04dbb..a5f5b284c0e28 100644
--- a/sound/soc/ti/Makefile
+++ b/sound/soc/ti/Makefile
@@ -26,7 +26,6 @@ obj-$(CONFIG_SND_SOC_OMAP_MCPDM) += snd-soc-omap-mcpdm.o
 snd-soc-davinci-evm-y := davinci-evm.o
 snd-soc-n810-y := n810.o
 snd-soc-rx51-y := rx51.o
-snd-soc-omap3pandora-y := omap3pandora.o
 snd-soc-omap-twl4030-y := omap-twl4030.o
 snd-soc-omap-abe-twl6040-y := omap-abe-twl6040.o
 snd-soc-ams-delta-y := ams-delta.o
@@ -37,7 +36,6 @@ snd-soc-j721e-evm-y := j721e-evm.o
 obj-$(CONFIG_SND_SOC_DAVINCI_EVM) += snd-soc-davinci-evm.o
 obj-$(CONFIG_SND_SOC_NOKIA_N810) += snd-soc-n810.o
 obj-$(CONFIG_SND_SOC_NOKIA_RX51) += snd-soc-rx51.o
-obj-$(CONFIG_SND_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
 obj-$(CONFIG_SND_SOC_OMAP3_TWL4030) += snd-soc-omap-twl4030.o
 obj-$(CONFIG_SND_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o
 obj-$(CONFIG_SND_SOC_OMAP_AMS_DELTA) += snd-soc-ams-delta.o
diff --git a/sound/soc/ti/omap3pandora.c b/sound/soc/ti/omap3pandora.c
deleted file mode 100644
index f11b1d8a1306c..0000000000000
--- a/sound/soc/ti/omap3pandora.c
+++ /dev/null
@@ -1,290 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * omap3pandora.c  --  SoC audio for Pandora Handheld Console
- *
- * Author: Gražvydas Ignotas <notasas@gmail.com>
- */
-
-#include <linux/clk.h>
-#include <linux/platform_device.h>
-#include <linux/gpio/consumer.h>
-#include <linux/delay.h>
-#include <linux/regulator/consumer.h>
-#include <linux/module.h>
-
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-
-#include <asm/mach-types.h>
-#include <linux/platform_data/asoc-ti-mcbsp.h>
-
-#include "omap-mcbsp.h"
-
-#define PREFIX "ASoC omap3pandora: "
-
-static struct regulator *omap3pandora_dac_reg;
-static struct gpio_desc *dac_power_gpio;
-static struct gpio_desc *amp_power_gpio;
-
-static int omap3pandora_hw_params(struct snd_pcm_substream *substream,
-	struct snd_pcm_hw_params *params)
-{
-	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
-	struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
-	struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
-	int ret;
-
-	/* Set the codec system clock for DAC and ADC */
-	ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
-					    SND_SOC_CLOCK_IN);
-	if (ret < 0) {
-		pr_err(PREFIX "can't set codec system clock\n");
-		return ret;
-	}
-
-	/* Set McBSP clock to external */
-	ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_EXT,
-				     256 * params_rate(params),
-				     SND_SOC_CLOCK_IN);
-	if (ret < 0) {
-		pr_err(PREFIX "can't set cpu system clock\n");
-		return ret;
-	}
-
-	ret = snd_soc_dai_set_clkdiv(cpu_dai, OMAP_MCBSP_CLKGDV, 8);
-	if (ret < 0) {
-		pr_err(PREFIX "can't set SRG clock divider\n");
-		return ret;
-	}
-
-	return 0;
-}
-
-static int omap3pandora_dac_event(struct snd_soc_dapm_widget *w,
-	struct snd_kcontrol *k, int event)
-{
-	int ret;
-
-	/*
-	 * The PCM1773 DAC datasheet requires 1ms delay between switching
-	 * VCC power on/off and /PD pin high/low
-	 */
-	if (SND_SOC_DAPM_EVENT_ON(event)) {
-		struct device *dev = snd_soc_dapm_to_dev(w->dapm);
-
-		ret = regulator_enable(omap3pandora_dac_reg);
-		if (ret) {
-			dev_err(dev, "Failed to power DAC: %d\n", ret);
-			return ret;
-		}
-		mdelay(1);
-		gpiod_set_value(dac_power_gpio, 1);
-	} else {
-		gpiod_set_value(dac_power_gpio, 0);
-		mdelay(1);
-		regulator_disable(omap3pandora_dac_reg);
-	}
-
-	return 0;
-}
-
-static int omap3pandora_hp_event(struct snd_soc_dapm_widget *w,
-	struct snd_kcontrol *k, int event)
-{
-	if (SND_SOC_DAPM_EVENT_ON(event))
-		gpiod_set_value(amp_power_gpio, 1);
-	else
-		gpiod_set_value(amp_power_gpio, 0);
-
-	return 0;
-}
-
-/*
- * Audio paths on Pandora board:
- *
- *  |O| ---> PCM DAC +-> AMP -> Headphone Jack
- *  |M|         A    +--------> Line Out
- *  |A| <~~clk~~+
- *  |P| <--- TWL4030 <--------- Line In and MICs
- */
-static const struct snd_soc_dapm_widget omap3pandora_dapm_widgets[] = {
-	SND_SOC_DAPM_DAC_E("PCM DAC", "HiFi Playback", SND_SOC_NOPM,
-			   0, 0, omap3pandora_dac_event,
-			   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
-	SND_SOC_DAPM_PGA_E("Headphone Amplifier", SND_SOC_NOPM,
-			   0, 0, NULL, 0, omap3pandora_hp_event,
-			   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
-	SND_SOC_DAPM_HP("Headphone Jack", NULL),
-	SND_SOC_DAPM_LINE("Line Out", NULL),
-
-	SND_SOC_DAPM_MIC("Mic (internal)", NULL),
-	SND_SOC_DAPM_MIC("Mic (external)", NULL),
-	SND_SOC_DAPM_LINE("Line In", NULL),
-};
-
-static const struct snd_soc_dapm_route omap3pandora_map[] = {
-	{"PCM DAC", NULL, "APLL Enable"},
-	{"Headphone Amplifier", NULL, "PCM DAC"},
-	{"Line Out", NULL, "PCM DAC"},
-	{"Headphone Jack", NULL, "Headphone Amplifier"},
-
-	{"AUXL", NULL, "Line In"},
-	{"AUXR", NULL, "Line In"},
-
-	{"MAINMIC", NULL, "Mic (internal)"},
-	{"Mic (internal)", NULL, "Mic Bias 1"},
-
-	{"SUBMIC", NULL, "Mic (external)"},
-	{"Mic (external)", NULL, "Mic Bias 2"},
-};
-
-static int omap3pandora_out_init(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card);
-
-	/* All TWL4030 output pins are floating */
-	snd_soc_dapm_disable_pin(dapm, "EARPIECE");
-	snd_soc_dapm_disable_pin(dapm, "PREDRIVEL");
-	snd_soc_dapm_disable_pin(dapm, "PREDRIVER");
-	snd_soc_dapm_disable_pin(dapm, "HSOL");
-	snd_soc_dapm_disable_pin(dapm, "HSOR");
-	snd_soc_dapm_disable_pin(dapm, "CARKITL");
-	snd_soc_dapm_disable_pin(dapm, "CARKITR");
-	snd_soc_dapm_disable_pin(dapm, "HFL");
-	snd_soc_dapm_disable_pin(dapm, "HFR");
-	snd_soc_dapm_disable_pin(dapm, "VIBRA");
-
-	return 0;
-}
-
-static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card);
-
-	/* Not comnnected */
-	snd_soc_dapm_disable_pin(dapm, "HSMIC");
-	snd_soc_dapm_disable_pin(dapm, "CARKITMIC");
-	snd_soc_dapm_disable_pin(dapm, "DIGIMIC0");
-	snd_soc_dapm_disable_pin(dapm, "DIGIMIC1");
-
-	return 0;
-}
-
-static const struct snd_soc_ops omap3pandora_ops = {
-	.hw_params = omap3pandora_hw_params,
-};
-
-/* Digital audio interface glue - connects codec <--> CPU */
-SND_SOC_DAILINK_DEFS(out,
-	DAILINK_COMP_ARRAY(COMP_CPU("omap-mcbsp.2")),
-	DAILINK_COMP_ARRAY(COMP_CODEC("twl4030-codec", "twl4030-hifi")),
-	DAILINK_COMP_ARRAY(COMP_PLATFORM("omap-mcbsp.2")));
-
-SND_SOC_DAILINK_DEFS(in,
-	DAILINK_COMP_ARRAY(COMP_CPU("omap-mcbsp.4")),
-	DAILINK_COMP_ARRAY(COMP_CODEC("twl4030-codec", "twl4030-hifi")),
-	DAILINK_COMP_ARRAY(COMP_PLATFORM("omap-mcbsp.4")));
-
-static struct snd_soc_dai_link omap3pandora_dai[] = {
-	{
-		.name = "PCM1773",
-		.stream_name = "HiFi Out",
-		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
-			   SND_SOC_DAIFMT_CBC_CFC,
-		.ops = &omap3pandora_ops,
-		.init = omap3pandora_out_init,
-		SND_SOC_DAILINK_REG(out),
-	}, {
-		.name = "TWL4030",
-		.stream_name = "Line/Mic In",
-		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
-			   SND_SOC_DAIFMT_CBC_CFC,
-		.ops = &omap3pandora_ops,
-		.init = omap3pandora_in_init,
-		SND_SOC_DAILINK_REG(in),
-	}
-};
-
-/* SoC card */
-static struct snd_soc_card snd_soc_card_omap3pandora = {
-	.name = "omap3pandora",
-	.owner = THIS_MODULE,
-	.dai_link = omap3pandora_dai,
-	.num_links = ARRAY_SIZE(omap3pandora_dai),
-
-	.dapm_widgets = omap3pandora_dapm_widgets,
-	.num_dapm_widgets = ARRAY_SIZE(omap3pandora_dapm_widgets),
-	.dapm_routes = omap3pandora_map,
-	.num_dapm_routes = ARRAY_SIZE(omap3pandora_map),
-};
-
-static struct platform_device *omap3pandora_snd_device;
-
-static int __init omap3pandora_soc_init(void)
-{
-	int ret;
-
-	if (!machine_is_omap3_pandora())
-		return -ENODEV;
-
-	pr_info("OMAP3 Pandora SoC init\n");
-
-	omap3pandora_snd_device = platform_device_alloc("soc-audio", -1);
-	if (omap3pandora_snd_device == NULL) {
-		pr_err(PREFIX "Platform device allocation failed\n");
-		return -ENOMEM;
-	}
-
-	platform_set_drvdata(omap3pandora_snd_device, &snd_soc_card_omap3pandora);
-
-	ret = platform_device_add(omap3pandora_snd_device);
-	if (ret) {
-		pr_err(PREFIX "Unable to add platform device\n");
-		goto fail2;
-	}
-
-	dac_power_gpio = devm_gpiod_get(&omap3pandora_snd_device->dev,
-					"dac", GPIOD_OUT_LOW);
-	if (IS_ERR(dac_power_gpio)) {
-		ret = PTR_ERR(dac_power_gpio);
-		goto fail3;
-	}
-
-	amp_power_gpio = devm_gpiod_get(&omap3pandora_snd_device->dev,
-					"amp", GPIOD_OUT_LOW);
-	if (IS_ERR(amp_power_gpio)) {
-		ret = PTR_ERR(amp_power_gpio);
-		goto fail3;
-	}
-
-	omap3pandora_dac_reg = regulator_get(&omap3pandora_snd_device->dev, "vcc");
-	if (IS_ERR(omap3pandora_dac_reg)) {
-		pr_err(PREFIX "Failed to get DAC regulator from %s: %ld\n",
-			dev_name(&omap3pandora_snd_device->dev),
-			PTR_ERR(omap3pandora_dac_reg));
-		ret = PTR_ERR(omap3pandora_dac_reg);
-		goto fail3;
-	}
-
-	return 0;
-
-fail3:
-	platform_device_del(omap3pandora_snd_device);
-fail2:
-	platform_device_put(omap3pandora_snd_device);
-
-	return ret;
-}
-module_init(omap3pandora_soc_init);
-
-static void __exit omap3pandora_soc_exit(void)
-{
-	regulator_put(omap3pandora_dac_reg);
-	platform_device_unregister(omap3pandora_snd_device);
-}
-module_exit(omap3pandora_soc_exit);
-
-MODULE_AUTHOR("Grazvydas Ignotas <notasas@gmail.com>");
-MODULE_DESCRIPTION("ALSA SoC OMAP3 Pandora");
-MODULE_LICENSE("GPL");

-- 
2.47.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/4] ASoC: ti: rx51: drop unnecessary machine checks
  2026-06-03 12:09 [PATCH 0/4] ASoC: drop some mach-types.h inclusions Sascha Hauer
  2026-06-03 12:09 ` [PATCH 1/4] ASoC: fsl: eukrea-tlv320: drop unused machine support Sascha Hauer
  2026-06-03 12:09 ` [PATCH 2/4] ASoC: ti: omap3pandora: remove Sascha Hauer
@ 2026-06-03 12:09 ` Sascha Hauer
  2026-06-03 17:42   ` Jarkko Nikula
  2026-06-03 12:09 ` [PATCH 4/4] ASoC: ti: n810: drop unused header inclusion Sascha Hauer
  3 siblings, 1 reply; 11+ messages in thread
From: Sascha Hauer @ 2026-06-03 12:09 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Sen Wang, Jarkko Nikula
  Cc: linux-sound, linux-kernel, linux-omap, Sascha Hauer

Nokia N900 is device tree only, machine_is_nokia_rx51() always expands
to 0. Testing for of_machine_is_compatible() is unnecessary as the
N900 is the only board registering the device node necessary to get to
this point, so remove that as well. This makes inclusion of mach-types.h
unnecessary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 sound/soc/ti/rx51.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/sound/soc/ti/rx51.c b/sound/soc/ti/rx51.c
index 7eeb12e5066c4..89338cf145358 100644
--- a/sound/soc/ti/rx51.c
+++ b/sound/soc/ti/rx51.c
@@ -19,8 +19,6 @@
 #include <sound/soc.h>
 #include <linux/platform_data/asoc-ti-mcbsp.h>
 
-#include <asm/mach-types.h>
-
 #include "omap-mcbsp.h"
 
 enum {
@@ -364,9 +362,6 @@ static int rx51_soc_probe(struct platform_device *pdev)
 	struct snd_soc_card *card = &rx51_sound_card;
 	int err;
 
-	if (!machine_is_nokia_rx51() && !of_machine_is_compatible("nokia,omap3-n900"))
-		return -ENODEV;
-
 	card->dev = &pdev->dev;
 
 	if (np) {

-- 
2.47.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 4/4] ASoC: ti: n810: drop unused header inclusion
  2026-06-03 12:09 [PATCH 0/4] ASoC: drop some mach-types.h inclusions Sascha Hauer
                   ` (2 preceding siblings ...)
  2026-06-03 12:09 ` [PATCH 3/4] ASoC: ti: rx51: drop unnecessary machine checks Sascha Hauer
@ 2026-06-03 12:09 ` Sascha Hauer
  3 siblings, 0 replies; 11+ messages in thread
From: Sascha Hauer @ 2026-06-03 12:09 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Sen Wang, Jarkko Nikula
  Cc: linux-sound, linux-kernel, linux-omap, Sascha Hauer

mach-types.h is only needed for machine_is_* macros and is unneeded
in this driver. Remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 sound/soc/ti/n810.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/ti/n810.c b/sound/soc/ti/n810.c
index 242b07034816d..ce1e7d796004a 100644
--- a/sound/soc/ti/n810.c
+++ b/sound/soc/ti/n810.c
@@ -14,7 +14,6 @@
 #include <sound/pcm.h>
 #include <sound/soc.h>
 
-#include <asm/mach-types.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
 #include <linux/platform_data/asoc-ti-mcbsp.h>

-- 
2.47.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] ASoC: ti: omap3pandora: remove
  2026-06-03 12:09 ` [PATCH 2/4] ASoC: ti: omap3pandora: remove Sascha Hauer
@ 2026-06-03 14:00   ` Andreas Kemnade
  2026-06-03 16:26     ` H. Nikolaus Schaller
  2026-06-19  5:12   ` H. Nikolaus Schaller
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Kemnade @ 2026-06-03 14:00 UTC (permalink / raw)
  To: Sascha Hauer, hns, grond66
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Sen Wang, Jarkko Nikula, linux-sound, linux-kernel, linux-omap

On Wed, 03 Jun 2026 14:09:23 +0200
Sascha Hauer <s.hauer@pengutronix.de> wrote:

> The omap3pandora driver entirely depends on machine_is_omap3_pandora().
> Pandora has been converted to device tree:
> 
> 7fcf7e061edd3 ("ARM: OMAP2+: Remove legacy booting support for Pandora")
> 
> Since then machine_is_omap3_pandora() always expands to 0. Remove the
> long unused driver.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  sound/soc/ti/Kconfig        |   9 --
>  sound/soc/ti/Makefile       |   2 -
>  sound/soc/ti/omap3pandora.c | 290 --------------------------------------------
>  3 files changed, 301 deletions(-)
> 
On the first glance, this looks ok... but
I know there was work undergone in converting this to devicetree but it
appeared not upstream.

So
Grond, hns: What are your plans in this? You are effectively maintaining this
out-of-mainline. What are your upstreaming plans?

Do we need this kind of glue anyway? Or can we use some of the
audio-graph-card stuff instead to wire up things?

Regards,
Andreas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] ASoC: ti: omap3pandora: remove
  2026-06-03 14:00   ` Andreas Kemnade
@ 2026-06-03 16:26     ` H. Nikolaus Schaller
  2026-06-03 17:33       ` Andreas Kemnade
  0 siblings, 1 reply; 11+ messages in thread
From: H. Nikolaus Schaller @ 2026-06-03 16:26 UTC (permalink / raw)
  To: Andreas Kemnade, Sascha Hauer
  Cc: grond66, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Sen Wang, Jarkko Nikula, linux-sound, linux-kernel,
	linux-omap, Discussions about the Letux Kernel, Stefan Leichter



> Am 03.06.2026 um 16:00 schrieb Andreas Kemnade <andreas@kemnade.info>:
> 
> On Wed, 03 Jun 2026 14:09:23 +0200
> Sascha Hauer <s.hauer@pengutronix.de> wrote:
> 
>> The omap3pandora driver entirely depends on machine_is_omap3_pandora().
>> Pandora has been converted to device tree:
>> 
>> 7fcf7e061edd3 ("ARM: OMAP2+: Remove legacy booting support for Pandora")

11 years ago :)

>> 
>> Since then machine_is_omap3_pandora() always expands to 0. Remove the
>> long unused driver.
>> 
>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>> ---
>> sound/soc/ti/Kconfig        |   9 --
>> sound/soc/ti/Makefile       |   2 -
>> sound/soc/ti/omap3pandora.c | 290 --------------------------------------------
>> 3 files changed, 301 deletions(-)
>> 
> On the first glance, this looks ok... but
> I know there was work undergone in converting this to devicetree but it
> appeared not upstream.

Thanks for spotting (before we would have been surprised).

> 
> So
> Grond, hns: What are your plans in this? You are effectively maintaining this
> out-of-mainline. What are your upstreaming plans?
> 
> Do we need this kind of glue anyway? Or can we use some of the
> audio-graph-card stuff instead to wire up things?

Tony also had mentioned something like this in [1].

I have checked the status of the LetuxOS kernel [2]:

There are patches for the device tree (a simple one without audio graphs) and patches
for sound/soc/ti/omap3pandora.c and adding a TI PCM1773 driver.

Main contributors were Grond and Stefan Leichter.

The main work is a patch by Grond: "ASoC: omap3pandora: Rewrite sound card driver as a platform driver".
This heavily modifies sound/soc/ti/omap3pandora.c including removal of machine_is_omap3_pandora()
but keeps sound/soc/ti/Kconfig & Makefile as is.
And he added "ASoC: pcm1773-codec: write a driver for the PCM1773 chip from TI".

So to summarize: the upstream code is the basis for a patch series from 2020-2023. 
I regularily rebased and fixed upstream API changes but it was never posted and there
was no specific plan to do that due to lack of manpower...

Nevertheless, if people are interested, I can consolidate and tidy up this (mainly
the API updates) into a series (approx. 10 to 20 commits) and post as RFC over the next weeks.
Note that this series also affects the TWL4030 REGEN and the twl4030-codec.

And there is a revert for some pandora related omap2/pdata-quirks [3].
BTW: there is also a special Pandora backlight driver which asks for cleanup.

Final observation: we build this with CONFIG_SND_SOC_OMAP3_PANDORA=m and this is also defined
in upstream omap2plus_defconfig [4].

My proposal: keep sound/soc/ti/omap3pandora.c at least while the RFC is discussed.
This will eventually remove machine_is_omap3_pandora().

BR,
Nikolaus

[1] https://marc.info/?l=alsa-devel&m=165632351319716&w=2
[2] https://github.com/goldelico/letux-kernel/commits/letux/sound-soc-v3/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/configs/omap2plus_defconfig?h=v7.1-rc6#n532
[4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/mach-omap2/pdata-quirks.c#n271


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] ASoC: ti: omap3pandora: remove
  2026-06-03 16:26     ` H. Nikolaus Schaller
@ 2026-06-03 17:33       ` Andreas Kemnade
  2026-06-03 17:42         ` H. Nikolaus Schaller
  0 siblings, 1 reply; 11+ messages in thread
From: Andreas Kemnade @ 2026-06-03 17:33 UTC (permalink / raw)
  To: H. Nikolaus Schaller
  Cc: Sascha Hauer, grond66, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Sen Wang, Jarkko Nikula,
	linux-sound, linux-kernel, linux-omap,
	Discussions about the Letux Kernel, Stefan Leichter, s.kerkmann

On Wed, 3 Jun 2026 18:26:52 +0200
"H. Nikolaus Schaller" <hns@goldelico.com> wrote:

> > Am 03.06.2026 um 16:00 schrieb Andreas Kemnade <andreas@kemnade.info>:
> > 
> > On Wed, 03 Jun 2026 14:09:23 +0200
> > Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >   
> >> The omap3pandora driver entirely depends on machine_is_omap3_pandora().
> >> Pandora has been converted to device tree:
> >> 
> >> 7fcf7e061edd3 ("ARM: OMAP2+: Remove legacy booting support for Pandora")  
> 
> 11 years ago :)
> 
> >> 
> >> Since then machine_is_omap3_pandora() always expands to 0. Remove the
> >> long unused driver.
> >> 
> >> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> >> ---
> >> sound/soc/ti/Kconfig        |   9 --
> >> sound/soc/ti/Makefile       |   2 -
> >> sound/soc/ti/omap3pandora.c | 290 --------------------------------------------
> >> 3 files changed, 301 deletions(-)
> >>   
> > On the first glance, this looks ok... but
> > I know there was work undergone in converting this to devicetree but it
> > appeared not upstream.  
> 
> Thanks for spotting (before we would have been surprised).
> 
> > 
> > So
> > Grond, hns: What are your plans in this? You are effectively maintaining this
> > out-of-mainline. What are your upstreaming plans?
> > 
> > Do we need this kind of glue anyway? Or can we use some of the
> > audio-graph-card stuff instead to wire up things?  
> 
> Tony also had mentioned something like this in [1].
> 
> I have checked the status of the LetuxOS kernel [2]:
> 
> There are patches for the device tree (a simple one without audio graphs) and patches
> for sound/soc/ti/omap3pandora.c and adding a TI PCM1773 driver.

Just a quick glance:

audio-graph-card2 seems to accept amplifiers. 
So probably it boils down to just remove this and
add a compatible to ti,pcm1754.yaml and a devicetree patch to use
audio-grapch-card2.

and maybe the regen stuff.

Regards,
Andreas

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] ASoC: ti: omap3pandora: remove
  2026-06-03 17:33       ` Andreas Kemnade
@ 2026-06-03 17:42         ` H. Nikolaus Schaller
  0 siblings, 0 replies; 11+ messages in thread
From: H. Nikolaus Schaller @ 2026-06-03 17:42 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: Sascha Hauer, grond66, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Sen Wang, Jarkko Nikula,
	linux-sound, linux-kernel, linux-omap,
	Discussions about the Letux Kernel, Stefan Leichter, s.kerkmann



> Am 03.06.2026 um 19:33 schrieb Andreas Kemnade <andreas@kemnade.info>:
> 
> On Wed, 3 Jun 2026 18:26:52 +0200
> "H. Nikolaus Schaller" <hns@goldelico.com> wrote:
> 
>>> Am 03.06.2026 um 16:00 schrieb Andreas Kemnade <andreas@kemnade.info>:
>>> 
>>> On Wed, 03 Jun 2026 14:09:23 +0200
>>> Sascha Hauer <s.hauer@pengutronix.de> wrote:
>>> 
>>>> The omap3pandora driver entirely depends on machine_is_omap3_pandora().
>>>> Pandora has been converted to device tree:
>>>> 
>>>> 7fcf7e061edd3 ("ARM: OMAP2+: Remove legacy booting support for Pandora")  
>> 
>> 11 years ago :)
>> 
>>>> 
>>>> Since then machine_is_omap3_pandora() always expands to 0. Remove the
>>>> long unused driver.
>>>> 
>>>> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>>>> ---
>>>> sound/soc/ti/Kconfig        |   9 --
>>>> sound/soc/ti/Makefile       |   2 -
>>>> sound/soc/ti/omap3pandora.c | 290 --------------------------------------------
>>>> 3 files changed, 301 deletions(-)
>>>> 
>>> On the first glance, this looks ok... but
>>> I know there was work undergone in converting this to devicetree but it
>>> appeared not upstream.  
>> 
>> Thanks for spotting (before we would have been surprised).
>> 
>>> 
>>> So
>>> Grond, hns: What are your plans in this? You are effectively maintaining this
>>> out-of-mainline. What are your upstreaming plans?
>>> 
>>> Do we need this kind of glue anyway? Or can we use some of the
>>> audio-graph-card stuff instead to wire up things?  
>> 
>> Tony also had mentioned something like this in [1].
>> 
>> I have checked the status of the LetuxOS kernel [2]:
>> 
>> There are patches for the device tree (a simple one without audio graphs) and patches
>> for sound/soc/ti/omap3pandora.c and adding a TI PCM1773 driver.
> 
> Just a quick glance:
> 
> audio-graph-card2 seems to accept amplifiers. 
> So probably it boils down to just remove this and
> add a compatible to ti,pcm1754.yaml and a devicetree patch to use
> audio-grapch-card2.

Sounds like a better solution if someone can draft it. Then I can help testing.
Then of course we can retire sound/soc/ti/omap3pandora.c.

> and maybe the regen stuff.

Yes, as far as I understand, this is required to make it work.

BR,
Nikolaus


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/4] ASoC: ti: rx51: drop unnecessary machine checks
  2026-06-03 12:09 ` [PATCH 3/4] ASoC: ti: rx51: drop unnecessary machine checks Sascha Hauer
@ 2026-06-03 17:42   ` Jarkko Nikula
  0 siblings, 0 replies; 11+ messages in thread
From: Jarkko Nikula @ 2026-06-03 17:42 UTC (permalink / raw)
  To: Sascha Hauer, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Sen Wang
  Cc: linux-sound, linux-kernel, linux-omap

Hi

On 6/3/26 3:09 PM, Sascha Hauer wrote:
> Nokia N900 is device tree only, machine_is_nokia_rx51() always expands
> to 0. Testing for of_machine_is_compatible() is unnecessary as the
> N900 is the only board registering the device node necessary to get to
> this point, so remove that as well. This makes inclusion of mach-types.h
> unnecessary.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>   sound/soc/ti/rx51.c | 5 -----
>   1 file changed, 5 deletions(-)
Recent patch removed the machine_is_nokia_rx51(). Could you base your 
of_machine_is_compatible() removal on top of it.

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/commit/sound/soc/ti/rx51.c?id=ee05c329c0487c86d37635a7503ba989c6aa7636 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] ASoC: ti: omap3pandora: remove
  2026-06-03 12:09 ` [PATCH 2/4] ASoC: ti: omap3pandora: remove Sascha Hauer
  2026-06-03 14:00   ` Andreas Kemnade
@ 2026-06-19  5:12   ` H. Nikolaus Schaller
  1 sibling, 0 replies; 11+ messages in thread
From: H. Nikolaus Schaller @ 2026-06-19  5:12 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Sen Wang, Jarkko Nikula, linux-sound, linux-kernel, linux-omap,
	Andreas Kemnade

I found out that the already applied patch

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20260618&id=45efb8fbdae303539e7fb5562e147583d4ed63ad

has the same effect of removing the machine_is_omap3_pandora() dependency with less harm to the code base.

For all others: a modernized rework of the openpandora sound driver based on the existing code is currently being worked on.


> Am 03.06.2026 um 14:09 schrieb Sascha Hauer <s.hauer@pengutronix.de>:
> 
> The omap3pandora driver entirely depends on().
> Pandora has been converted to device tree:
> 
> 7fcf7e061edd3 ("ARM: OMAP2+: Remove legacy booting support for Pandora")
> 
> Since then machine_is_omap3_pandora() always expands to 0. Remove the
> long unused driver.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> sound/soc/ti/Kconfig        |   9 --
> sound/soc/ti/Makefile       |   2 -
> sound/soc/ti/omap3pandora.c | 290 --------------------------------------------
> 3 files changed, 301 deletions(-)
> 
> diff --git a/sound/soc/ti/Kconfig b/sound/soc/ti/Kconfig
> index 3323cf96e3095..e5b165e0fc6cc 100644
> --- a/sound/soc/ti/Kconfig
> +++ b/sound/soc/ti/Kconfig
> @@ -83,15 +83,6 @@ config SND_SOC_NOKIA_RX51
>  Say Y or M if you want to add support for SoC audio on Nokia RX-51
>  hardware. This is also known as Nokia N900 product.
> 
> -config SND_SOC_OMAP3_PANDORA
> - tristate "SoC Audio support for OMAP3 Pandora"
> - depends on ARCH_OMAP3
> - depends on TWL4030_CORE
> - select SND_SOC_OMAP_MCBSP
> - select SND_SOC_TWL4030
> - help
> -  Say Y or M if you want to add support for SoC audio on the OMAP3 Pandora.
> -
> config SND_SOC_OMAP3_TWL4030
> tristate "SoC Audio support for OMAP3 based boards with twl4030 codec"
> depends on ARCH_OMAP3 || COMPILE_TEST && COMMON_CLK
> diff --git a/sound/soc/ti/Makefile b/sound/soc/ti/Makefile
> index 421e13bc04dbb..a5f5b284c0e28 100644
> --- a/sound/soc/ti/Makefile
> +++ b/sound/soc/ti/Makefile
> @@ -26,7 +26,6 @@ obj-$(CONFIG_SND_SOC_OMAP_MCPDM) += snd-soc-omap-mcpdm.o
> snd-soc-davinci-evm-y := davinci-evm.o
> snd-soc-n810-y := n810.o
> snd-soc-rx51-y := rx51.o
> -snd-soc-omap3pandora-y := omap3pandora.o
> snd-soc-omap-twl4030-y := omap-twl4030.o
> snd-soc-omap-abe-twl6040-y := omap-abe-twl6040.o
> snd-soc-ams-delta-y := ams-delta.o
> @@ -37,7 +36,6 @@ snd-soc-j721e-evm-y := j721e-evm.o
> obj-$(CONFIG_SND_SOC_DAVINCI_EVM) += snd-soc-davinci-evm.o
> obj-$(CONFIG_SND_SOC_NOKIA_N810) += snd-soc-n810.o
> obj-$(CONFIG_SND_SOC_NOKIA_RX51) += snd-soc-rx51.o
> -obj-$(CONFIG_SND_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
> obj-$(CONFIG_SND_SOC_OMAP3_TWL4030) += snd-soc-omap-twl4030.o
> obj-$(CONFIG_SND_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o
> obj-$(CONFIG_SND_SOC_OMAP_AMS_DELTA) += snd-soc-ams-delta.o
> diff --git a/sound/soc/ti/omap3pandora.c b/sound/soc/ti/omap3pandora.c
> deleted file mode 100644
> index f11b1d8a1306c..0000000000000
> --- a/sound/soc/ti/omap3pandora.c
> +++ /dev/null
> @@ -1,290 +0,0 @@
> -// SPDX-License-Identifier: GPL-2.0-only
> -/*
> - * omap3pandora.c  --  SoC audio for Pandora Handheld Console
> - *
> - * Author: Gražvydas Ignotas <notasas@gmail.com>
> - */
> -
> -#include <linux/clk.h>
> -#include <linux/platform_device.h>
> -#include <linux/gpio/consumer.h>
> -#include <linux/delay.h>
> -#include <linux/regulator/consumer.h>
> -#include <linux/module.h>
> -
> -#include <sound/core.h>
> -#include <sound/pcm.h>
> -#include <sound/soc.h>
> -
> -#include <asm/mach-types.h>
> -#include <linux/platform_data/asoc-ti-mcbsp.h>
> -
> -#include "omap-mcbsp.h"
> -
> -#define PREFIX "ASoC omap3pandora: "
> -
> -static struct regulator *omap3pandora_dac_reg;
> -static struct gpio_desc *dac_power_gpio;
> -static struct gpio_desc *amp_power_gpio;
> -
> -static int omap3pandora_hw_params(struct snd_pcm_substream *substream,
> - struct snd_pcm_hw_params *params)
> -{
> - struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
> - struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0);
> - struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0);
> - int ret;
> -
> - /* Set the codec system clock for DAC and ADC */
> - ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
> -    SND_SOC_CLOCK_IN);
> - if (ret < 0) {
> - pr_err(PREFIX "can't set codec system clock\n");
> - return ret;
> - }
> -
> - /* Set McBSP clock to external */
> - ret = snd_soc_dai_set_sysclk(cpu_dai, OMAP_MCBSP_SYSCLK_CLKS_EXT,
> -     256 * params_rate(params),
> -     SND_SOC_CLOCK_IN);
> - if (ret < 0) {
> - pr_err(PREFIX "can't set cpu system clock\n");
> - return ret;
> - }
> -
> - ret = snd_soc_dai_set_clkdiv(cpu_dai, OMAP_MCBSP_CLKGDV, 8);
> - if (ret < 0) {
> - pr_err(PREFIX "can't set SRG clock divider\n");
> - return ret;
> - }
> -
> - return 0;
> -}
> -
> -static int omap3pandora_dac_event(struct snd_soc_dapm_widget *w,
> - struct snd_kcontrol *k, int event)
> -{
> - int ret;
> -
> - /*
> - * The PCM1773 DAC datasheet requires 1ms delay between switching
> - * VCC power on/off and /PD pin high/low
> - */
> - if (SND_SOC_DAPM_EVENT_ON(event)) {
> - struct device *dev = snd_soc_dapm_to_dev(w->dapm);
> -
> - ret = regulator_enable(omap3pandora_dac_reg);
> - if (ret) {
> - dev_err(dev, "Failed to power DAC: %d\n", ret);
> - return ret;
> - }
> - mdelay(1);
> - gpiod_set_value(dac_power_gpio, 1);
> - } else {
> - gpiod_set_value(dac_power_gpio, 0);
> - mdelay(1);
> - regulator_disable(omap3pandora_dac_reg);
> - }
> -
> - return 0;
> -}
> -
> -static int omap3pandora_hp_event(struct snd_soc_dapm_widget *w,
> - struct snd_kcontrol *k, int event)
> -{
> - if (SND_SOC_DAPM_EVENT_ON(event))
> - gpiod_set_value(amp_power_gpio, 1);
> - else
> - gpiod_set_value(amp_power_gpio, 0);
> -
> - return 0;
> -}
> -
> -/*
> - * Audio paths on Pandora board:
> - *
> - *  |O| ---> PCM DAC +-> AMP -> Headphone Jack
> - *  |M|         A    +--------> Line Out
> - *  |A| <~~clk~~+
> - *  |P| <--- TWL4030 <--------- Line In and MICs
> - */
> -static const struct snd_soc_dapm_widget omap3pandora_dapm_widgets[] = {
> - SND_SOC_DAPM_DAC_E("PCM DAC", "HiFi Playback", SND_SOC_NOPM,
> -   0, 0, omap3pandora_dac_event,
> -   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
> - SND_SOC_DAPM_PGA_E("Headphone Amplifier", SND_SOC_NOPM,
> -   0, 0, NULL, 0, omap3pandora_hp_event,
> -   SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD),
> - SND_SOC_DAPM_HP("Headphone Jack", NULL),
> - SND_SOC_DAPM_LINE("Line Out", NULL),
> -
> - SND_SOC_DAPM_MIC("Mic (internal)", NULL),
> - SND_SOC_DAPM_MIC("Mic (external)", NULL),
> - SND_SOC_DAPM_LINE("Line In", NULL),
> -};
> -
> -static const struct snd_soc_dapm_route omap3pandora_map[] = {
> - {"PCM DAC", NULL, "APLL Enable"},
> - {"Headphone Amplifier", NULL, "PCM DAC"},
> - {"Line Out", NULL, "PCM DAC"},
> - {"Headphone Jack", NULL, "Headphone Amplifier"},
> -
> - {"AUXL", NULL, "Line In"},
> - {"AUXR", NULL, "Line In"},
> -
> - {"MAINMIC", NULL, "Mic (internal)"},
> - {"Mic (internal)", NULL, "Mic Bias 1"},
> -
> - {"SUBMIC", NULL, "Mic (external)"},
> - {"Mic (external)", NULL, "Mic Bias 2"},
> -};
> -
> -static int omap3pandora_out_init(struct snd_soc_pcm_runtime *rtd)
> -{
> - struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card);
> -
> - /* All TWL4030 output pins are floating */
> - snd_soc_dapm_disable_pin(dapm, "EARPIECE");
> - snd_soc_dapm_disable_pin(dapm, "PREDRIVEL");
> - snd_soc_dapm_disable_pin(dapm, "PREDRIVER");
> - snd_soc_dapm_disable_pin(dapm, "HSOL");
> - snd_soc_dapm_disable_pin(dapm, "HSOR");
> - snd_soc_dapm_disable_pin(dapm, "CARKITL");
> - snd_soc_dapm_disable_pin(dapm, "CARKITR");
> - snd_soc_dapm_disable_pin(dapm, "HFL");
> - snd_soc_dapm_disable_pin(dapm, "HFR");
> - snd_soc_dapm_disable_pin(dapm, "VIBRA");
> -
> - return 0;
> -}
> -
> -static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd)
> -{
> - struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(rtd->card);
> -
> - /* Not comnnected */
> - snd_soc_dapm_disable_pin(dapm, "HSMIC");
> - snd_soc_dapm_disable_pin(dapm, "CARKITMIC");
> - snd_soc_dapm_disable_pin(dapm, "DIGIMIC0");
> - snd_soc_dapm_disable_pin(dapm, "DIGIMIC1");
> -
> - return 0;
> -}
> -
> -static const struct snd_soc_ops omap3pandora_ops = {
> - .hw_params = omap3pandora_hw_params,
> -};
> -
> -/* Digital audio interface glue - connects codec <--> CPU */
> -SND_SOC_DAILINK_DEFS(out,
> - DAILINK_COMP_ARRAY(COMP_CPU("omap-mcbsp.2")),
> - DAILINK_COMP_ARRAY(COMP_CODEC("twl4030-codec", "twl4030-hifi")),
> - DAILINK_COMP_ARRAY(COMP_PLATFORM("omap-mcbsp.2")));
> -
> -SND_SOC_DAILINK_DEFS(in,
> - DAILINK_COMP_ARRAY(COMP_CPU("omap-mcbsp.4")),
> - DAILINK_COMP_ARRAY(COMP_CODEC("twl4030-codec", "twl4030-hifi")),
> - DAILINK_COMP_ARRAY(COMP_PLATFORM("omap-mcbsp.4")));
> -
> -static struct snd_soc_dai_link omap3pandora_dai[] = {
> - {
> - .name = "PCM1773",
> - .stream_name = "HiFi Out",
> - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
> -   SND_SOC_DAIFMT_CBC_CFC,
> - .ops = &omap3pandora_ops,
> - .init = omap3pandora_out_init,
> - SND_SOC_DAILINK_REG(out),
> - }, {
> - .name = "TWL4030",
> - .stream_name = "Line/Mic In",
> - .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
> -   SND_SOC_DAIFMT_CBC_CFC,
> - .ops = &omap3pandora_ops,
> - .init = omap3pandora_in_init,
> - SND_SOC_DAILINK_REG(in),
> - }
> -};
> -
> -/* SoC card */
> -static struct snd_soc_card snd_soc_card_omap3pandora = {
> - .name = "omap3pandora",
> - .owner = THIS_MODULE,
> - .dai_link = omap3pandora_dai,
> - .num_links = ARRAY_SIZE(omap3pandora_dai),
> -
> - .dapm_widgets = omap3pandora_dapm_widgets,
> - .num_dapm_widgets = ARRAY_SIZE(omap3pandora_dapm_widgets),
> - .dapm_routes = omap3pandora_map,
> - .num_dapm_routes = ARRAY_SIZE(omap3pandora_map),
> -};
> -
> -static struct platform_device *omap3pandora_snd_device;
> -
> -static int __init omap3pandora_soc_init(void)
> -{
> - int ret;
> -
> - if (!machine_is_omap3_pandora())
> - return -ENODEV;
> -
> - pr_info("OMAP3 Pandora SoC init\n");
> -
> - omap3pandora_snd_device = platform_device_alloc("soc-audio", -1);
> - if (omap3pandora_snd_device == NULL) {
> - pr_err(PREFIX "Platform device allocation failed\n");
> - return -ENOMEM;
> - }
> -
> - platform_set_drvdata(omap3pandora_snd_device, &snd_soc_card_omap3pandora);
> -
> - ret = platform_device_add(omap3pandora_snd_device);
> - if (ret) {
> - pr_err(PREFIX "Unable to add platform device\n");
> - goto fail2;
> - }
> -
> - dac_power_gpio = devm_gpiod_get(&omap3pandora_snd_device->dev,
> - "dac", GPIOD_OUT_LOW);
> - if (IS_ERR(dac_power_gpio)) {
> - ret = PTR_ERR(dac_power_gpio);
> - goto fail3;
> - }
> -
> - amp_power_gpio = devm_gpiod_get(&omap3pandora_snd_device->dev,
> - "amp", GPIOD_OUT_LOW);
> - if (IS_ERR(amp_power_gpio)) {
> - ret = PTR_ERR(amp_power_gpio);
> - goto fail3;
> - }
> -
> - omap3pandora_dac_reg = regulator_get(&omap3pandora_snd_device->dev, "vcc");
> - if (IS_ERR(omap3pandora_dac_reg)) {
> - pr_err(PREFIX "Failed to get DAC regulator from %s: %ld\n",
> - dev_name(&omap3pandora_snd_device->dev),
> - PTR_ERR(omap3pandora_dac_reg));
> - ret = PTR_ERR(omap3pandora_dac_reg);
> - goto fail3;
> - }
> -
> - return 0;
> -
> -fail3:
> - platform_device_del(omap3pandora_snd_device);
> -fail2:
> - platform_device_put(omap3pandora_snd_device);
> -
> - return ret;
> -}
> -module_init(omap3pandora_soc_init);
> -
> -static void __exit omap3pandora_soc_exit(void)
> -{
> - regulator_put(omap3pandora_dac_reg);
> - platform_device_unregister(omap3pandora_snd_device);
> -}
> -module_exit(omap3pandora_soc_exit);
> -
> -MODULE_AUTHOR("Grazvydas Ignotas <notasas@gmail.com>");
> -MODULE_DESCRIPTION("ALSA SoC OMAP3 Pandora");
> -MODULE_LICENSE("GPL");
> 
> -- 
> 2.47.3
> 
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-06-19  5:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-03 12:09 [PATCH 0/4] ASoC: drop some mach-types.h inclusions Sascha Hauer
2026-06-03 12:09 ` [PATCH 1/4] ASoC: fsl: eukrea-tlv320: drop unused machine support Sascha Hauer
2026-06-03 12:09 ` [PATCH 2/4] ASoC: ti: omap3pandora: remove Sascha Hauer
2026-06-03 14:00   ` Andreas Kemnade
2026-06-03 16:26     ` H. Nikolaus Schaller
2026-06-03 17:33       ` Andreas Kemnade
2026-06-03 17:42         ` H. Nikolaus Schaller
2026-06-19  5:12   ` H. Nikolaus Schaller
2026-06-03 12:09 ` [PATCH 3/4] ASoC: ti: rx51: drop unnecessary machine checks Sascha Hauer
2026-06-03 17:42   ` Jarkko Nikula
2026-06-03 12:09 ` [PATCH 4/4] ASoC: ti: n810: drop unused header inclusion Sascha Hauer

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®