Skip to content

Commit

Permalink
ASoC: dapm: use component prefix when checking widget names
Browse files Browse the repository at this point in the history
commit ae4fc53 upstream.

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 <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Shuming Fan <shumingf@realtek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210208234043.59750-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Robert Lee <lerobert@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
shumingfan authored and gregkh committed Oct 6, 2021
1 parent 5c3a90b commit 4ad4852
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion sound/soc/soc-dapm.c
Expand Up @@ -2528,9 +2528,20 @@ static struct snd_soc_dapm_widget *dapm_find_widget(
{
struct snd_soc_dapm_widget *w;
struct snd_soc_dapm_widget *fallback = NULL;
char prefixed_pin[80];
const char *pin_name;
const char *prefix = soc_dapm_prefix(dapm);

if (prefix) {
snprintf(prefixed_pin, sizeof(prefixed_pin), "%s %s",
prefix, pin);
pin_name = prefixed_pin;
} else {
pin_name = pin;
}

for_each_card_widgets(dapm->card, w) {
if (!strcmp(w->name, pin)) {
if (!strcmp(w->name, pin_name)) {
if (w->dapm == dapm)
return w;
else
Expand Down

0 comments on commit 4ad4852

Please sign in to comment.