Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp444377lqb; Thu, 14 Mar 2024 16:31:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW7x4p4xLZUfM/9dfapNY1UdWzikk6ZTOSyR/aKranF/CmYzBxh2L4mK6aYYogu3igUxeFzdTdocsIo5FpD4wBg9E0ey7RdYnRTIiStPg== X-Google-Smtp-Source: AGHT+IFbWZbMsMOmhxyut3oSO9nfohYxMtWEfjYWWkKxjY742My31saLR44GTZZaBq17dBnW8YuK X-Received: by 2002:a05:6a20:650f:b0:1a0:e89c:38e4 with SMTP id n15-20020a056a20650f00b001a0e89c38e4mr1266241pzg.48.1710459066790; Thu, 14 Mar 2024 16:31:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710459066; cv=pass; d=google.com; s=arc-20160816; b=hvlPi/yyo/SLR2+SexRKN8yO3y7mniCChzJHxS/QFWUQkSxOyswzlxFipCHKW7H/Zy r/TsI3+RILTbHbBEVhkYhysVbh3eTTfO5mINn1DjJW6UfXSa1ujzbtA6gHL76EDuUkHB LAUkCq9rdppc6cVIYofd1LaNx7RxGOFxeh3V0xdTfjwWsEV07OWsFqBeIKGQ29UuvT7D qC+Pzlykkbd3GNKcJHUncrcXbzczcgTfoMyRVDG+jehZw9CdC7t8WaVKTyxV/RDg2YdQ 0AsI4Q5TQ5UCHw7Vg/IJGvhlh7fW35qLpdq5a4fRNKB1P/1llnfnUhW6bRoVqpWrPrIS PHeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=oHTYiFMvsDA2ptkBIAd/4iyJxp1yij69f1A6GAHpv/Y=; fh=FbY7KoKtMFJBoj5Z8JHYd/M6uSWbgKpf1nv+heeKdC4=; b=ygH3AFblvVuhWU3X6AayMdtT9tartrpj9AIiDACMHds+kmhQZTJaoNRQlrnMeE/JQM 3EZjNOG9dBVsQk+pJxaAXpdGtSy/4oeWj2sSXly6G3J7C8vrOZtASZJK/nEJx14r9CdU Rr1ep6pNi0ZfpEFWr454b1v3DXtQCsdKf5IXtOza8YYbNCNVhCpmUjZYWYZvm7VFUY0t 0oUifsrG9SFYzGoHuSqVt1qPzSYFixs9TBOgoMz/iw69xht8cqRldVMz3kPzfEKtxitI xihuvoMr74aLB47sl5xV9UCR/7ZDyUjic6e/Sq9P8T6EAHEaYs2RBjUdDraMntPk04uw h55Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=u+Oz0ttF; arc=pass (i=1 spf=pass spfdomain=sberdevices.ru dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-103886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103886-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n7-20020a632707000000b005dc80f256ccsi1418308pgn.849.2024.03.14.16.31.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 16:31:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103886-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=@salutedevices.com header.s=mail header.b=u+Oz0ttF; arc=pass (i=1 spf=pass spfdomain=sberdevices.ru dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-103886-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103886-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=salutedevices.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 97C4BB227BA for ; Thu, 14 Mar 2024 23:29:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60A9F45941; Thu, 14 Mar 2024 23:23:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b="u+Oz0ttF" Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) (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 98B3022630; Thu, 14 Mar 2024 23:23:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.89.224.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710458596; cv=none; b=lcRWYQ504Vy5E4XK02PAw/HIhI7QeOEYwIJw8XgpsV2SxEh4j58X1kvokkyrbKWR5/xE236S1LwrZv3+H8qyw+356QaExETeGl2GfcDUOPQfZk9aTP9vQyenRwxUgH12InDIk3h+n18fq0d4O1uHWy01mA5j09wGaMYwU0bmRH0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710458596; c=relaxed/simple; bh=PPaufu1U2yk2CH6X5UKjVc/X+cp8pDKq6JGff4Q4Ako=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pmZQXeK8+BUPGCjDQUw/zPUbNeKFGk02sRcf6U4CNuKIR8U2uXTk2T1Kdo9vJ8anchhxNrY1B/1R4+Ncm+DFhb7J0u8SOBrgOOTDooKlxNZxgk8mrwUZQIj47RD8ZXL7iyIP8hFkNNJGZ4GX/rzFa7BGOfUNrG9AMJLa5bmYlms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com; spf=pass smtp.mailfrom=sberdevices.ru; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b=u+Oz0ttF; arc=none smtp.client-ip=45.89.224.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=salutedevices.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sberdevices.ru Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 4C680120017; Fri, 15 Mar 2024 02:23:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 4C680120017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1710458589; bh=oHTYiFMvsDA2ptkBIAd/4iyJxp1yij69f1A6GAHpv/Y=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=u+Oz0ttF+z42jfxCb8bDWrwT8gKjMcS+SPtHlohHa5dn60NXyF1irW3it6wF6OGl4 i4Lp0AkUL/bTG2KtJUzaKkRzm+usunGeByzIycDnIB3gHjsclUTwfnriUShwE3Tqdd s4fpCnU88rJGOOmf8WkIv0vToE9okHv7OeXnjdmxpFCP/fXTE49PyuIDtFFp68vu6l vJ4NH5Yy81j+hSvdNX8V3QSFnl+ze2CNuB1YP4ux6mD2k1/B3EKbyP5POZKbQ2W9Rr WbM8sLazBDjDKPqYrnjlaCVcJxSRZ8+ou2TMxGi99HKcW8zU08YrjHnkApKzgqyR6V DCSFLLW73a/ew== Received: from smtp.sberdevices.ru (p-i-exch-sc-m02.sberdevices.ru [172.16.192.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Fri, 15 Mar 2024 02:23:09 +0300 (MSK) Received: from CAB-WSD-0003115.sberdevices.ru (100.64.160.123) by p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Fri, 15 Mar 2024 02:23:08 +0300 From: Jan Dakinevich To: Jan Dakinevich , Neil Armstrong , Jerome Brunet , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Kevin Hilman , Martin Blumenstingl , Liam Girdwood , Mark Brown , Linus Walleij , Jaroslav Kysela , Takashi Iwai , , , , , , , , CC: Dmitry Rokosov , Subject: [PATCH 23/25] ASoC: meson: implement link-name optional property in meson card utils Date: Fri, 15 Mar 2024 02:21:59 +0300 Message-ID: <20240314232201.2102178-24-jan.dakinevich@salutedevices.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240314232201.2102178-1-jan.dakinevich@salutedevices.com> References: <20240314232201.2102178-1-jan.dakinevich@salutedevices.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 183875 [Feb 29 2024] X-KSMG-AntiSpam-Version: 6.1.0.3 X-KSMG-AntiSpam-Envelope-From: YVDakinevich@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 7 0.3.7 6d6bf5bd8eea7373134f756a2fd73e9456bb7d1a, {Tracking_smtp_not_equal_from}, FromAlignment: n, {Tracking_smtp_domain_mismatch}, {Tracking_smtp_domain_2level_mismatch}, {Tracking_sender_alignment_int}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/02/29 19:21:00 #23899999 X-KSMG-AntiVirus-Status: Clean, skipped From: Dmitry Rokosov 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 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; -- 2.34.1