From patchwork Fri Jun 23 21:04:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 112293 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6040606vqr; Fri, 23 Jun 2023 14:07:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hSXudm6MCTVnu5JO5AIaxUrgupYkZGRkDiY0brcZC1qU8z3lRFVqdMEOacPjXHHUXnKTO X-Received: by 2002:a05:6359:5a3:b0:132:d912:6c99 with SMTP id ee35-20020a05635905a300b00132d9126c99mr4416057rwb.9.1687554422449; Fri, 23 Jun 2023 14:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687554422; cv=none; d=google.com; s=arc-20160816; b=Ita+vJzEXJNHohnwsBjpK056PplZE7LUuVbpiveoEVI5X5kYSeK+LFUVNFLQRKDAE1 Nh13UfPF6VaUBvQDtvk9b79QRSnB1/x0i/+v2JXHxYO+8Jh2ytFoz69rL65RfpyhB4IY fkpAl/whNM2HvHakOh7Z5SBMUlv4WQUfvrcWHCZ38UG6EWNV797TjVUOdm0OEtlOFTlV bxrmpyrO9AzT5lbDcW9ORiMWU39Ro9cZKPVZWQQ1Hk0jLQq5jr5L2El7eV0Mvn4vyjx7 v+9LhKHq5CQtQEVG67qy9+sYD+yxDMtbh/BWnolr2fvZFDVDupn+k5TzxA6ExTObMZni wfRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=4suvYzezz47qEeZLQtpKyXWZjRynjsxyMM7bBm++ZoI=; fh=14DUqB3nhuAgdrEwC9mc56CxHY9NW+Sr5APmdmILKSU=; b=07cKMRR5r16pVNnnBfMYONrJphhab+j8uPv6XpqyhWUybdXgrFmJCIcK2AI+9qgd2f pPUwg0HqVXDXYpoh/Jg0QkaSW7eIaQI0RrsRghtWUz4jSIdFZ42FSE29FdXdAnbuKcOR Xc5ntvAAMe4ecHEsO78Yaj4cMxyyITUwlhV1iBA29rcq301qiBOu1bKR7+XhTS6xJDxS 9e2OnDpJ/L4foYoXaUpOnJfMxfO0URO1t4iimYRROX4V4KmXI303niNQ65ZD/Fr9TxPE 7m2WaI7zTu1t6000CxZ/zq44zoxs9GebfjLeHSmFmiZYpacVtsnkWj6k7wXT/6F6ekfa HExA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VlCJlzWi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g30-20020a63201e000000b0052c419dc8d1si225569pgg.274.2023.06.23.14.06.49; Fri, 23 Jun 2023 14:07:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VlCJlzWi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231855AbjFWVEy (ORCPT + 99 others); Fri, 23 Jun 2023 17:04:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjFWVEw (ORCPT ); Fri, 23 Jun 2023 17:04:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD3FC2114 for ; Fri, 23 Jun 2023 14:04:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 686C161B5A for ; Fri, 23 Jun 2023 21:04:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 198ABC433C8; Fri, 23 Jun 2023 21:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687554289; bh=7hI9rVh1AROgGPI9A/ZuJDlHTrmVy3Qkk2LrdeMj2Kk=; h=From:Date:Subject:To:Cc:From; b=VlCJlzWiJhxlsIWBv4CSmwjV0upRi6bO6AsGQu1Ee+4kXm7LGHaaAD/uJGeLtSZjr q9M9qjSpKlw+cYOXxUlhV+qwBt/zshTr73l3O7zRynpFoEINfId2hV8uMFHvPHbLib DzuSLSfdOILXsnOUOu9tedmGJSejKmy+n+Rp7mTr9lV2MEaw1A7cZHj/xhZoqiwm/R C581VpO+YtYn/NaaZl9NUR4dltaNMZxP6giVB+/VUmXO8vTKa72OUDIBOWQ36A7bWN JPqa2n7fMeveCGq4CNTld6Lk+vgpKvSa66ztmQ26zFHZ5TbfUqwTMnQ8/x19I0yKUr 66I4HFPC6tFHg== From: Mark Brown Date: Fri, 23 Jun 2023 22:04:39 +0100 Subject: [PATCH] ASoC: core: Always store of_node when getting DAI link component MIME-Version: 1.0 Message-Id: <20230623-asoc-fix-meson-probe-v1-1-82b2c2ec5ca4@kernel.org> X-B4-Tracking: v=1; b=H4sIAOYIlmQC/x3NwQqDMBCE4VeRPXeLSazQvkrpIRvHmkMT2YVSE N+90ePP8DEbGTTD6NFtpPhmy7W0cJeO0hLLG5yn1uR7H/rRB45WE8/5xx9YLbxqFfB9QJqcCwI RalSigUVjScuBTzNeb8e0Kpo+H5+vff8DeQlCsoEAAAA= To: Liam Girdwood , Mark Brown , Kuninori Morimoto Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.13-dev-c6835 X-Developer-Signature: v=1; a=openpgp-sha256; l=2220; i=broonie@kernel.org; h=from:subject:message-id; bh=7hI9rVh1AROgGPI9A/ZuJDlHTrmVy3Qkk2LrdeMj2Kk=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBklgju/hRIWDmE+d0m//kTBjqBjvxFk+xPU8keL uIdzkUSermJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZJYI7gAKCRAk1otyXVSH 0KeCB/47Tcfz9mxx4ktjj+ob071MA3r7VDmxA4L4Y8SZmFa15oo3ev5L1UnwYw02OZciRhTspyB DdRPC3Ws7UxmCX/cvSlAdcq9ZV6OcCzmhkTRlMC7coRblp5PuopGC40rNDXfI9pPri08Z6wGaHX wk3TBK6iL1Rb7u1e/QL8Z+S6SUt1OVv4L1wWytnqb34u+zx4Aa1wPF+VJb7cOtU3b2ch9urcBCw HzGE3jaKBWaWyhAG6irJ8zJcq2AbYXAIv99WxMahylDkz3UvAlU+cd4I2wQES+xtC7KFmxf803u l/CQOrhnlNf/Qe6oIyUA/KQ6qIwxnRXMLx6sRq/kfH8VvHSE X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769529066352715660?= X-GMAIL-MSGID: =?utf-8?q?1769529066352715660?= The generic snd_soc_dai_get_dlc() contains a default translation function for DAI names which has factored out common code in a number of card drivers, resolving the dai_name and of_node either using a driver provided translation function or with a generic implementation. Unfortunately the of_node can't be set by the translation function since it currently doesn't have an interface to do that but snd_soc_dai_get_dlc() only initialises the of_node in the case where there is no translation function. This breaks the Meson support after conversion to use the generic helpers since the DPCM cards for it check which component of the SoC is connected to each link by checking the compatible for the component and the Meson components provide a custom operation so don't use the generic code. Fix this and potentially other cards by unconditionally storing the node in the dai_link_component, there shouldn't be a binding specific of_node selected since that's how we determine the translation function. Fixes: 2e1dbea1f8a3 ("ASoC: meson: use snd_soc_{of_}get_dlc()") Fixes: 3c8b5861850c ("ASoC: soc-core.c: add index on snd_soc_of_get_dai_name()") Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- base-commit: 154756319cc6f8b8b86241da02da6a8fcc6abd1f change-id: 20230623-asoc-fix-meson-probe-94ecd113bebb Best regards, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index f06a20773a34..11bc5250ffd0 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3262,6 +3262,8 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_ struct snd_soc_component *pos; int ret = -EPROBE_DEFER; + dlc->of_node = args->np; + mutex_lock(&client_mutex); for_each_component(pos) { struct device_node *component_of_node = soc_component_to_node(pos); @@ -3300,7 +3302,6 @@ int snd_soc_get_dlc(const struct of_phandle_args *args, struct snd_soc_dai_link_ id--; } - dlc->of_node = args->np; dlc->dai_name = dai->driver->name; if (!dlc->dai_name) dlc->dai_name = pos->name;