Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1363511pxf; Fri, 12 Mar 2021 07:57:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzeU3CS3kAwevl7rg8WcT/gnb9cK2mPdUIJbmgnVAXdlajrZH6jBSQUQURUK7PM5z1wH8u X-Received: by 2002:a50:ec81:: with SMTP id e1mr14812592edr.0.1615564644895; Fri, 12 Mar 2021 07:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615564644; cv=none; d=google.com; s=arc-20160816; b=JNTCzMtCnjcJQRuHaEDcqCCSi0icROh+Vvjb5kRs+5fgpdFlSC3KpEhbzlcwl48w5m RzmJPjWqUMazMVXkLFKiOm/uT5fm33MKBGbVSYdFw3dt4ACp7frFZOAZjUXBk6dANvy5 Vr3bNxXyOL1K20O3EpQWhMye7bsJyLYTLc2vjk/bhcmFiaPHhkykzpxtcNgwP36gAaqL t0mfORaWc1d16f8dhpi2oNHH1fMJ55b0XFHP1RGJJVQRYmoPi3+D0xAvrP4euWs3dAmn m8PIaGbn4JEtD/EGdSsU8wJ63ITGn3J/eQkk7wXojcaQ42w78sf1XNTIh4C2F9v3I+h/ Bizg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dmarc-filter:sender:dkim-signature; bh=SR9ztMG5APmU84GNnULI+R1jSiJa1lfXUSNJ0K8XiEc=; b=tlIhRCT1sawV15FLKRRTmdxpoRX4IloLc0oUd17y422f1tYZ+OLKUKHUr3nm4YU206 Iz69h/f1AlhcZx3mbxYlr4rlcvH8Xj2RpYlpRmxBAVkyFc+ObIpLnHZItQu0ZTrUdWq5 9Zn01qZ6V8TcQQCTyRrynWoGPzNmy6qQYYIVIxmq44TLrcjkLeEnYl6ShbffAbpZudSx Gk+trkmFhsOCFnqqBPwTBI4cMutcCZ/LJKUWMfQBkx6oFv0pkf5HBHUcvMGD6i/TO0Oz 9UCd93TUE5p/KJE+N1STbYtaVlFd0/LFsBU9XJRlpFZr1AHi7wkCBqR6XaCESeFjHMn5 EOyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ly7xUyTG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id se15si4287307ejb.204.2021.03.12.07.57.01; Fri, 12 Mar 2021 07:57:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ly7xUyTG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231789AbhCLPyn (ORCPT + 99 others); Fri, 12 Mar 2021 10:54:43 -0500 Received: from m42-2.mailgun.net ([69.72.42.2]:48705 "EHLO m42-2.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232509AbhCLPyO (ORCPT ); Fri, 12 Mar 2021 10:54:14 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1615564453; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=SR9ztMG5APmU84GNnULI+R1jSiJa1lfXUSNJ0K8XiEc=; b=ly7xUyTGxZVFwRZaUuaKnI4xqIisdsWOJ5lLW6gzQ8ig7m/P+dxkyMdt8Zp4Hl1Q4JkLLKeH /ZZjbSMkIjOLxpxJyXcNrlm+QbNYFEd48UoQlS1Sy2K7b0HYrRm/16Zd6QkBuP6lNPw3KL/k t0qoIL8lLMctWTJ8AO/IvWevLLc= X-Mailgun-Sending-Ip: 69.72.42.2 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-east-1.postgun.com with SMTP id 604b8e926dc1045b7d16b25b (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 12 Mar 2021 15:53:54 GMT Sender: srivasam=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id DCC36C4346B; Fri, 12 Mar 2021 15:53:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.29.24] (unknown [49.37.156.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: srivasam) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0CC35C4346B; Fri, 12 Mar 2021 15:53:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0CC35C4346B Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=srivasam@codeaurora.org Subject: Re: [PATCH v4 2/2] arm64: dts: qcom: Add sound node for sc7180-trogdor-coachz To: Doug Anderson Cc: gross@kernel.org, Bjorn Andersson , Rob Herring , linux-arm-msm , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Rohit kumar , Srinivas Kandagatla , Stephen Boyd , Judy Hsiao References: <20210311164815.14113-1-srivasam@codeaurora.org> <20210311164815.14113-3-srivasam@codeaurora.org> From: Srinivasa Rao Mandadapu Organization: Qualcomm India Private Limited. Message-ID: Date: Fri, 12 Mar 2021 21:23:45 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Doug, Thanks for time and valuable inputs!!! On 3/12/2021 1:24 AM, Doug Anderson wrote: > Hi, > > On Thu, Mar 11, 2021 at 8:48 AM Srinivasa Rao Mandadapu > wrote: >> This is a trgodor variant, required to have sound node variable >> for coachz specific platform. >> >> Signed-off-by: Srinivasa Rao Mandadapu >> --- >> .../boot/dts/qcom/sc7180-trogdor-coachz.dtsi | 18 ++++++++++++++++++ >> 1 file changed, 18 insertions(+) >> >> diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi >> index 4ad520f00485..7623a30a64c7 100644 >> --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi >> +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz.dtsi >> @@ -238,3 +238,21 @@ &tlmm { >> "DP_HOT_PLUG_DET", >> "EC_IN_RW_ODL"; >> }; >> + >> +&sound { >> + compatible = "google,sc7180-coachz"; > You're placing this in the wrong place. Pay attention to the section > headings. Your patch is putting this in the section "PINCTRL - > board-specific pinctrl". That's not right. > > >> + model = "sc7180-adau7002-max98357a"; >> + audio-routing = "PDM_DAT", "DMIC"; >> + >> + dai-link@0 { >> + link-name = "MultiMedia0"; >> + reg = <0>; >> + cpu { >> + sound-dai = <&lpass_cpu 0>; > Shouldn't the 0 above be "MI2S_PRIMARY" ? ...and the "reg" as well? Yes, It's required. Will change, and re-post. > > >> + }; >> + >> + codec { >> + sound-dai = <&adau7002>; >> + }; >> + }; > Some overall notes, though: > > 1. You don't actually need to duplicate everything that you have > above. Whether you realize it or not the way devicetree works is that > it _merges_ the node in the "coachz" devicetree with the one from the > trogdor one (it doesn't replace it). So in trogdor you have: > > dai-link@0 { > link-name = "MultiMedia0"; > reg = ; > cpu { > sound-dai = <&lpass_cpu MI2S_PRIMARY>; > }; > > codec { > sound-dai = <&alc5682 MI2S_PRIMARY>; > }; > }; > > ...and in coachz you have: > > dai-link@0 { > link-name = "MultiMedia0"; > reg = ; > cpu { > sound-dai = <&lpass_cpu MI2S_PRIMARY>; > }; > > codec { > sound-dai = <&adau7002>; > }; > }; > > Almost all of that is duplication. It's best not to duplicate. Thus, > one step better than what you have would be to just have this in > coachz to override what you need: > > dai-link@0 { > codec { > sound-dai = <&adau7002>; > }; > }; > > > 2. In general it's discouraged (and error prone) to try to replicate > hierarchies from your parent. So the best would be to change trogdor's > device tree to something like this: > > dai-link@0 { > link-name = "MultiMedia0"; > reg = ; > cpu { > sound-dai = <&lpass_cpu MI2S_PRIMARY>; > }; > > multimedia0_codec: codec { > sound-dai = <&alc5682 MI2S_PRIMARY>; > }; > }; > > ...and then in coachz you override like: > > &multimedia0_codec { > sound-dai = <&alc5682 MI2S_PRIMARY>; > }; Okay. Will change accordingly and re-post. -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.