Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1864791lqp; Mon, 15 Apr 2024 23:02:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUAqP9zepo70J19+pTLeHn3ZrtczIZQr3XCAruzeeHJlRKziHJMaYJnsc0XqoBECXEM/jf/vjMxGGQDsPfOHzR4yic/TlIq4TAl/B/QGg== X-Google-Smtp-Source: AGHT+IGqX8PMhHWZsoKwpwX7cBLzDfFpm4a3BCANs5DTtO8p1rMU9GsWpliyOKbkBjTYM53mB06p X-Received: by 2002:a05:6e02:1c21:b0:36a:1ccb:13f4 with SMTP id m1-20020a056e021c2100b0036a1ccb13f4mr14038881ilh.14.1713247338889; Mon, 15 Apr 2024 23:02:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713247338; cv=pass; d=google.com; s=arc-20160816; b=H/knxvYKHl6qh0POc0uUY1iODMKLTy+xLwkNiiSb2f2s9RgJ1HYhdyRetb9wxr5X68 UuMILoGCtsZz/6ytmKp2dAeyRHkjkJt4H293F9woERZQHXTej9XWTnHI0GG2vWUj87UL vf2dq2T8rzbaJ/uFr9gaXzzNUnV1sQSlrw/3obRiCQle5W/kYX7x2uUiY8k9raN0GgrH kEzmyAwkfaSw/Hq/ymBTfLRtj8YYtkRUp2ZM7xw70c+ZD8Zn+0wNUCHt2Ft5Rh0tJEYb HstfykL3Tg3T6Nx1wTqNKT3OUgkb5YM0J1fMJiMfyuDRcNcNhveFXTW7rmgyLw6cLkLv XQpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=BJAAy6gitbplC0qdLnXXswBXeCRCS+Gizpnl0ra0dak=; fh=8lvKNvBwLuakcou98Sx9JIQRgr6wmg68ZqR+i3ktn20=; b=WfvyLa2pcXINVKSmhbz7ZtlcCY6r8kapavC8xLniYOU2MYLkfPSDFntMNRiaXiQ/Xy R2iYMMAKsYyCl2qmApOps80zI7Dh8E0OcaKgrOUwhRvs2VvSMM8pAE3sW0MbPSggj0yT rqn5yjq7vyOWi/LPJV2+PL2k8IZlkgYl9gYB6R15/hTqyvjsuJSOb6lunew+NqdkWgkH /LXnf0ZXz3Rf+b7LOoFy/H0hK74/Y5zxFI1gQThHzgvtiNfBzTO4nKYoB/P8oXTxHXWf l+5tJiRKbbPhX5zYovJaReNOC9TO2stTq++VP/klSQ5n6Qav0B1NG/cd7fghhITPeq4f be+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GffCMELH; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-146309-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146309-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y17-20020a631811000000b005d6d6f8cbddsi9196731pgl.360.2024.04.15.23.02.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 23:02:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-146309-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=GffCMELH; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-146309-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-146309-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C6B1AB21810 for ; Tue, 16 Apr 2024 06:00:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF0733D541; Tue, 16 Apr 2024 06:00:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="GffCMELH" Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D2B2B3C060; Tue, 16 Apr 2024 06:00:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247243; cv=none; b=YN4gz6hZUiPvzv4XVLsdLXK5ydJia7WFcGJxae69hSldBe+UlIqcecadeUTjWeqQAvTrkP5twtl4cmy1bNfVCDhFzgvEazTINQjzApNI9YnJxTaBDfgKn6SSUq3RHCbREm7/s6CB3Aj/A7P3ys/0J4Dd1B4fdKqXjsPBRKj6HRM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713247243; c=relaxed/simple; bh=dnnyobTp96GQ9f5n4jroE/22LBVDoDuolCWtYfUKiso=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rItxppJTercawzaBb+Q8qOVpckUmYZLkiUeGZpGOF6UqqAGqscQacjmVzaycwEP+L7uIsb9g0YdZfWEC2FuRnsofcdwHRle0m360zeaSQnCoYdW2mFFKkZCs8yv+4JvKQOnEEmQ40Gvyyrhq//+7PG4TbsU6YKRGU+3Bv7oNgHg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=GffCMELH; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id D18F01C0007; Tue, 16 Apr 2024 06:00:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713247237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BJAAy6gitbplC0qdLnXXswBXeCRCS+Gizpnl0ra0dak=; b=GffCMELH9tcTR+yCegtdUSm0ODT9bFOOPlRH2RK1tGH7qGi63K4hHanvOOMtCVcwFErvdh F7IhHKLkQMMVR12ngKIiud0b9th9+uCefzmEr1bIVTVNwcIAlQxPfCpdmGXBVwvyFp0QwF GNo68pwH8hnQIEnNRL8ZQRwqjKlH4ONSH1OymzHowX6ld4B3zB9dFBtm1NW9kVRXAJgCep Ud/dYhhILQ2+9jd/68bJiGfeGEP0+30yJdxhuiciWCVCQr/dXHgzgt48uMP3I3eY+1HQUy u7k6bOWMZtlYGJXtWts1SxxzgA6Sql+Im/h+0KBvovZ0lpdAmlD6wHnLYn6sQA== From: Luca Ceresoli Date: Tue, 16 Apr 2024 08:00:24 +0200 Subject: [PATCH 1/3] ASoC: dapm: debugfs: add component to route lines Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240416-vizdapm-ng-v1-1-5d33c0b57bc5@bootlin.com> References: <20240416-vizdapm-ng-v1-0-5d33c0b57bc5@bootlin.com> In-Reply-To: <20240416-vizdapm-ng-v1-0-5d33c0b57bc5@bootlin.com> To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: Thomas Petazzoni , Alexandre Belloni , Dimitris Papastamos , Jarkko Nikula , Mihai Serban , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Ceresoli X-Mailer: b4 0.13.0 X-GND-Sasl: luca.ceresoli@bootlin.com 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 --- 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