Re: [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform data

Sebastian Reichel <[email protected]> Sat, 25 Jul 2026 03:09:37 +0200
Newsgroups org.kernel.vger.linux-omap,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound
Message-ID <amQMsPAeErtOa6NU@venus>
--so67j757oqyrqzxh
Content-Type: text/plain; protected-headers=v1; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: Re: [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform
 data
MIME-Version: 1.0

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.
>=20
> Signed-off-by: Dmitry Torokhov <[email protected]>
> ---

Reviewed-by: Sebastian Reichel <[email protected]>

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
>=20
> diff --git a/include/linux/platform_data/omap-twl4030.h b/include/linux/p=
latform_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 twl=
4030
> - *		    codec, header.
> - *
> - * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com
> - * All rights reserved.
> - *
> - * Author: Peter Ujfalusi <[email protected]>
> - */
> -
> -#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 @@
>   */
> =20
>  #include <linux/platform_device.h>
> -#include <linux/platform_data/omap-twl4030.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> =20
> @@ -133,20 +132,12 @@ static struct snd_soc_jack_gpio hs_jack_gpios[] =3D=
 {
>  	},
>  };
> =20
> -static inline void twl4030_disconnect_pin(struct snd_soc_dapm_context *d=
apm,
> -					  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 =3D rtd->card;
> -	struct snd_soc_dapm_context *dapm =3D snd_soc_card_to_dapm(card);
> -	struct omap_tw4030_pdata *pdata =3D dev_get_platdata(card->dev);
> +
>  	struct omap_twl4030 *priv =3D snd_soc_card_get_drvdata(card);
> -	int ret =3D 0;
> +	int ret;
> =20
>  	/*
>  	 * 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_runt=
ime *rtd)
>  			return ret;
>  	}
> =20
> -	/*
> -	 * 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;
>  }
> =20
>  /* Digital audio interface glue - connects codec <--> CPU */
> @@ -237,11 +206,15 @@ static struct snd_soc_card omap_twl4030_card =3D {
> =20
>  static int omap_twl4030_probe(struct platform_device *pdev)
>  {
> -	struct omap_tw4030_pdata *pdata =3D dev_get_platdata(&pdev->dev);
> -	struct device_node *node =3D pdev->dev.of_node;
>  	struct snd_soc_card *card =3D &omap_twl4030_card;
> +	struct device_node *node, *dai_node;
>  	struct omap_twl4030 *priv;
> -	int ret =3D 0;
> +	struct property *prop;
> +	int ret;
> +
> +	node =3D pdev->dev.of_node;
> +	if (!node)
> +		return -ENODEV;
> =20
>  	card->dev =3D &pdev->dev;
> =20
> @@ -249,62 +222,43 @@ static int omap_twl4030_probe(struct platform_devic=
e *pdev)
>  	if (priv =3D=3D NULL)
>  		return -ENOMEM;
> =20
> -	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 =3D 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  =3D NULL;
> -		omap_twl4030_dai_links[0].cpus->of_node =3D dai_node;
> -
> -		omap_twl4030_dai_links[0].platforms->name  =3D NULL;
> -		omap_twl4030_dai_links[0].platforms->of_node =3D dai_node;
> -
> -		dai_node =3D of_parse_phandle(node, "ti,mcbsp-voice", 0);
> -		if (!dai_node) {
> -			card->num_links =3D 1;
> -		} else {
> -			omap_twl4030_dai_links[1].cpus->dai_name  =3D NULL;
> -			omap_twl4030_dai_links[1].cpus->of_node =3D dai_node;
> -
> -			omap_twl4030_dai_links[1].platforms->name  =3D NULL;
> -			omap_twl4030_dai_links[1].platforms->of_node =3D dai_node;
> -		}
> -
> -		/* Optional: audio routing can be provided */
> -		prop =3D of_find_property(node, "ti,audio-routing", NULL);
> -		if (prop) {
> -			ret =3D snd_soc_of_parse_audio_routing(card,
> -							    "ti,audio-routing");
> -			if (ret)
> -				return ret;
> -
> -			card->fully_routed =3D 1;
> -		}
> -	} else if (pdata) {
> -		if (pdata->card_name) {
> -			card->name =3D pdata->card_name;
> -		} else {
> -			dev_err(&pdev->dev, "Card name is not provided\n");
> -			return -ENODEV;
> -		}
> -
> -		if (!pdata->voice_connected)
> -			card->num_links =3D 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;
>  	}
> =20
> +	dai_node =3D 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  =3D NULL;
> +	omap_twl4030_dai_links[0].cpus->of_node =3D dai_node;
> +
> +	omap_twl4030_dai_links[0].platforms->name  =3D NULL;
> +	omap_twl4030_dai_links[0].platforms->of_node =3D dai_node;
> +
> +	dai_node =3D of_parse_phandle(node, "ti,mcbsp-voice", 0);
> +	if (!dai_node) {
> +		card->num_links =3D 1;
> +	} else {
> +		omap_twl4030_dai_links[1].cpus->dai_name  =3D NULL;
> +		omap_twl4030_dai_links[1].cpus->of_node =3D dai_node;
> +
> +		omap_twl4030_dai_links[1].platforms->name  =3D NULL;
> +		omap_twl4030_dai_links[1].platforms->of_node =3D dai_node;
> +	}
> +
> +	/* Optional: audio routing can be provided */
> +	prop =3D of_find_property(node, "ti,audio-routing", NULL);
> +	if (prop) {
> +		ret =3D snd_soc_of_parse_audio_routing(card, "ti,audio-routing");
> +		if (ret)
> +			return ret;
> +
> +		card->fully_routed =3D 1;
> +	}
> +
>  	snd_soc_card_set_drvdata(card, priv);
>  	ret =3D devm_snd_soc_register_card(&pdev->dev, card);
>  	if (ret) {
> --=20
> 2.55.0.229.g6434b31f56-goog
>=20
>=20

--so67j757oqyrqzxh
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmpkDM0ACgkQ2O7X88g7
+ppQlA/9Grjih9lj61FY/M77Qhsm/xs3mjxhcl/qX+4I0aDD3ZyaNoGDnys+5kzT
xFS0e0x0pLH2Sh4haACnQlWmYqTbQSaCDrG4fkjU1VHuHErU/7EUIOEyNyLHv/UG
Ud5qoDP2BHl6XnVMK78zzhsnQmOrjipv1Wa7Pyr7VaH5Vf/3Hdl/u5Nxb0xRHRYH
FvrfResG3tzo6MdFpBcI6j3TUiFbyS9Rzmfz55rxX0/wv/4e3R/F9ONk2kVftdBw
Jf3cCbZiBkO32JGdlzF+HdmnEU+FAQ2FcPvaP1HlAuGcAlUauK3sY07Ppq6zRzyh
S/QVtuBjBA9dJ6kl99s6vlSvKN9FCHxePmBP4apNBE6F9/pytL4VFNgqtSQ2xn0x
bsTM3qnChIOJNSuNhNzswebNgc+F3slP56JDg96ad2lpfM14Ow1MuBOcn0/e7uA4
SYcqJjbjyrSh7XFmxKl3VMiSSzKbzvI4qNgBzitPgiehopYN1TFlbLDMNJjh0xBO
Of5tWyvRUew5fAro3L3/14tQlBkqfnYHF/u4p41hxfJoTs5iCVQwQ7zVAkh0I9d6
8vA/XbKoBEG9AzMpI2+xbEs/hRT8+vOdV0v9YZrl24GnzxS3DgYCq5UZIcgYlQoi
Pw6mgZ/V7gmtvvGiPXlBf8MA0n5Npd6zXrxDkdEtorjjQQc6I04=
=Weu5
-----END PGP SIGNATURE-----

--so67j757oqyrqzxh--