From: Chancel Liu <chancel.liu@nxp.com>
To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com,
nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org,
perex@perex.cz, tiwai@suse.com, Frank.Li@nxp.com,
s.hauer@pengutronix.de, kernel@pengutronix.de,
linux-sound@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] ASoC: imx-rpmsg: Fix ignore-suspend-widgets only applied to codec DAPM
Date: Sat, 11 Apr 2026 16:24:39 +0900 [thread overview]
Message-ID: <20260411072439.1125664-1-chancel.liu@nxp.com> (raw)
Currently the property "ignore-suspend-widgets" are applied only to the
codec's DAPM context. However, some widgets listed in the property
(e.g. "Headphone Jack") belong to card or CPU DAI DAPM context.
Extend the handling so that widgets which are marked ignoring suspend
are looked up across all widgets in the card.
Fixes: 5d9f746ca64c ("ASoC: imx-rpmsg: Force codec power on in low power audio mode")
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
---
sound/soc/fsl/imx-rpmsg.c | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c
index 40e0043cfe15..4b09b22d413a 100644
--- a/sound/soc/fsl/imx-rpmsg.c
+++ b/sound/soc/fsl/imx-rpmsg.c
@@ -87,10 +87,29 @@ static int imx_rpmsg_late_probe(struct snd_soc_card *card)
int ret;
if (data->lpa) {
- struct snd_soc_component *codec_comp;
+ struct snd_soc_dapm_widget *w;
struct device_node *codec_np;
struct device_driver *codec_drv;
struct device *codec_dev = NULL;
+ int i, num_widgets;
+ const char *widgets;
+
+ num_widgets = of_property_count_strings(data->card.dev->of_node,
+ "ignore-suspend-widgets");
+ for_each_card_widgets(card, w) {
+ for (i = 0; i < num_widgets; i++) {
+ of_property_read_string_index(data->card.dev->of_node,
+ "ignore-suspend-widgets",
+ i, &widgets);
+ if (!strcmp(w->name, widgets)) {
+ ret = snd_soc_dapm_ignore_suspend(w->dapm, widgets);
+ if (ret) {
+ dev_err(dev, "failed to find ignore suspend widgets\n");
+ return ret;
+ }
+ }
+ }
+ }
codec_np = data->dai.codecs->of_node;
if (codec_np) {
@@ -107,22 +126,6 @@ static int imx_rpmsg_late_probe(struct snd_soc_card *card)
}
}
if (codec_dev) {
- codec_comp = snd_soc_lookup_component_nolocked(codec_dev, NULL);
- if (codec_comp) {
- int i, num_widgets;
- const char *widgets;
- struct snd_soc_dapm_context *dapm;
-
- num_widgets = of_property_count_strings(data->card.dev->of_node,
- "ignore-suspend-widgets");
- for (i = 0; i < num_widgets; i++) {
- of_property_read_string_index(data->card.dev->of_node,
- "ignore-suspend-widgets",
- i, &widgets);
- dapm = snd_soc_component_to_dapm(codec_comp);
- snd_soc_dapm_ignore_suspend(dapm, widgets);
- }
- }
codec_drv = codec_dev->driver;
if (codec_drv->pm) {
memcpy(&lpa_pm, codec_drv->pm, sizeof(lpa_pm));
--
2.50.1
next reply other threads:[~2026-04-11 7:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-11 7:24 Chancel Liu [this message]
2026-04-11 10:40 ` [PATCH] ASoC: imx-rpmsg: Fix ignore-suspend-widgets only applied to codec DAPM 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=20260411072439.1125664-1-chancel.liu@nxp.com \
--to=chancel.liu@nxp.com \
--cc=Frank.Li@nxp.com \
--cc=Xiubo.Lee@gmail.com \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--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