From: Chancel Liu <chancel.liu@nxp.com>
To: broonie@kernel.org, lgirdwood@gmail.com, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org
Cc: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com,
nicoleotsuka@gmail.com, perex@perex.cz, tiwai@suse.com,
Frank.Li@nxp.com, s.hauer@pengutronix.de,
linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] ASoC: imx-rpmsg: Support headphone jack detection
Date: Tue, 26 May 2026 14:38:14 +0900 [thread overview]
Message-ID: <20260526053815.140008-3-chancel.liu@nxp.com> (raw)
In-Reply-To: <20260526053815.140008-1-chancel.liu@nxp.com>
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 <chancel.liu@nxp.com>
---
sound/soc/fsl/imx-rpmsg.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c
index fd4624786b62..e93ca31e75da 100644
--- a/sound/soc/fsl/imx-rpmsg.c
+++ b/sound/soc/fsl/imx-rpmsg.c
@@ -12,6 +12,7 @@
#include <sound/control.h>
#include <sound/pcm_params.h>
#include <sound/soc-dapm.h>
+#include <sound/simple_card_utils.h>
#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;
@@ -274,6 +276,12 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
goto fail;
}
+ if (of_property_present(np, "hp-det-gpios")) {
+ ret = simple_util_init_jack(&data->card, &data->hp_jack,
+ 1, NULL, "Headphone Jack");
+ if (ret)
+ goto fail;
+ }
fail:
pdev->dev.of_node = NULL;
return ret;
--
2.50.1
next prev parent reply other threads:[~2026-05-26 5:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 5:38 [PATCH 0/3] ASoC: imx-rpmsg: Add headphone jack detection and driver_name support Chancel Liu
2026-05-26 5:38 ` [PATCH 1/3] ASoC: dt-bindings: fsl,rpmsg: Add hp-det-gpios property Chancel Liu
2026-05-26 5:38 ` Chancel Liu [this message]
2026-05-26 15:34 ` [PATCH 2/3] ASoC: imx-rpmsg: Support headphone jack detection Mark Brown
2026-05-27 3:05 ` Chancel Liu (OSS)
2026-05-26 5:38 ` [PATCH 3/3] ASoC: imx-rpmsg: Set driver_name for snd_soc_card Chancel Liu
2026-05-28 2:07 ` [PATCH v2 0/3] ASoC: imx-rpmsg: Add headphone jack detection and driver_name support Chancel Liu
2026-05-28 2:07 ` [PATCH v2 1/3] ASoC: dt-bindings: fsl,rpmsg: Add hp-det-gpios property Chancel Liu
2026-05-28 2:07 ` [PATCH v2 2/3] ASoC: imx-rpmsg: Support headphone jack detection Chancel Liu
2026-05-28 2:07 ` [PATCH v2 3/3] ASoC: imx-rpmsg: Set driver_name for snd_soc_card Chancel Liu
2026-05-28 14:12 ` [PATCH v2 0/3] ASoC: imx-rpmsg: Add headphone jack detection and driver_name support Andrew Lunn
2026-05-28 14:18 ` Mark Brown
2026-05-28 14:41 ` Andrew Lunn
2026-06-08 17:53 ` Mark Brown
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=20260526053815.140008-3-chancel.liu@nxp.com \
--to=chancel.liu@nxp.com \
--cc=Frank.Li@nxp.com \
--cc=Xiubo.Lee@gmail.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shengjiu.wang@gmail.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