Skip to content

Commit 8de17e9

Browse files
author
Fox Snowpatch
committed
1 parent 182544a commit 8de17e9

1 file changed

Lines changed: 20 additions & 17 deletions

File tree

sound/soc/fsl/imx-rpmsg.c

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,29 @@ static int imx_rpmsg_late_probe(struct snd_soc_card *card)
4040
int ret;
4141

4242
if (data->lpa) {
43-
struct snd_soc_component *codec_comp;
43+
struct snd_soc_dapm_widget *w;
4444
struct device_node *codec_np;
4545
struct device_driver *codec_drv;
4646
struct device *codec_dev = NULL;
47+
int i, num_widgets;
48+
const char *widgets;
49+
50+
num_widgets = of_property_count_strings(data->card.dev->of_node,
51+
"ignore-suspend-widgets");
52+
for_each_card_widgets(card, w) {
53+
for (i = 0; i < num_widgets; i++) {
54+
of_property_read_string_index(data->card.dev->of_node,
55+
"ignore-suspend-widgets",
56+
i, &widgets);
57+
if (!strcmp(w->name, widgets)) {
58+
ret = snd_soc_dapm_ignore_suspend(w->dapm, widgets);
59+
if (ret) {
60+
dev_err(dev, "failed to find ignore suspend widgets\n");
61+
return ret;
62+
}
63+
}
64+
}
65+
}
4766

4867
codec_np = data->dai.codecs->of_node;
4968
if (codec_np) {
@@ -60,22 +79,6 @@ static int imx_rpmsg_late_probe(struct snd_soc_card *card)
6079
}
6180
}
6281
if (codec_dev) {
63-
codec_comp = snd_soc_lookup_component_nolocked(codec_dev, NULL);
64-
if (codec_comp) {
65-
int i, num_widgets;
66-
const char *widgets;
67-
struct snd_soc_dapm_context *dapm;
68-
69-
num_widgets = of_property_count_strings(data->card.dev->of_node,
70-
"ignore-suspend-widgets");
71-
for (i = 0; i < num_widgets; i++) {
72-
of_property_read_string_index(data->card.dev->of_node,
73-
"ignore-suspend-widgets",
74-
i, &widgets);
75-
dapm = snd_soc_component_to_dapm(codec_comp);
76-
snd_soc_dapm_ignore_suspend(dapm, widgets);
77-
}
78-
}
7982
codec_drv = codec_dev->driver;
8083
if (codec_drv->pm) {
8184
memcpy(&lpa_pm, codec_drv->pm, sizeof(lpa_pm));

0 commit comments

Comments
 (0)