mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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 <chancel.liu@nxp.com> Link: https://patch.msgid.link/20260507013654.2945915-4-chancel.liu@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
51271184a0
commit
68bb9a7f55
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user