From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>, Sen Wang <sen@ti.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
linux-sound@vger.kernel.org, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] ASoC: ti: omap-twl4030: use per-device instance of headset jack gpio
Date: Sat, 25 Jul 2026 03:10:09 +0200 [thread overview]
Message-ID: <amQM056GAKZzudvp@venus> (raw)
In-Reply-To: <20260724233432.31325-2-dmitry.torokhov@gmail.com>
[-- 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 --]
next prev parent reply other threads:[~2026-07-25 1:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-07-25 1:09 ` [PATCH 1/2] ASoC: ti: omap-twl4030: drop support for platform data Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=amQM056GAKZzudvp@venus \
--to=sebastian.reichel@collabora.com \
--cc=broonie@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jarkko.nikula@bitmer.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=sen@ti.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox