Message ID | dbe88fd2f7ea5b2f419dce6ecb48c20e96e2e634.1666190235.git.daniel@makrotopia.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp382420wrs; Wed, 19 Oct 2022 08:16:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5LVnKE7iVUW0WLeG8O2SiCIWQaVoukbCapo6D1ZgRCtH9uTP+9k7eiOH2b6hHLVBV0FFXM X-Received: by 2002:a17:906:c08c:b0:78d:b8ce:c28f with SMTP id f12-20020a170906c08c00b0078db8cec28fmr7116947ejz.437.1666192594765; Wed, 19 Oct 2022 08:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666192594; cv=none; d=google.com; s=arc-20160816; b=0qWe7UNhyKIKgw5eX1CEUcsLN/SNobh525cw2swBSW4/1tTfkiyz/qK/CgUZ94bKmw Dm+2AkH796AMnPWTRGSkxIRlTTcT3umUCBBRzr4iZOSs9ZvyrIuKkcZlgMV3AS7yG3Z7 znZ2PM670AAr8haj+Rf1VmNLwMXqhDb7NHwOgmgO+zaRccMu/ARhl/oulm+dNxPEfV+2 jvqwCVvbQNo3RSaZlWqwlCFnX7u1hw3FugUNUnWp+jKULBd/1I8lGMOZokvjv9nEo+W0 K67BIdlXisPhQVAc64LdiquXUBngL1l2MNVGSlgAi0dsSV8zgzqYz8p+DCOzMmt3jIRi 0HIQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Jqr7mhmldmosAsnJUhepWkrYvRNHDwT8zl89bERS4z8=; b=i6gDfQjivW0gcCy+QFqPFNwNb4zQVxUdsv/iHrPinmN/gvfV3VKMozvMHEiInbA4W+ X/EJxaM6aTlTiz/h3oPi5PzdHmz4wCRT49nNYfGCdz9QS00FpQ54EFhP27tw0/7MIjST Lba8ZXzZ34OkDAQrO6+8lQcXBqQ4HMg9JHJfMOU7RbkItup3y1UFHlpnuEfglwmQVJf6 16NKF9c1PsjgvkrB7JQPy0qq5pC2L+487lzf3PahsVXRdoXNzRELjPVIPbUaBdhSw9OK pJYWvboB9VZ/aYDyYij9dK2vjkYL8Zot6ZGUkmnt3W06nkfb5wx3aVeoCRTfiH0WJkIx M+lQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ae8-20020a17090725c800b0077fd5b45e18si12564506ejc.929.2022.10.19.08.16.08; Wed, 19 Oct 2022 08:16:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229509AbiJSPNj (ORCPT <rfc822;samuel.l.nystrom@gmail.com> + 99 others); Wed, 19 Oct 2022 11:13:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232128AbiJSPNP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 19 Oct 2022 11:13:15 -0400 X-Greylist: delayed 901 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 19 Oct 2022 08:05:46 PDT Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F4E72338A; Wed, 19 Oct 2022 08:05:45 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.94.2) (envelope-from <daniel@makrotopia.org>) id 1olAD8-0000na-7i; Wed, 19 Oct 2022 16:38:22 +0200 Date: Wed, 19 Oct 2022 15:38:15 +0100 From: Daniel Golle <daniel@makrotopia.org> To: Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Matthias Brugger <matthias.bgg@gmail.com>, linux-iio@vger.kernel.org Cc: Gwendal Grignou <gwendal@chromium.org>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] dt-bindings: iio: adc: mediatek,mt2701-auxadc: new 32k clock Message-ID: <dbe88fd2f7ea5b2f419dce6ecb48c20e96e2e634.1666190235.git.daniel@makrotopia.org> References: <f98ed7f3fc15a0614443a57427d46ce17ec2e0cc.1666190235.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <f98ed7f3fc15a0614443a57427d46ce17ec2e0cc.1666190235.git.daniel@makrotopia.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747129566404383157?= X-GMAIL-MSGID: =?utf-8?q?1747129566404383157?= |
Series |
[1/2] iio: adc: mt6577_auxadc: add optional 32k clock
|
|
Commit Message
Daniel Golle
Oct. 19, 2022, 2:38 p.m. UTC
Newer MediaTek SoCs need an additional clock to be brought up for
AUXADC to work. Add this new optional clock to
mediatek,mt2701-auxadc.yaml.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
.../bindings/iio/adc/mediatek,mt2701-auxadc.yaml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Comments
Il 19/10/22 16:38, Daniel Golle ha scritto: > Newer MediaTek SoCs need an additional clock to be brought up for > AUXADC to work. Add this new optional clock to > mediatek,mt2701-auxadc.yaml. > > Signed-off-by: Daniel Golle <daniel@makrotopia.org> > --- > .../bindings/iio/adc/mediatek,mt2701-auxadc.yaml | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml > index 7f79a06e76f596..c2a1813dd54152 100644 > --- a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml > +++ b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml > @@ -44,10 +44,14 @@ properties: > maxItems: 1 > > clocks: > - maxItems: 1 > + maxItems: 2 > + minItems: 1 > > clock-names: > - const: main > + items: > + - const: main > + - const: 32k You're adding this for MT7986, and I don't see any 32KHz ADC clock on that SoC. I suppose that your '32k' clock is CLK_INFRA_ADC_FRC_CK, currently parented to 'csw_f26m_sel', so that's 26MHz, not 32KHz. Since you'll need the same changes for thermal as well, I would consider setting "infra_adc_frc" as a parent of "infra_adc_26m", like so: GATE_INFRA1(CLK_INFRA_ADC_26M_CK, "infra_adc_26m", "infra_adc_frc", 20), GATE_INFRA1(CLK_INFRA_ADC_FRC_CK, "infra_adc_frc", "csw_f26m_sel", 21), ...just because there's apparently no reason to have one of them enabled but not the other or, at least, it looks like we *always* need ADC_26M_CK enabled when ADC_FRC_CK is enabled. Regards, Angelo
On Thu, Oct 20, 2022 at 10:28:02AM +0200, AngeloGioacchino Del Regno wrote: > Il 19/10/22 16:38, Daniel Golle ha scritto: > > Newer MediaTek SoCs need an additional clock to be brought up for > > AUXADC to work. Add this new optional clock to > > mediatek,mt2701-auxadc.yaml. > > > > Signed-off-by: Daniel Golle <daniel@makrotopia.org> > > --- > > .../bindings/iio/adc/mediatek,mt2701-auxadc.yaml | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml > > index 7f79a06e76f596..c2a1813dd54152 100644 > > --- a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml > > +++ b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml > > @@ -44,10 +44,14 @@ properties: > > maxItems: 1 > > clocks: > > - maxItems: 1 > > + maxItems: 2 > > + minItems: 1 > > clock-names: > > - const: main > > + items: > > + - const: main > > + - const: 32k > > You're adding this for MT7986, and I don't see any 32KHz ADC clock on that SoC. > I suppose that your '32k' clock is CLK_INFRA_ADC_FRC_CK, currently parented to > 'csw_f26m_sel', so that's 26MHz, not 32KHz. > > Since you'll need the same changes for thermal as well, I would consider setting > "infra_adc_frc" as a parent of "infra_adc_26m", like so: > > GATE_INFRA1(CLK_INFRA_ADC_26M_CK, "infra_adc_26m", "infra_adc_frc", 20), > GATE_INFRA1(CLK_INFRA_ADC_FRC_CK, "infra_adc_frc", "csw_f26m_sel", 21), > > ...just because there's apparently no reason to have one of them enabled but not > the other or, at least, it looks like we *always* need ADC_26M_CK enabled when > ADC_FRC_CK is enabled. > Yes, this change is for MT7986 and MT7981, immitating the behavior found in MediaTek's SDK sources. Embedding the dependency into the clock driver as you have suggested should also be possible as it is true that you always need them both and a similar change for the thermal driver would be needed as well. Unless you were planning to do so already I will send a patch with your suggested change to drivers/clk/mediatek/clk-mt7986-infracfg.c. In any case, this series can be dropped then. Thank you for the review! Cheers Daniel > Regards, > Angelo
Il 20/10/22 21:30, Daniel Golle ha scritto: > On Thu, Oct 20, 2022 at 10:28:02AM +0200, AngeloGioacchino Del Regno wrote: >> Il 19/10/22 16:38, Daniel Golle ha scritto: >>> Newer MediaTek SoCs need an additional clock to be brought up for >>> AUXADC to work. Add this new optional clock to >>> mediatek,mt2701-auxadc.yaml. >>> >>> Signed-off-by: Daniel Golle <daniel@makrotopia.org> >>> --- >>> .../bindings/iio/adc/mediatek,mt2701-auxadc.yaml | 8 ++++++-- >>> 1 file changed, 6 insertions(+), 2 deletions(-) >>> >>> diff --git a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml >>> index 7f79a06e76f596..c2a1813dd54152 100644 >>> --- a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml >>> +++ b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml >>> @@ -44,10 +44,14 @@ properties: >>> maxItems: 1 >>> clocks: >>> - maxItems: 1 >>> + maxItems: 2 >>> + minItems: 1 >>> clock-names: >>> - const: main >>> + items: >>> + - const: main >>> + - const: 32k >> >> You're adding this for MT7986, and I don't see any 32KHz ADC clock on that SoC. >> I suppose that your '32k' clock is CLK_INFRA_ADC_FRC_CK, currently parented to >> 'csw_f26m_sel', so that's 26MHz, not 32KHz. >> >> Since you'll need the same changes for thermal as well, I would consider setting >> "infra_adc_frc" as a parent of "infra_adc_26m", like so: >> >> GATE_INFRA1(CLK_INFRA_ADC_26M_CK, "infra_adc_26m", "infra_adc_frc", 20), >> GATE_INFRA1(CLK_INFRA_ADC_FRC_CK, "infra_adc_frc", "csw_f26m_sel", 21), >> >> ...just because there's apparently no reason to have one of them enabled but not >> the other or, at least, it looks like we *always* need ADC_26M_CK enabled when >> ADC_FRC_CK is enabled. >> > > Yes, this change is for MT7986 and MT7981, immitating the behavior > found in MediaTek's SDK sources. Embedding the dependency into the > clock driver as you have suggested should also be possible as it is > true that you always need them both and a similar change for the > thermal driver would be needed as well. > > Unless you were planning to do so already I will send a patch with your > suggested change to drivers/clk/mediatek/clk-mt7986-infracfg.c. > In any case, this series can be dropped then. > > Thank you for the review! > > You're welcome. Nice job sending the clock commit. For the maintainers: This series can be abandoned, as that clock dependency was fixed elsewhere. Regards, Angelo
diff --git a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml index 7f79a06e76f596..c2a1813dd54152 100644 --- a/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml +++ b/Documentation/devicetree/bindings/iio/adc/mediatek,mt2701-auxadc.yaml @@ -44,10 +44,14 @@ properties: maxItems: 1 clocks: - maxItems: 1 + maxItems: 2 + minItems: 1 clock-names: - const: main + items: + - const: main + - const: 32k + minItems: 1 "#io-channel-cells": const: 1