Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp3104494rdb; Fri, 22 Sep 2023 19:57:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxBIXtCQzSj87a53uGb1Lkt0f8z0kiVw2NTc2rGGtOoVIND+eyHSUzRiVYQgIAVVYPDSHX X-Received: by 2002:a05:6871:58f:b0:1cc:e169:96bf with SMTP id u15-20020a056871058f00b001cce16996bfmr1312862oan.39.1695437877735; Fri, 22 Sep 2023 19:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695437877; cv=none; d=google.com; s=arc-20160816; b=kQi+8FlUJ/XSj1c/Z8Bj9XCbfje/XJmJrfVDlzTj/W1PxmAuEAiCvh4YDcyYjHWa6L EpYyW41suZT7ZB74L1TQfmg7Eal6fxFDb5n5vEI6s/P0x5ejNxSB+54KksbluQAnFWnM 8DjNlbavlighuh+R94UK827OjKxhJGACrv4l5WYSsllH6OyCbjhCNCAiRgGGO7ov3/le BEC3mFA9/GcdWymMPaMvSxSQWZumFR5ramMS2bpqqo7hySPrjp8QNkobdiMtar1Jm3wH fmd8sNaR5Fdbo04f2iyfAFN/0Nl3lbriBzEQKy66TwklvCQYTHT4UqeKmkJ80CtxMY57 o/+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JXbCn/mxw/O38mq7z9Y2CPBqurZYPBI6LOlqJG8vaps=; fh=Ky6S44nI8jD4numKUFwWnlRmYUOvKwYhSTHBHg5/CFE=; b=xEhziIxXe61LwUfBsoOZDdia3jfFVR0goAYwRB81IzRGrYJ+shmDDyQ4u58IOh2zGt fHS1dX61L/GV2MQoyGdqRSh6nceij+I6NqEruZyZ1S9Qcy8u5R5yr1ToBhtJsdIsVvCs DKhNTtSffJ3TXCb47wwfUA3LSgQvoxHJmNRqgDSSl2TDUgxiqN9xO+N233TV6Ppy+oyV SbGZGn4qG6GHxkdTWvjQuq3cFUOwTxmYHmyCN3Rszs2Z7jHRbrV5iBEabb6Y5ic6Dfpt q/dO3rjAeVeuOxdFxv5thfvgyHQkWmiWFaLVIuQN7OE7GaptNtkLSPfRTz9Bbv99tJAJ UdFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Xq+7sEqK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id d19-20020a637353000000b00578e98dec9csi4859791pgn.715.2023.09.22.19.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 19:57:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Xq+7sEqK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D0C4A83352A6; Thu, 21 Sep 2023 14:32:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232796AbjIUVcN (ORCPT + 99 others); Thu, 21 Sep 2023 17:32:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232590AbjIUVb5 (ORCPT ); Thu, 21 Sep 2023 17:31:57 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 415DBAFC1E; Thu, 21 Sep 2023 14:08:06 -0700 (PDT) Received: from notapiano.myfiosgateway.com (unknown [IPv6:2600:4041:5b1a:cd00:524d:e95d:1a9c:492a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id E071366072A2; Thu, 21 Sep 2023 22:08:03 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1695330485; bh=4WzhXX1uaBfz0iPkLduXsSe9s+j07QrDW6eVjUz4YQc=; h=From:To:Cc:Subject:Date:From; b=Xq+7sEqKMT1vt4K2chwQVwiFPZh87u8UZcHR85YtRTxEST+m/bOEzap9pEDI/jlvN Bc2E4iawedB1CvcQfsWQ+SdjoYUMhCQ6w5uIybBe4T4KSyGY2ZH3qEyepqXCq8TylO REOdNMAuaQ95GP79HV1mStHUe0Zb1hued3xRm6AhJgpipF59NKVzsvi9fe2x3b4p0Y dWp3gWQsUx+IbolK/IvPrioWEF97/lKb6ENurhUFp9thNde9DqTs/n15P4CGbvoyO5 w/glxgy8t7xhjp2/QuKtQ1ZHA2VftQ23iKelU92xiazICGo+rMJeA9B2Wq76p6J1Am p6bhSKYwpqY8g== From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= To: Takashi Iwai Cc: kernel@collabora.com, =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= , AngeloGioacchino Del Regno , Jaroslav Kysela , Mark Brown , Matthias Brugger , Shuah Khan , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [RFC PATCH] kselftest/alsa: Add configuration for mt8192-asurada-spherion Date: Thu, 21 Sep 2023 17:07:42 -0400 Message-ID: <20230921210800.230330-1-nfraprado@collabora.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 21 Sep 2023 14:32:38 -0700 (PDT) Add a configuration file for the mt8192-asurada-spherion platform to validate that the card and PCMs used for speaker, headphone and microphones (internal and headset) are correctly exposed to userspace. Signed-off-by: NĂ­colas F. R. A. Prado --- Sending this patch as RFC because I'd like to ask a question. What would be the most suitable entry to identify the card in a future-proof way? I have used the card ID here, but given that it is generated at runtime with the purpose of being unique among the cards present on the system (and I couldn't find any documentation that states it is stable), I'm not sure it is supposed to be relied on. The card ID is derived from the driver name or card longname, which are themselves stable given userspace (alsa-ucm-conf) relies on them, but those aren't exposed through sysfs so I can't check for them here. Another option would be to look for the card number 0. But in the (very unlikely) case that another soundcard would be connected to the platform and detected first during boot, it wouldn't work. Yet another option would be to look at the device's uevent file for the compatible as defined in the Devicetree, ie path "device/uevent" regex "OF_COMPATIBLE_.*=mediatek,mt8192_mt6359_rt1015p_rt5682" Though it is possible (in rare circumstances) for the compatible in the Devicetree to need to be updated to enable a driver behavior that isn't backward compatible. I realize most of these issues are very rare and probably won't ever occur, but it seems worthwhile to use the most future-proof mechanism available to identify the card to avoid unnecessary maintenance, even more so considering the example would be followed by future configurations. Thanks, NĂ­colas .../alsa/conf.d/mt8192-asurada-spherion.conf | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tools/testing/selftests/alsa/conf.d/mt8192-asurada-spherion.conf diff --git a/tools/testing/selftests/alsa/conf.d/mt8192-asurada-spherion.conf b/tools/testing/selftests/alsa/conf.d/mt8192-asurada-spherion.conf new file mode 100644 index 000000000000..6a7e15dc17da --- /dev/null +++ b/tools/testing/selftests/alsa/conf.d/mt8192-asurada-spherion.conf @@ -0,0 +1,32 @@ +sysfs [ + { + path "firmware/devicetree/base/compatible" + regex "google,spherion" + } +] + +card.mt8192 { + sysfs [ + { + path "id" + regex "mt8192mt6359rt1" + } + ] + + pcm.0.0 { + PLAYBACK { + } + } + pcm.3.0 { + PLAYBACK { + } + } + pcm.10.0 { + CAPTURE { + } + } + pcm.11.0 { + CAPTURE { + } + } +} -- 2.42.0