Skip to content

Commit ae4fc53

Browse files
shumingfanbroonie
authored andcommitted
ASoC: dapm: use component prefix when checking widget names
On a TigerLake SoundWire platform, we see these warnings: [ 27.360086] rt5682 sdw:0:25d:5682:0: ASoC: DAPM unknown pin MICBIAS [ 27.360092] rt5682 sdw:0:25d:5682:0: ASoC: DAPM unknown pin Vref2 This is root-caused to the addition of a component prefix in the machine driver. The tests in soc-dapm should account for a prefix instead of reporting an invalid issue. Reported-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Signed-off-by: Shuming Fan <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d40dac7 commit ae4fc53

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

sound/soc/soc-dapm.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2528,9 +2528,20 @@ static struct snd_soc_dapm_widget *dapm_find_widget(
25282528
{
25292529
struct snd_soc_dapm_widget *w;
25302530
struct snd_soc_dapm_widget *fallback = NULL;
2531+
char prefixed_pin[80];
2532+
const char *pin_name;
2533+
const char *prefix = soc_dapm_prefix(dapm);
2534+
2535+
if (prefix) {
2536+
snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s",
2537+
prefix, pin);
2538+
pin_name = prefixed_pin;
2539+
} else {
2540+
pin_name = pin;
2541+
}
25312542

25322543
for_each_card_widgets(dapm->card, w) {
2533-
if (!strcmp(w->name, pin)) {
2544+
if (!strcmp(w->name, pin_name)) {
25342545
if (w->dapm == dapm)
25352546
return w;
25362547
else

0 commit comments

Comments
 (0)