From 1558039bea601dfa077cbcc4a995361d1854e4a4 Mon Sep 17 00:00:00 2001 From: Chancel Liu Date: Thu, 28 May 2026 11:07:23 +0900 Subject: [PATCH 1/3] ASoC: dt-bindings: fsl,rpmsg: Add hp-det-gpios property Sound cards using the i.MX RPMSG audio interface may connect a headphone jack with GPIO-based insertion detection. Add the "hp-det-gpios" property to the fsl,rpmsg binding to support this configuration. Signed-off-by: Chancel Liu Link: https://patch.msgid.link/20260528020725.2265321-2-chancel.liu@nxp.com Signed-off-by: Mark Brown --- Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml index 3a32f7517d0c..e3cadb93c183 100644 --- a/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml +++ b/Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml @@ -98,6 +98,10 @@ properties: - rpmsg-audio-channel - rpmsg-micfil-channel + hp-det-gpios: + maxItems: 1 + description: The GPIO that detect headphones are plugged in + required: - compatible From ec74d4f934a63f8146f704eb0ed7b3af2b819a8d Mon Sep 17 00:00:00 2001 From: Chancel Liu Date: Thu, 28 May 2026 11:07:24 +0900 Subject: [PATCH 2/3] ASoC: imx-rpmsg: Support headphone jack detection Add headphone jack detection support for i.MX RPMSG audio cards. When the "hp-det-gpios" property is present in the device tree node, use simple_util_init_jack() from the ASoC simple card utilities to register a headphone jack with GPIO-based insertion detection. Signed-off-by: Chancel Liu Link: https://patch.msgid.link/20260528020725.2265321-3-chancel.liu@nxp.com Signed-off-by: Mark Brown --- sound/soc/fsl/Kconfig | 1 + sound/soc/fsl/imx-rpmsg.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index ae8774e11873..8ae59c094878 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -358,6 +358,7 @@ config SND_SOC_IMX_RPMSG depends on OF && I2C select SND_SOC_IMX_PCM_RPMSG select SND_SOC_IMX_AUDIO_RPMSG + select SND_SIMPLE_CARD_UTILS help SoC Audio support for i.MX boards with rpmsg. There should be rpmsg devices defined in other core (M core) diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c index fd4624786b62..48fe471499ba 100644 --- a/sound/soc/fsl/imx-rpmsg.c +++ b/sound/soc/fsl/imx-rpmsg.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "imx-pcm-rpmsg.h" struct imx_rpmsg { @@ -19,6 +20,7 @@ struct imx_rpmsg { struct snd_soc_card card; unsigned long sysclk; bool lpa; + struct simple_util_jack hp_jack; }; static struct dev_pm_ops lpa_pm; @@ -86,6 +88,15 @@ static int imx_rpmsg_late_probe(struct snd_soc_card *card) struct device *dev = card->dev; int ret; + if (of_property_present(card->dev->of_node, "hp-det-gpios")) { + ret = simple_util_init_jack(card, &data->hp_jack, + 1, NULL, "Headphone Jack"); + if (ret) { + dev_err(dev, "failed to init hp jack\n"); + return ret; + } + } + if (data->lpa) { struct device_node *codec_np; struct device_driver *codec_drv; From af0d8aa7fcd5c63a6a5077c5a21c7f8f2695cf94 Mon Sep 17 00:00:00 2001 From: Chancel Liu Date: Thu, 28 May 2026 11:07:25 +0900 Subject: [PATCH 3/3] ASoC: imx-rpmsg: Set driver_name for snd_soc_card Set driver_name to "imx-audio-rpmsg" for the i.MX RPMSG sound card. This allows userspace audio configuration tools (e.g., UCM) to match the card by driver name independently of the card name, which may vary across board configurations. Signed-off-by: Chancel Liu Link: https://patch.msgid.link/20260528020725.2265321-4-chancel.liu@nxp.com Signed-off-by: Mark Brown --- sound/soc/fsl/imx-rpmsg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c index 48fe471499ba..5f1af258caf2 100644 --- a/sound/soc/fsl/imx-rpmsg.c +++ b/sound/soc/fsl/imx-rpmsg.c @@ -250,6 +250,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev) data->card.dapm_widgets = imx_rpmsg_dapm_widgets; data->card.num_dapm_widgets = ARRAY_SIZE(imx_rpmsg_dapm_widgets); data->card.late_probe = imx_rpmsg_late_probe; + data->card.driver_name = "imx-audio-rpmsg"; /* * Inoder to use common api to get card name and audio routing. * Use parent of_node for this device, revert it after finishing using