From: Chancel Liu Date: Thu, 7 May 2026 01:36:54 +0000 (+0900) Subject: ASoC: fsl: imx-rpmsg: Switch to core ignore-suspend-widgets support X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68bb9a7f557a504b9221717c708a0d14aa727815;p=thirdparty%2Flinux.git ASoC: fsl: imx-rpmsg: Switch to core ignore-suspend-widgets support The imx-rpmsg machine driver currently implements its own logic to parse ignore-suspend-widgets from Device Tree and manually traverse DAPM widgets to mark them as ignore_suspend. It also has a potential issue that some widgets listed in the property (e.g. "Headphone Jack") belong to card or CPU DAI DAPM context. Switch to use snd_soc_of_parse_ignore_suspend_widgets() with the introduction of a generic ignore-suspend-widgets mechanism in the ASoC core. Signed-off-by: Chancel Liu Link: https://patch.msgid.link/20260507013654.2945915-4-chancel.liu@nxp.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/fsl/imx-rpmsg.c b/sound/soc/fsl/imx-rpmsg.c index 40e0043cfe15e..fd4624786b627 100644 --- a/sound/soc/fsl/imx-rpmsg.c +++ b/sound/soc/fsl/imx-rpmsg.c @@ -87,7 +87,6 @@ static int imx_rpmsg_late_probe(struct snd_soc_card *card) int ret; if (data->lpa) { - struct snd_soc_component *codec_comp; struct device_node *codec_np; struct device_driver *codec_drv; struct device *codec_dev = NULL; @@ -107,22 +106,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)); @@ -274,6 +257,15 @@ static int imx_rpmsg_probe(struct platform_device *pdev) } } + if (data->lpa && of_property_present(np, "ignore-suspend-widgets")) { + ret = snd_soc_of_parse_ignore_suspend_widgets(&data->card, + "ignore-suspend-widgets"); + if (ret) { + dev_err(&pdev->dev, "failed to parse ignore-suspend-widgets: %d\n", ret); + goto fail; + } + } + platform_set_drvdata(pdev, &data->card); snd_soc_card_set_drvdata(&data->card, data); ret = devm_snd_soc_register_card(&pdev->dev, &data->card);