lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240416-vizdapm-ng-v1-1-5d33c0b57bc5@bootlin.com>
Date: Tue, 16 Apr 2024 08:00:24 +0200
From: Luca Ceresoli <luca.ceresoli@...tlin.com>
To: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, 
 Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Cc: Thomas Petazzoni <thomas.petazzoni@...tlin.com>, 
 Alexandre Belloni <alexandre.belloni@...tlin.com>, 
 Dimitris Papastamos <dp@...nsource.wolfsonmicro.com>, 
 Jarkko Nikula <jarkko.nikula@...ux.intel.com>, 
 Mihai Serban <mihai.serban@...il.com>, linux-sound@...r.kernel.org, 
 linux-kernel@...r.kernel.org, Luca Ceresoli <luca.ceresoli@...tlin.com>
Subject: [PATCH 1/3] 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@...tlin.com>
---
 sound/soc/soc-dapm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index ad8ba8fbbaee..eb9535764693 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2104,6 +2104,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
 	int in, out;
 	ssize_t ret;
 	struct snd_soc_dapm_path *p = NULL;
+	const char *c_name;
 
 	buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
 	if (!buf)
@@ -2145,11 +2146,13 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
 			if (!p->connect)
 				continue;
 
+			c_name = p->node[rdir]->dapm->component ?
+				p->node[rdir]->dapm->component->name : NULL;
 			ret += scnprintf(buf + ret, PAGE_SIZE - ret,
-					" %s  \"%s\" \"%s\"\n",
+					" %s  \"%s\" \"%s\" \"%s\"\n",
 					(rdir == SND_SOC_DAPM_DIR_IN) ? "in" : "out",
 					p->name ? p->name : "static",
-					p->node[rdir]->name);
+					p->node[rdir]->name, c_name);
 		}
 	}
 

-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ