Skip to content

Commit cbd9eed

Browse files
lucaceresolibroonie
authored andcommitted
ASoC: dapm: debugfs: add component to route lines
debugfs entries for DAPM widgets have the following form: Left ADC: Off in 1 out 0 - R2(0x2) mask 0x2 stream Left HiFi Capture inactive out "static" "Capture" in "static" "Left PGA" Lines with the "in" and "out" prefixes describe routes from/to other widgets presenting the path name and the connected widget name. This is ambiguous in case of cards having multiple widgets with the same name in different components. For example the STM32MP157A-DK1 board (arch/arm/boot/dts/st/stm32mp15xx-dkx.dtsi) has a "Capture" widget in both the "cs42l51.0-004a" and the "hdmi-audio-codec.1.auto" components. Avoid the ambiguity by adding the component name to the "in" and "out" lines. Add the new field at the end to minimize backward compatibility issues. The existing vizdapm tool continues working after this change. The output becomes: Left ADC: Off in 1 out 0 - R2(0x2) mask 0x2 stream Left HiFi Capture inactive out "static" "Capture" "cs42l51.0-004a" in "static" "Left PGA" "cs42l51.0-004a" Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20240416-vizdapm-ng-v1-1-5d33c0b57bc5@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 27a153e commit cbd9eed

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

sound/soc/soc-dapm.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,6 +2104,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
21042104
int in, out;
21052105
ssize_t ret;
21062106
struct snd_soc_dapm_path *p = NULL;
2107+
const char *c_name;
21072108

21082109
buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
21092110
if (!buf)
@@ -2145,11 +2146,13 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
21452146
if (!p->connect)
21462147
continue;
21472148

2149+
c_name = p->node[rdir]->dapm->component ?
2150+
p->node[rdir]->dapm->component->name : NULL;
21482151
ret += scnprintf(buf + ret, PAGE_SIZE - ret,
2149-
" %s \"%s\" \"%s\"\n",
2152+
" %s \"%s\" \"%s\" \"%s\"\n",
21502153
(rdir == SND_SOC_DAPM_DIR_IN) ? "in" : "out",
21512154
p->name ? p->name : "static",
2152-
p->node[rdir]->name);
2155+
p->node[rdir]->name, c_name);
21532156
}
21542157
}
21552158

0 commit comments

Comments
 (0)