* [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform data
@ 2026-07-24 23:34 Dmitry Torokhov
2026-07-24 23:34 ` [PATCH 2/2] ASoC: ti: omap-twl4030: use per-device instance of headset jack gpio Dmitry Torokhov
2026-07-25 1:09 ` [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform data Sebastian Reichel
0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2026-07-24 23:34 UTC (permalink / raw)
To: Jarkko Nikula, Sen Wang, Liam Girdwood, Mark Brown
Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, linux-omap,
linux-kernel
There are no users of omap_tw4030_pdata in the mainline kernel so
remove support for it from the driver.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
include/linux/platform_data/omap-twl4030.h | 42 -------
sound/soc/ti/omap-twl4030.c | 134 +++++++--------------
2 files changed, 44 insertions(+), 132 deletions(-)
delete mode 100644 include/linux/platform_data/omap-twl4030.h
diff --git a/include/linux/platform_data/omap-twl4030.h b/include/linux/platform_data/omap-twl4030.h
deleted file mode 100644
index 7fcb55fe21c9..000000000000
--- a/include/linux/platform_data/omap-twl4030.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/**
- * omap-twl4030.h - ASoC machine driver for TI SoC based boards with twl4030
- * codec, header.
- *
- * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com
- * All rights reserved.
- *
- * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
- */
-
-#ifndef _OMAP_TWL4030_H_
-#define _OMAP_TWL4030_H_
-
-/* To select if only one channel is connected in a stereo port */
-#define OMAP_TWL4030_LEFT (1 << 0)
-#define OMAP_TWL4030_RIGHT (1 << 1)
-
-struct omap_tw4030_pdata {
- const char *card_name;
- /* Voice port is connected to McBSP3 */
- bool voice_connected;
-
- /* The driver will parse the connection flags if this flag is set */
- bool custom_routing;
- /* Flags to indicate connected audio ports. */
- u8 has_hs;
- u8 has_hf;
- u8 has_predriv;
- u8 has_carkit;
- bool has_ear;
-
- bool has_mainmic;
- bool has_submic;
- bool has_hsmic;
- bool has_carkitmic;
- bool has_digimic0;
- bool has_digimic1;
- u8 has_linein;
-};
-
-#endif /* _OMAP_TWL4030_H_ */
diff --git a/sound/soc/ti/omap-twl4030.c b/sound/soc/ti/omap-twl4030.c
index 4d80f8a7a947..950879fc7275 100644
--- a/sound/soc/ti/omap-twl4030.c
+++ b/sound/soc/ti/omap-twl4030.c
@@ -17,7 +17,6 @@
*/
#include <linux/platform_device.h>
-#include <linux/platform_data/omap-twl4030.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -133,20 +132,12 @@ static struct snd_soc_jack_gpio hs_jack_gpios[] = {
},
};
-static inline void twl4030_disconnect_pin(struct snd_soc_dapm_context *dapm,
- int connected, char *pin)
-{
- if (!connected)
- snd_soc_dapm_disable_pin(dapm, pin);
-}
-
static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_card *card = rtd->card;
- struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
- struct omap_tw4030_pdata *pdata = dev_get_platdata(card->dev);
+
struct omap_twl4030 *priv = snd_soc_card_get_drvdata(card);
- int ret = 0;
+ int ret;
/*
* This is a bit of a hack, but the GPIO is optional so we
@@ -170,29 +161,7 @@ static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
return ret;
}
- /*
- * NULL pdata means we booted with DT. In this case the routing is
- * provided and the card is fully routed, no need to mark pins.
- */
- if (!pdata || !pdata->custom_routing)
- return ret;
-
- /* Disable not connected paths if not used */
- twl4030_disconnect_pin(dapm, pdata->has_ear, "Earpiece Spk");
- twl4030_disconnect_pin(dapm, pdata->has_hf, "Handsfree Spk");
- twl4030_disconnect_pin(dapm, pdata->has_hs, "Headset Stereophone");
- twl4030_disconnect_pin(dapm, pdata->has_predriv, "Ext Spk");
- twl4030_disconnect_pin(dapm, pdata->has_carkit, "Carkit Spk");
-
- twl4030_disconnect_pin(dapm, pdata->has_mainmic, "Main Mic");
- twl4030_disconnect_pin(dapm, pdata->has_submic, "Sub Mic");
- twl4030_disconnect_pin(dapm, pdata->has_hsmic, "Headset Mic");
- twl4030_disconnect_pin(dapm, pdata->has_carkitmic, "Carkit Mic");
- twl4030_disconnect_pin(dapm, pdata->has_digimic0, "Digital0 Mic");
- twl4030_disconnect_pin(dapm, pdata->has_digimic1, "Digital1 Mic");
- twl4030_disconnect_pin(dapm, pdata->has_linein, "Line In");
-
- return ret;
+ return 0;
}
/* Digital audio interface glue - connects codec <--> CPU */
@@ -237,11 +206,15 @@ static struct snd_soc_card omap_twl4030_card = {
static int omap_twl4030_probe(struct platform_device *pdev)
{
- struct omap_tw4030_pdata *pdata = dev_get_platdata(&pdev->dev);
- struct device_node *node = pdev->dev.of_node;
struct snd_soc_card *card = &omap_twl4030_card;
+ struct device_node *node, *dai_node;
struct omap_twl4030 *priv;
- int ret = 0;
+ struct property *prop;
+ int ret;
+
+ node = pdev->dev.of_node;
+ if (!node)
+ return -ENODEV;
card->dev = &pdev->dev;
@@ -249,62 +222,43 @@ static int omap_twl4030_probe(struct platform_device *pdev)
if (priv == NULL)
return -ENOMEM;
- if (node) {
- struct device_node *dai_node;
- struct property *prop;
-
- if (snd_soc_of_parse_card_name(card, "ti,model")) {
- dev_err(&pdev->dev, "Card name is not provided\n");
- return -ENODEV;
- }
-
- dai_node = of_parse_phandle(node, "ti,mcbsp", 0);
- if (!dai_node) {
- dev_err(&pdev->dev, "McBSP node is not provided\n");
- return -EINVAL;
- }
- omap_twl4030_dai_links[0].cpus->dai_name = NULL;
- omap_twl4030_dai_links[0].cpus->of_node = dai_node;
-
- omap_twl4030_dai_links[0].platforms->name = NULL;
- omap_twl4030_dai_links[0].platforms->of_node = dai_node;
-
- dai_node = of_parse_phandle(node, "ti,mcbsp-voice", 0);
- if (!dai_node) {
- card->num_links = 1;
- } else {
- omap_twl4030_dai_links[1].cpus->dai_name = NULL;
- omap_twl4030_dai_links[1].cpus->of_node = dai_node;
-
- omap_twl4030_dai_links[1].platforms->name = NULL;
- omap_twl4030_dai_links[1].platforms->of_node = dai_node;
- }
-
- /* Optional: audio routing can be provided */
- prop = of_find_property(node, "ti,audio-routing", NULL);
- if (prop) {
- ret = snd_soc_of_parse_audio_routing(card,
- "ti,audio-routing");
- if (ret)
- return ret;
-
- card->fully_routed = 1;
- }
- } else if (pdata) {
- if (pdata->card_name) {
- card->name = pdata->card_name;
- } else {
- dev_err(&pdev->dev, "Card name is not provided\n");
- return -ENODEV;
- }
-
- if (!pdata->voice_connected)
- card->num_links = 1;
- } else {
- dev_err(&pdev->dev, "Missing pdata\n");
+ if (snd_soc_of_parse_card_name(card, "ti,model")) {
+ dev_err(&pdev->dev, "Card name is not provided\n");
return -ENODEV;
}
+ dai_node = of_parse_phandle(node, "ti,mcbsp", 0);
+ if (!dai_node) {
+ dev_err(&pdev->dev, "McBSP node is not provided\n");
+ return -EINVAL;
+ }
+ omap_twl4030_dai_links[0].cpus->dai_name = NULL;
+ omap_twl4030_dai_links[0].cpus->of_node = dai_node;
+
+ omap_twl4030_dai_links[0].platforms->name = NULL;
+ omap_twl4030_dai_links[0].platforms->of_node = dai_node;
+
+ dai_node = of_parse_phandle(node, "ti,mcbsp-voice", 0);
+ if (!dai_node) {
+ card->num_links = 1;
+ } else {
+ omap_twl4030_dai_links[1].cpus->dai_name = NULL;
+ omap_twl4030_dai_links[1].cpus->of_node = dai_node;
+
+ omap_twl4030_dai_links[1].platforms->name = NULL;
+ omap_twl4030_dai_links[1].platforms->of_node = dai_node;
+ }
+
+ /* Optional: audio routing can be provided */
+ prop = of_find_property(node, "ti,audio-routing", NULL);
+ if (prop) {
+ ret = snd_soc_of_parse_audio_routing(card, "ti,audio-routing");
+ if (ret)
+ return ret;
+
+ card->fully_routed = 1;
+ }
+
snd_soc_card_set_drvdata(card, priv);
ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret) {
--
2.55.0.229.g6434b31f56-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] ASoC: ti: omap-twl4030: use per-device instance of headset jack gpio
2026-07-24 23:34 [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform data Dmitry Torokhov
@ 2026-07-24 23:34 ` Dmitry Torokhov
2026-07-25 1:10 ` Sebastian Reichel
2026-07-25 1:09 ` [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform data Sebastian Reichel
1 sibling, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2026-07-24 23:34 UTC (permalink / raw)
To: Jarkko Nikula, Sen Wang, Liam Girdwood, Mark Brown
Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, linux-omap,
linux-kernel
hs_jack_gpios is being potentially shared among several instances of the
same device, and is being modified. This is not the best approach to
structuring the code (even if the device is in fact a singleton).
Change it to allocate a per-device instance.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
sound/soc/ti/omap-twl4030.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/sound/soc/ti/omap-twl4030.c b/sound/soc/ti/omap-twl4030.c
index 950879fc7275..4abcfff04bc7 100644
--- a/sound/soc/ti/omap-twl4030.c
+++ b/sound/soc/ti/omap-twl4030.c
@@ -28,6 +28,7 @@
#include "omap-mcbsp.h"
struct omap_twl4030 {
+ struct snd_soc_jack_gpio hs_jack_gpio;
struct snd_soc_jack hs_jack;
};
@@ -123,15 +124,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
},
};
-/* Headset jack detection gpios */
-static struct snd_soc_jack_gpio hs_jack_gpios[] = {
- {
- .name = "ti,jack-det",
- .report = SND_JACK_HEADSET,
- .debounce_time = 200,
- },
-};
-
static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
{
struct snd_soc_card *card = rtd->card;
@@ -144,9 +136,6 @@ static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
* only want to add the jack detection if the GPIO is there.
*/
if (of_property_present(card->dev->of_node, "ti,jack-det-gpio")) {
- hs_jack_gpios[0].gpiod_dev = card->dev;
- hs_jack_gpios[0].idx = 0;
-
ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack",
SND_JACK_HEADSET,
&priv->hs_jack, hs_jack_pins,
@@ -154,9 +143,14 @@ static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
if (ret)
return ret;
- ret = snd_soc_jack_add_gpios(&priv->hs_jack,
- ARRAY_SIZE(hs_jack_gpios),
- hs_jack_gpios);
+ priv->hs_jack_gpio.name = "ti,jack-det";
+ priv->hs_jack_gpio.report = SND_JACK_HEADSET;
+ priv->hs_jack_gpio.debounce_time = 200;
+ priv->hs_jack_gpio.gpiod_dev = card->dev;
+ priv->hs_jack_gpio.idx = 0;
+
+ ret = snd_soc_jack_add_gpios(&priv->hs_jack, 1,
+ &priv->hs_jack_gpio);
if (ret)
return ret;
}
--
2.55.0.229.g6434b31f56-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 2/2] ASoC: ti: omap-twl4030: use per-device instance of headset jack gpio
2026-07-24 23:34 ` [PATCH 2/2] ASoC: ti: omap-twl4030: use per-device instance of headset jack gpio Dmitry Torokhov
@ 2026-07-25 1:10 ` Sebastian Reichel
0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Reichel @ 2026-07-25 1:10 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Jarkko Nikula, Sen Wang, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, linux-sound, linux-omap,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2521 bytes --]
Hi,
On Fri, Jul 24, 2026 at 04:34:30PM -0700, Dmitry Torokhov wrote:
> hs_jack_gpios is being potentially shared among several instances of the
> same device, and is being modified. This is not the best approach to
> structuring the code (even if the device is in fact a singleton).
> Change it to allocate a per-device instance.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Greetings,
-- Sebastian
> sound/soc/ti/omap-twl4030.c | 24 +++++++++---------------
> 1 file changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/sound/soc/ti/omap-twl4030.c b/sound/soc/ti/omap-twl4030.c
> index 950879fc7275..4abcfff04bc7 100644
> --- a/sound/soc/ti/omap-twl4030.c
> +++ b/sound/soc/ti/omap-twl4030.c
> @@ -28,6 +28,7 @@
> #include "omap-mcbsp.h"
>
> struct omap_twl4030 {
> + struct snd_soc_jack_gpio hs_jack_gpio;
> struct snd_soc_jack hs_jack;
> };
>
> @@ -123,15 +124,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {
> },
> };
>
> -/* Headset jack detection gpios */
> -static struct snd_soc_jack_gpio hs_jack_gpios[] = {
> - {
> - .name = "ti,jack-det",
> - .report = SND_JACK_HEADSET,
> - .debounce_time = 200,
> - },
> -};
> -
> static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_soc_card *card = rtd->card;
> @@ -144,9 +136,6 @@ static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
> * only want to add the jack detection if the GPIO is there.
> */
> if (of_property_present(card->dev->of_node, "ti,jack-det-gpio")) {
> - hs_jack_gpios[0].gpiod_dev = card->dev;
> - hs_jack_gpios[0].idx = 0;
> -
> ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack",
> SND_JACK_HEADSET,
> &priv->hs_jack, hs_jack_pins,
> @@ -154,9 +143,14 @@ static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
> if (ret)
> return ret;
>
> - ret = snd_soc_jack_add_gpios(&priv->hs_jack,
> - ARRAY_SIZE(hs_jack_gpios),
> - hs_jack_gpios);
> + priv->hs_jack_gpio.name = "ti,jack-det";
> + priv->hs_jack_gpio.report = SND_JACK_HEADSET;
> + priv->hs_jack_gpio.debounce_time = 200;
> + priv->hs_jack_gpio.gpiod_dev = card->dev;
> + priv->hs_jack_gpio.idx = 0;
> +
> + ret = snd_soc_jack_add_gpios(&priv->hs_jack, 1,
> + &priv->hs_jack_gpio);
> if (ret)
> return ret;
> }
> --
> 2.55.0.229.g6434b31f56-goog
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform data
2026-07-24 23:34 [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform data Dmitry Torokhov
2026-07-24 23:34 ` [PATCH 2/2] ASoC: ti: omap-twl4030: use per-device instance of headset jack gpio Dmitry Torokhov
@ 2026-07-25 1:09 ` Sebastian Reichel
1 sibling, 0 replies; 4+ messages in thread
From: Sebastian Reichel @ 2026-07-25 1:09 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Jarkko Nikula, Sen Wang, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, linux-sound, linux-omap,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 8207 bytes --]
Hi,
On Fri, Jul 24, 2026 at 04:34:29PM -0700, Dmitry Torokhov wrote:
> There are no users of omap_tw4030_pdata in the mainline kernel so
> remove support for it from the driver.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Greetings,
-- Sebastian
> include/linux/platform_data/omap-twl4030.h | 42 -------
> sound/soc/ti/omap-twl4030.c | 134 +++++++--------------
> 2 files changed, 44 insertions(+), 132 deletions(-)
> delete mode 100644 include/linux/platform_data/omap-twl4030.h
>
> diff --git a/include/linux/platform_data/omap-twl4030.h b/include/linux/platform_data/omap-twl4030.h
> deleted file mode 100644
> index 7fcb55fe21c9..000000000000
> --- a/include/linux/platform_data/omap-twl4030.h
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0-only */
> -/**
> - * omap-twl4030.h - ASoC machine driver for TI SoC based boards with twl4030
> - * codec, header.
> - *
> - * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com
> - * All rights reserved.
> - *
> - * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
> - */
> -
> -#ifndef _OMAP_TWL4030_H_
> -#define _OMAP_TWL4030_H_
> -
> -/* To select if only one channel is connected in a stereo port */
> -#define OMAP_TWL4030_LEFT (1 << 0)
> -#define OMAP_TWL4030_RIGHT (1 << 1)
> -
> -struct omap_tw4030_pdata {
> - const char *card_name;
> - /* Voice port is connected to McBSP3 */
> - bool voice_connected;
> -
> - /* The driver will parse the connection flags if this flag is set */
> - bool custom_routing;
> - /* Flags to indicate connected audio ports. */
> - u8 has_hs;
> - u8 has_hf;
> - u8 has_predriv;
> - u8 has_carkit;
> - bool has_ear;
> -
> - bool has_mainmic;
> - bool has_submic;
> - bool has_hsmic;
> - bool has_carkitmic;
> - bool has_digimic0;
> - bool has_digimic1;
> - u8 has_linein;
> -};
> -
> -#endif /* _OMAP_TWL4030_H_ */
> diff --git a/sound/soc/ti/omap-twl4030.c b/sound/soc/ti/omap-twl4030.c
> index 4d80f8a7a947..950879fc7275 100644
> --- a/sound/soc/ti/omap-twl4030.c
> +++ b/sound/soc/ti/omap-twl4030.c
> @@ -17,7 +17,6 @@
> */
>
> #include <linux/platform_device.h>
> -#include <linux/platform_data/omap-twl4030.h>
> #include <linux/module.h>
> #include <linux/of.h>
>
> @@ -133,20 +132,12 @@ static struct snd_soc_jack_gpio hs_jack_gpios[] = {
> },
> };
>
> -static inline void twl4030_disconnect_pin(struct snd_soc_dapm_context *dapm,
> - int connected, char *pin)
> -{
> - if (!connected)
> - snd_soc_dapm_disable_pin(dapm, pin);
> -}
> -
> static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
> {
> struct snd_soc_card *card = rtd->card;
> - struct snd_soc_dapm_context *dapm = snd_soc_card_to_dapm(card);
> - struct omap_tw4030_pdata *pdata = dev_get_platdata(card->dev);
> +
> struct omap_twl4030 *priv = snd_soc_card_get_drvdata(card);
> - int ret = 0;
> + int ret;
>
> /*
> * This is a bit of a hack, but the GPIO is optional so we
> @@ -170,29 +161,7 @@ static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd)
> return ret;
> }
>
> - /*
> - * NULL pdata means we booted with DT. In this case the routing is
> - * provided and the card is fully routed, no need to mark pins.
> - */
> - if (!pdata || !pdata->custom_routing)
> - return ret;
> -
> - /* Disable not connected paths if not used */
> - twl4030_disconnect_pin(dapm, pdata->has_ear, "Earpiece Spk");
> - twl4030_disconnect_pin(dapm, pdata->has_hf, "Handsfree Spk");
> - twl4030_disconnect_pin(dapm, pdata->has_hs, "Headset Stereophone");
> - twl4030_disconnect_pin(dapm, pdata->has_predriv, "Ext Spk");
> - twl4030_disconnect_pin(dapm, pdata->has_carkit, "Carkit Spk");
> -
> - twl4030_disconnect_pin(dapm, pdata->has_mainmic, "Main Mic");
> - twl4030_disconnect_pin(dapm, pdata->has_submic, "Sub Mic");
> - twl4030_disconnect_pin(dapm, pdata->has_hsmic, "Headset Mic");
> - twl4030_disconnect_pin(dapm, pdata->has_carkitmic, "Carkit Mic");
> - twl4030_disconnect_pin(dapm, pdata->has_digimic0, "Digital0 Mic");
> - twl4030_disconnect_pin(dapm, pdata->has_digimic1, "Digital1 Mic");
> - twl4030_disconnect_pin(dapm, pdata->has_linein, "Line In");
> -
> - return ret;
> + return 0;
> }
>
> /* Digital audio interface glue - connects codec <--> CPU */
> @@ -237,11 +206,15 @@ static struct snd_soc_card omap_twl4030_card = {
>
> static int omap_twl4030_probe(struct platform_device *pdev)
> {
> - struct omap_tw4030_pdata *pdata = dev_get_platdata(&pdev->dev);
> - struct device_node *node = pdev->dev.of_node;
> struct snd_soc_card *card = &omap_twl4030_card;
> + struct device_node *node, *dai_node;
> struct omap_twl4030 *priv;
> - int ret = 0;
> + struct property *prop;
> + int ret;
> +
> + node = pdev->dev.of_node;
> + if (!node)
> + return -ENODEV;
>
> card->dev = &pdev->dev;
>
> @@ -249,62 +222,43 @@ static int omap_twl4030_probe(struct platform_device *pdev)
> if (priv == NULL)
> return -ENOMEM;
>
> - if (node) {
> - struct device_node *dai_node;
> - struct property *prop;
> -
> - if (snd_soc_of_parse_card_name(card, "ti,model")) {
> - dev_err(&pdev->dev, "Card name is not provided\n");
> - return -ENODEV;
> - }
> -
> - dai_node = of_parse_phandle(node, "ti,mcbsp", 0);
> - if (!dai_node) {
> - dev_err(&pdev->dev, "McBSP node is not provided\n");
> - return -EINVAL;
> - }
> - omap_twl4030_dai_links[0].cpus->dai_name = NULL;
> - omap_twl4030_dai_links[0].cpus->of_node = dai_node;
> -
> - omap_twl4030_dai_links[0].platforms->name = NULL;
> - omap_twl4030_dai_links[0].platforms->of_node = dai_node;
> -
> - dai_node = of_parse_phandle(node, "ti,mcbsp-voice", 0);
> - if (!dai_node) {
> - card->num_links = 1;
> - } else {
> - omap_twl4030_dai_links[1].cpus->dai_name = NULL;
> - omap_twl4030_dai_links[1].cpus->of_node = dai_node;
> -
> - omap_twl4030_dai_links[1].platforms->name = NULL;
> - omap_twl4030_dai_links[1].platforms->of_node = dai_node;
> - }
> -
> - /* Optional: audio routing can be provided */
> - prop = of_find_property(node, "ti,audio-routing", NULL);
> - if (prop) {
> - ret = snd_soc_of_parse_audio_routing(card,
> - "ti,audio-routing");
> - if (ret)
> - return ret;
> -
> - card->fully_routed = 1;
> - }
> - } else if (pdata) {
> - if (pdata->card_name) {
> - card->name = pdata->card_name;
> - } else {
> - dev_err(&pdev->dev, "Card name is not provided\n");
> - return -ENODEV;
> - }
> -
> - if (!pdata->voice_connected)
> - card->num_links = 1;
> - } else {
> - dev_err(&pdev->dev, "Missing pdata\n");
> + if (snd_soc_of_parse_card_name(card, "ti,model")) {
> + dev_err(&pdev->dev, "Card name is not provided\n");
> return -ENODEV;
> }
>
> + dai_node = of_parse_phandle(node, "ti,mcbsp", 0);
> + if (!dai_node) {
> + dev_err(&pdev->dev, "McBSP node is not provided\n");
> + return -EINVAL;
> + }
> + omap_twl4030_dai_links[0].cpus->dai_name = NULL;
> + omap_twl4030_dai_links[0].cpus->of_node = dai_node;
> +
> + omap_twl4030_dai_links[0].platforms->name = NULL;
> + omap_twl4030_dai_links[0].platforms->of_node = dai_node;
> +
> + dai_node = of_parse_phandle(node, "ti,mcbsp-voice", 0);
> + if (!dai_node) {
> + card->num_links = 1;
> + } else {
> + omap_twl4030_dai_links[1].cpus->dai_name = NULL;
> + omap_twl4030_dai_links[1].cpus->of_node = dai_node;
> +
> + omap_twl4030_dai_links[1].platforms->name = NULL;
> + omap_twl4030_dai_links[1].platforms->of_node = dai_node;
> + }
> +
> + /* Optional: audio routing can be provided */
> + prop = of_find_property(node, "ti,audio-routing", NULL);
> + if (prop) {
> + ret = snd_soc_of_parse_audio_routing(card, "ti,audio-routing");
> + if (ret)
> + return ret;
> +
> + card->fully_routed = 1;
> + }
> +
> snd_soc_card_set_drvdata(card, priv);
> ret = devm_snd_soc_register_card(&pdev->dev, card);
> if (ret) {
> --
> 2.55.0.229.g6434b31f56-goog
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-25 1:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 23:34 [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform data Dmitry Torokhov
2026-07-24 23:34 ` [PATCH 2/2] ASoC: ti: omap-twl4030: use per-device instance of headset jack gpio Dmitry Torokhov
2026-07-25 1:10 ` Sebastian Reichel
2026-07-25 1:09 ` [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform data Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox