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 7C6CECD1292 for ; Mon, 8 Apr 2024 18:29:56 +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=kxZefmIxUlRj5vOKmNfPGqJvzK4e+6KTCE0y4pP17xo=; b=dk/HumfnO/ZrG4 2dOfkIO33pRgLm2iU9a585Qsi3gsVUPlOOv9KTPhbmf7bY1GEYJPujRaiy5gFEjXUQAFy7VQOBOSd bS4r1yk18S3JJs+p9PGeAjFdluuVhvb/Rj/wGC4pulI79eSJeC8oDR8Ie6tHqoiglobTMdfO+/gAq tZqSeNEL0ISvycPJ08BqUJrXRUiEP1PD2BEDqPhyPkNg3byEIx3eIxoj4I7mWntTsBycuXBkhDHxb eVmsnaITlbDAGxzOQVWr9DGJEmObZYpNy72mewmjdcfToV6AIt0iylLb0U90eITHSzzjRT+/UQ8sx yGb0K9s9Y1GDRj21bBUA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rttkZ-0000000GUf7-2uNY; Mon, 08 Apr 2024 18:29:47 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rttkW-0000000GUeE-2JiM for linux-arm-kernel@lists.infradead.org; Mon, 08 Apr 2024 18:29:46 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4165805e158so12305345e9.1 for ; Mon, 08 Apr 2024 11:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1712600982; x=1713205782; 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=3y8+lTNdEv9p3qVZZSAL5TYeLEpaLOV40uPPZs1+/rA=; b=Jo6vRBacqMQjBR0hX7ITzHOHemv17sKLEZ66o0dqq3Px9eCITbbSVP5i7egkbC+OXk oCQ3xbfg+Ij/stMN/YhJlYFnPOH2Fx7tIVdAGDMV267LEyimKxYpydNQ4wFwUFBp2xbv UEfwKcCAIR1VPRrI9XM7LLGpcEqatF498CKE2YQH5sXV5ysaSida4a7Z4HwuHOVIKDlT +90Ca0BTyWn3wAJb+D/OXOOfKrGOmF4vw3CM5xX7FpEBmXlKgLt8QlnnNI7dOffgVpmc Kzmm4vWkQU63TxaN5z9n6ilrSxn8dG93Yb2ju5706jVZA9VMkgM13qDymEwuYKJv7SbW doSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712600982; x=1713205782; 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=3y8+lTNdEv9p3qVZZSAL5TYeLEpaLOV40uPPZs1+/rA=; b=blohw8Pf/76FK4guK5n3CCd5urY96kZlQTe0aXNxpqxOzrZpxE5XCt9Nl4j4jewHqv 49I9mkLW4VJORMBHTtlViLYC2qqNLKt0bP96gYH5kw5JMYPp0lHD6QYig27FeAfhqJq9 l764SJrpV59x5BuvVv2Yvshfqr7S426lVrrcdFTqVPz+ik7WviUnA27pEs6TqnGIxpP+ +kH4Ksjmw0FcSqdvIgDXYIxQ4Wt7X/4UWqxymlfzY0ZQKJ8rR0AlFpnS4DQaSsVNklPL eLBvd0WRVb48HxCJ6mDqt067eIpv7n/q5blt2OSyV80Q5oT3P8XJzwmLgRtuNeidp8cU phLw== X-Forwarded-Encrypted: i=1; AJvYcCWl4O7cRS5UAV9F0gMRbn4Nvzm0vZPhGG6W76iapvGh52Vno6xLRPlSvDOhSWFxo3yTVjAtKjK++2zF6EFo3mazzhbpogYw6QTKaiPKy5f8ud1hdSU= X-Gm-Message-State: AOJu0YyFLhPCi4WfrU9EdTU9c3XPepNVwQbnxbJpn3Ue8oBNjmyD7VHm UirAUXMmGEZkK22EODEKnB0XhktHlLw7d6ZC7lt33Ei3Iufb9ffqFDWceHh77ig= X-Google-Smtp-Source: AGHT+IFh8WHFAL+5KwNrKiDCA+QmN0hRuRdo0rWFUNNknNOcm/Yw6c64MqzQj6hHHotqbMcZSl4VIw== X-Received: by 2002:a05:600c:4683:b0:415:8651:9b8e with SMTP id p3-20020a05600c468300b0041586519b8emr8571532wmo.39.1712600981964; Mon, 08 Apr 2024 11:29:41 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:90bc:1f0d:aae2:3c66]) by smtp.gmail.com with ESMTPSA id bg8-20020a05600c3c8800b00414807ef8dfsm14255016wmb.5.2024.04.08.11.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 11:29:41 -0700 (PDT) References: <20240408164947.30717-1-ddrokosov@salutedevices.com> <20240408164947.30717-3-ddrokosov@salutedevices.com> User-agent: mu4e 1.10.8; emacs 29.2 From: Jerome Brunet To: Dmitry Rokosov Cc: neil.armstrong@linaro.org, lgirdwood@gmail.com, jbrunet@baylibre.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:15:54 +0200 In-reply-to: <20240408164947.30717-3-ddrokosov@salutedevices.com> Message-ID: <1j1q7fpv1n.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_112944_735430_22896387 X-CRM114-Status: GOOD ( 22.91 ) 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 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. > > 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