[PATCH] ASoC: imx-rpmsg: Fix ignore-suspend-widgets only applied to codec DAPM

Chancel Liu chancel.liu at nxp.com
Mon Apr 13 13:13:51 AEST 2026


Hi Mark,

Thank you for the review and feedback.

> > 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.
> 
> > --- a/sound/soc/fsl/imx-rpmsg.c
> > +++ b/sound/soc/fsl/imx-rpmsg.c
> 
> > +		num_widgets = of_property_count_strings(data->card.dev-
> >of_node,
> > +							"ignore-suspend-
> widgets");
> 
> Don't we get an error code back if the property doesn't exist at all?
> 

It's a mistake here. I will fix it.

> > +		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;
> > +					}
> > +				}
> > +			}
> > +		}
> 
> This seems like the wrong level to implement this search, it should be
> in the core.  I'm also not seeing any prefix handling, the widget name
> might've been prefixed at runtime.

Thanks for pointing this out. I really appreciate your suggestion to
move this functionality into core-level. Several machine drivers could
benefit if there's an unified ignore‑suspend mechanism.

I have an idea to make it support a generic and reusable mechanism in
the core rather than something each machine driver has to re‑implement.
The design follows a simple structure:

1. Parse and store the name of widgets to ignore suspend in 
struct snd_soc_card

The name list of widgets to ignore suspend can come either from DT or
from the machine driver. Different boards/machines have different
routing and power requirements. So allowing DT to specify
"ignore-suspend-widgets" is important. It enables each device to define
its own policy rather than forcing hard‑coded rules. To support this, a
helper such as snd_soc_of_parse_ignore_suspend_widgets() can be defined
in core and provided.

2. Apply ignore_suspend flags during snd_soc_bind_card()

After all components have been probed and all DAPM widgets are
registered in snd_soc_bind_card(), perform a unified search through
the card’s widget list and mark matching widgets with
ignore_suspend = 1. Any runtime prefixing applied during widget
creation should be handled well by the lookup.

Please let me know if the approach makes sense or if there are any
concerns I should address before posting the next revision.

Regards, 
Chancel Liu


More information about the Linuxppc-dev mailing list