Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4420743iob; Sun, 8 May 2022 12:08:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRlItXZVKc+INNSLLQL9sLiJjYCMB9r9gC7Dl+upzsTpm/YsQNQgUqAnRAciQjBv5CSJCS X-Received: by 2002:a50:fa8c:0:b0:428:9d92:e5fb with SMTP id w12-20020a50fa8c000000b004289d92e5fbmr1707728edr.395.1652036927237; Sun, 08 May 2022 12:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652036927; cv=none; d=google.com; s=arc-20160816; b=agM+3WMIqw4khptpS71hhx3OUNtvZOR+A9zM1M72HUxvFGTyRUKKWukB8xpznwrOjc ihmV6I3dQDw/I56Va5v93XFS7X/o5fYOXyN4OcHjtfN7Kjmp+IfqnJyBA3C+P08pjZuO RMN/CKAVEUAu1+KvqrP0hHByt0oKNr7BA6M/CnV+zvEj+r45cVMHLkL8AixODleFaaOX Ed5Je5zEK8P5xjiWAps7svDaWaKUhLvDFjSa4dEQ9or/mNnNGv/JgmyVvp1tOzWptzYZ aj25i4X5b6JIRXE221MxL8iYAOPKEAYDC3o6odnyorMnNXU3l1Dwe0JZXzszfz6qWzrG YxnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DvcP/UfDs1e+e8LPCfYxDu3lCRLW8GAUktEocciJRsk=; b=XAnYoxbp2+AiH84LjtOv3G+zs9L4tTPyCiLKNsAPtRfLzFDYGJ2+sxc6Kofmqw6z4e 2oeudHIDmP+wbvYhxPQb6ERknwQtRCYGJKW7KBQgm7dWt782YejsnV2ezXJDNdVtxorJ Ws1FoSjAQZ+vgKFO0DVl/qRoB+l5/ia5YHehcZ5lFpIY86UGw4mtwO/ma1m34RpFA6Sz SFnFxnMC+0g3pMLUumyLmkGjM8zhakv2y0muoDJj5PX8mfVX4pBc3IXX5Pr3waNIi+gi VqwuFe6DD7W2WQU5tLNy1jzfbxFjf+OLcbzF6h+VI3+YA0O+mpi7gxoj6NZymnyMOXl3 mXig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=DsrqAmPP; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc36-20020a1709071c2400b006f4fe0e5576si9797007ejc.34.2022.05.08.12.08.22; Sun, 08 May 2022 12:08:47 -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=@collabora.com header.s=mail header.b=DsrqAmPP; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381963AbiEEQ3a (ORCPT + 99 others); Thu, 5 May 2022 12:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380217AbiEEQ31 (ORCPT ); Thu, 5 May 2022 12:29:27 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C207318E1C; Thu, 5 May 2022 09:25:45 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: nfraprado) with ESMTPSA id 393751F45ABD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1651767943; bh=us6VQcZonVRZDNCqwnPC3/ZUDrCZ5LkU3g8yGafttv4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DsrqAmPPKwC1WvZxKzkbXTRjRJEiP/WizLShBmIu304hhlhhHNQSz9qLISwTIbG4W v+6C9yOSV7c/7M3TEtnFvJe94HChoUgbpjOn6Wq2SqjrQtu0kwsVmCwnUlmEmIBirc Po88xEbIChaOX6eNz/QE3ZfTlD8UWv0968oKjyBsx0JJoQrR9SVC1tIhACa4HxuwZG WLyeqN2LlBDs+gUf5pcSTlu3ulu/pfIYCtS/nxaM7Dy24gZUCy/W8KtsAuNrOhSj8m PA8F2q4XiLyQWx9Yhov61BeZXMt2Dkpy3lcK9Bvw6Uo5MNELIFEBZRKrFFCt+7MaRc BmlcLSapwch7g== Date: Thu, 5 May 2022 12:25:37 -0400 From: =?utf-8?B?TsOtY29sYXMgRi4gUi4gQS4=?= Prado To: AngeloGioacchino Del Regno Cc: Jiaxin Yu , Mark Brown , kernel@collabora.com, Krzysztof Kozlowski , Liam Girdwood , Matthias Brugger , Rob Herring , Shane Chien , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 1/3] ASoC: dt-bindings: mediatek: mt8192: Add i2s-share properties Message-ID: <20220505162537.byiwfe2ghomxhezl@notapiano> References: <20220429203039.2207848-1-nfraprado@collabora.com> <20220429203039.2207848-2-nfraprado@collabora.com> <4826c824-40ce-5726-ed95-5be069233ca7@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 On Thu, May 05, 2022 at 10:52:45AM +0200, AngeloGioacchino Del Regno wrote: > Il 05/05/22 10:48, Jiaxin Yu ha scritto: > > On Thu, 2022-05-05 at 10:08 +0200, AngeloGioacchino Del Regno wrote: > > > Il 29/04/22 22:30, N?colas F. R. A. Prado ha scritto: > > > > The Mediatek AFE PCM controller for MT8192 allows sharing of an I2S > > > > bus > > > > between two busses. Add a pattern for these properties in the > > > > dt-binding. > > > > > > > > Signed-off-by: N?colas F. R. A. Prado > > > > --- > > > > > > > > Documentation/devicetree/bindings/sound/mt8192-afe-pcm.yaml | 5 > > > > +++++ > > > > 1 file changed, 5 insertions(+) > > > > > > > > diff --git a/Documentation/devicetree/bindings/sound/mt8192-afe- > > > > pcm.yaml b/Documentation/devicetree/bindings/sound/mt8192-afe- > > > > pcm.yaml > > > > index 7a25bc9b8060..5b03c8dbf318 100644 > > > > --- a/Documentation/devicetree/bindings/sound/mt8192-afe-pcm.yaml > > > > +++ b/Documentation/devicetree/bindings/sound/mt8192-afe-pcm.yaml > > > > @@ -54,6 +54,11 @@ properties: > > > > - const: aud_infra_clk > > > > - const: aud_infra_26m_clk > > > > +patternProperties: > > > > + "^i2s[0-35-9]-share$": > > > > + description: Name of the I2S bus that is shared with this bus > > > > + pattern: "^I2S[0-35-9]$" > > > > + > > > > required: > > > > - compatible > > > > - interrupts > > > > > > > > > > The only other way of doing this would be to complicate this in the > > > driver > > > so that we can do something like > > > > > > "i2s-share = <0 2>"; instead of i2s0-share = "I2S2"; > > > > > > ...and I don't think that this would be any more straightforward than > > > the > > > provided way. > > > > > > There's an improvement that we can do to that pattern description > > > though, > > > which would be explaining that declaring 'i2s0-share = "I2S2"' means > > > that > > > I2S2's data pin will be used as DATA-OUT, while i2s0 is DATA-IN. > > > > > > Another thing that comes to mind here is that this is a MediaTek > > > specific > > > property and *not* a generic one, which means that both the driver > > > and > > > this binding should be fixed to get a "mediatek," prefix, so, this > > > property > > > should - in reality - be "mediatek,i2s[0-35-9]-share" instead. > > > > > > I think that everyone agrees about that, but let's see what the > > > others say. > > > > > > Cheers, > > > Angelo > > > > Hi Angelo, > > > > 'i2s0-share = "I2S2"' means that if we want use I2S0, there need open > > I2S2 to provide clock. Conversely, if we want to use I2S2, we don't > > need to open I2S0. However, MediaTek I2S0 and I2S2 hardware are > > generally designed as input. So usually we use 'i2s0-share = "I2S1"'. > > Even numbers represent input, odd numbers represent output. > > > > Yes, I think adding the "mediatek," prefix is the right way to define a > > non-generic property. > > Hi Jiaxin, thank you for the insights. > > Hello Jiaxin, > > if I get this correctly, i2s0-share = "I2S2" would be *invalid*... as you > just explained, i2sX, where: > > X = even number -> always DATA IN > X = odd number -> always DATA OUT > > ...this means that the dt-binding needs a pattern to specify that only odd > can be assigned to only even. So, the situation seems different at least on mt8192-asurada-spherion. Here, I2S8 is used for the headset microphone and I2S9 for the headset audio. Even for input and odd for output agree with Jiaxin's description. However, the input bus seems to be the main one, that is, disabling I2S8: amixer cset name='UL2_CH1 I2S8_CH1' 0 amixer cset name='UL2_CH2 I2S8_CH2' 0 not only disables the microphone but also the audio on the headset. If I add i2s9-share = "I2S8"; on the DT, then everything works, I can disable I2S8 without impacting the headset audio. So the pattern for the property on this platform is the opposite that Jiaxin mentioned. This tells me that we should keep the binding more generic (not assume where odds and evens go). I will still apply the other suggestions mentioned though. Thanks, N?colas > > Nicolas, take note! :-) :-) > > Thanks, > Angelo > > -- > To unsubscribe, send mail to kernel-unsubscribe@lists.collabora.co.uk.