From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B281C67861 for ; Mon, 8 Apr 2024 18:44:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-reply-to: Date:Subject:Cc:To:From:References:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yUfcW/gd4oa8Nn/XWZ19g2epGYsinIdvKTA6Pklc2Sg=; b=mnyJwGiruo1rQZ VDEoBFdW5TUY0+OywbVkXvm3gA8EBwsce37dAEzy6AZaqyQpRSbHWMsMdymug7Zo73SK097pF+nFK rDgJNvBK17LEVqDmPaYnI+z9LioVUGn5UbfW/mozTuymXrqm7+yAQebpbPEtqMwgRnU+CXFfl7W8w QIORpNVMrZ4Jl5PGs8uxmPPIOL8DBT48uLxHzTJYt7MFaitcaHAVO62SxU97/C+ThnTalWvqSSAp6 ftFF7U03jcpetRRfqL4Wak7WWf/LcQz02Unpxc0vRvVwnNd5YGsl8YVIjvy2lGFNVFNPbaDksMIaO jyG+yqnBE6WmWrvSEpFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rttyv-0000000GX6P-2tpo; Mon, 08 Apr 2024 18:44:37 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rttys-0000000GX5U-0PUX for linux-arm-kernel@lists.infradead.org; Mon, 08 Apr 2024 18:44:35 +0000 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-343f62d8124so2296409f8f.2 for ; Mon, 08 Apr 2024 11:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1712601871; x=1713206671; darn=lists.infradead.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=PhxFWGtJcYu82R8UeAJlsE6XDeHCwucqCh4MxZcEi6Y=; b=gY0CbEtVl+hGxaspIgWwfbjGEcG5tuEuUCrPUVwjw3ub+xWtKQIXpsxl16lkVbnDqr 2eUxu1xvUjEvs1chiNEPSc4WvnxH79IlW2y3haG2juh+p05o2Wy7HPN/mxwlgJ+1gwti ueLMCzh7V2/NbdCRrc8/CHlYOhjlsffaQ8dIQvyEDCfVDSxGivg2hZYpi0178OdKcAyb FOEx6BdXBBiH14j0sQ156Zsbg7n45SOkbFl5fEPKRXp+8gyUuIf2xfTNO0nqHm3sA7Nd /splc9Pr11st3tOfFapZX1qfO2IdRkI71dDssB49o3A5HXc/2Ny5PtKoquJA1els10P6 upzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712601871; x=1713206671; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PhxFWGtJcYu82R8UeAJlsE6XDeHCwucqCh4MxZcEi6Y=; b=hR4JkCx6NbAxty2IqHjVvFA9cf3fwi2FxJl2E3rpu9qYBpLaop/aIKaE+wukrjvHOH UbbQGLeqywcdY3y34s2Shd2IAbY5N9eZ6L/wSNoCVB8+jNNwVk40ttKwxl4obGFwzAip mHH4fEte6Z/SjxbjZUcg+A4S6oRluu7T+dwasVZB6dvi9J3g21fEQ6Q5dDAKF3MmpipN vxhiTuEJohGSrmDUPTeVLHJxH795pePlCTGexGz4OKU3ppR6hkPK/JZd9+leK8xzH0aq 1JndgbdRov+ogebfQQFAWiT/II21efxGjSzhUpwa7hsOEp5PwgAEhLvvqcF2TZqmJLVl BV7w== X-Forwarded-Encrypted: i=1; AJvYcCX2L7CkZtW6ny5FZB+5wpldXsAC5n9oAS3ZL5UTzCZ8w+22uIOq7GC0mwxYAOa+a8w5LhDBadWtUr90uumCoBex5XSLMZd262uhwydCHp83GF2Bqjo= X-Gm-Message-State: AOJu0YynKxlrf9c3B+6H922VHSp/kXKRxKWLSkTaz727xp1kpgYeDzPv IdkqHyNUOJD4gK6ByhuZVe3FD39gP/0wuHiI/k3dI9ukkDjqfbnrotepXV7VKeI= X-Google-Smtp-Source: AGHT+IFs9R4mz6UqK5BlaXGtELLYaVlJZoW6nTa0CMEXjr6omfui96tuEN/xbadb9qr3EQuod/33ww== X-Received: by 2002:a5d:6e56:0:b0:343:4727:d11e with SMTP id j22-20020a5d6e56000000b003434727d11emr6395149wrz.47.1712601871525; Mon, 08 Apr 2024 11:44:31 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:90bc:1f0d:aae2:3c66]) by smtp.gmail.com with ESMTPSA id c9-20020adffb09000000b00345c2f84d5asm2736320wrr.10.2024.04.08.11.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 11:44:31 -0700 (PDT) References: <20240408164947.30717-1-ddrokosov@salutedevices.com> <20240408164947.30717-3-ddrokosov@salutedevices.com> <1j1q7fpv1n.fsf@starbuckisacylon.baylibre.com> User-agent: mu4e 1.10.8; emacs 29.2 From: Jerome Brunet To: Jerome Brunet Cc: Dmitry Rokosov , neil.armstrong@linaro.org, lgirdwood@gmail.com, broonie@kernel.org, conor+dt@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, perex@perex.cz, tiwai@suse.com, khilman@baylibre.com, martin.blumenstingl@googlemail.com, kernel@salutedevices.com, rockosov@gmail.com, linux-amlogic@lists.infradead.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 2/2] ASoC: meson: implement link-name optional property in meson card utils Date: Mon, 08 Apr 2024 20:42:22 +0200 In-reply-to: <1j1q7fpv1n.fsf@starbuckisacylon.baylibre.com> Message-ID: <1jwmp7ofsh.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240408_114434_167604_7FF0383E X-CRM114-Status: GOOD ( 25.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon 08 Apr 2024 at 20:15, Jerome Brunet wrote: > On Mon 08 Apr 2024 at 19:49, Dmitry Rokosov wrote: > >> The 'link-name' property presents an optional DT feature that empowers >> users to customize the name associated with the DAI link and PCM stream. >> This functionality reflects the approach often employed in Qualcomm >> audio cards, providing enhanced flexibility in DAI naming conventions >> for improved system integration and userspace experience. >> >> It allows userspace program to easy determine PCM stream purpose, e.g.: >> ~ # cat /proc/asound/pcm >> 00-00: speaker (*) : : playback 1 >> 00-01: mics (*) : : capture 1 >> 00-02: loopback (*) : : capture 1 > > The example above is exactly what you should not do with link names, at > least with the amlogic audio system. > > Userspace pcm, otherwise known as DPCM frontend, are merely that: > frontends. What they do is entirely defined by the routing defined by > the userspace (amixer and friends) > > So naming the interface in DT (the FW describing the HW) after what the > the userspace SW could possibly set later on is wrong. > > Bottom line: I have mixed feeling about this change. It could allow all > sort of bad names to be set. > > The only way it could make sense HW wise is if the only allowed names > where (fr|to)ddr_[abcd], which could help maps the interface and the > kcontrol. > > Such restriction should be documented in the binding doc. > Thinking about it further, even this does not make a lot of sense. The information is already available from dai_name, prefixes and all. Please use that instead if you must rename the userspace pcm, not DT. >> >> The previous naming approach using auto-generated fe or be strings >> continues to be utilized as a fallback. >> >> Signed-off-by: Dmitry Rokosov >> --- >> sound/soc/meson/meson-card-utils.c | 12 ++++++++---- >> 1 file changed, 8 insertions(+), 4 deletions(-) >> >> diff --git a/sound/soc/meson/meson-card-utils.c b/sound/soc/meson/meson-card-utils.c >> index ed6c7e2f609c..7bae72905a9b 100644 >> --- a/sound/soc/meson/meson-card-utils.c >> +++ b/sound/soc/meson/meson-card-utils.c >> @@ -94,10 +94,14 @@ static int meson_card_set_link_name(struct snd_soc_card *card, >> struct device_node *node, >> const char *prefix) >> { >> - char *name = devm_kasprintf(card->dev, GFP_KERNEL, "%s.%s", >> - prefix, node->full_name); >> - if (!name) >> - return -ENOMEM; >> + const char *name; >> + >> + if (of_property_read_string(node, "link-name", &name)) { >> + name = devm_kasprintf(card->dev, GFP_KERNEL, "%s.%s", >> + prefix, node->full_name); >> + if (!name) >> + return -ENOMEM; >> + } >> >> link->name = name; >> link->stream_name = name; -- Jerome _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel