Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp456901rwd; Wed, 31 May 2023 00:15:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5sgFVr7kNlqFSxX30ofGrAEuWolNAC3wN7h0d7LJUxCrZ3ZpuVXWpvdN4xFAXJd5Geba6T X-Received: by 2002:a17:90a:5aa1:b0:249:6098:b068 with SMTP id n30-20020a17090a5aa100b002496098b068mr4742891pji.45.1685517315351; Wed, 31 May 2023 00:15:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685517315; cv=none; d=google.com; s=arc-20160816; b=VDjBKPHKwPUEifXAIIUN5W6fEJeUEJXol5/LgUZpgCiWX/tyA9ub3LOIf3jjrWZyyK bkh/K/CbaM4uRawMxonuWd17B2D/7lU/E0uxx5lHnkL+uAR573tdtlJu4rdIDJXRKEcL YGhDo0I5+VJ3ynGF/Y6dNIk9UN6+DaWymzIzU2tQdMRygci5uuF0bBH6+Bp75/AcMKkC InlutmZqcUFBS3DfugqdLrv5LlDTZM1m/xVMnWQ/bl+9japp+rjv6Yi4mClLlEV3bHkl dB4Nc23NTyKFqZhXKM9jSBGQ9G/k7eKxDrgJrUHXT7LCYtLnBGiEa1ntsX3gY6gC8MlT b/uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=uSW2PnFIqnxjHbhpdzsjGcpZqsHNCS8CfUjd/XLbYNc=; b=gJsjG4czpDH53LUtP710p2Q4VlKlVvKNb0pBS/Gk02Otv4oaA0WjBiKxcV/5mbHzJT jXWjnnP9NdgjBJ8nj/bw32JdMsiZZzHzToeinPjI53N+KYN3+jCOe4XkdDTKsl2sB6dm VYgL/A/sdGwF32Cx0vAHTHFi973rP13IMzpA0YpXJXGOHWTHMdOT+9++1A/x01Vw81mz fzagn+bPCOZWxkxCOCvJTQbv7obo59chynKPA8qBrrTrM49WDourzdTFIpN5HMna+RV7 DLCvzUfqJkjYqKkkJ4qS0R6MPDWQdPqV/4f9S4zhwwN7ytRFVdTPQL9DYD5Np6YK/Nev uQQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=cZTV4a1c; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l69-20020a638848000000b0051e011fcd73si517078pgd.237.2023.05.31.00.15.03; Wed, 31 May 2023 00:15:15 -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=@gmail.com header.s=20221208 header.b=cZTV4a1c; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232301AbjEaHAQ (ORCPT + 99 others); Wed, 31 May 2023 03:00:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232373AbjEaHAO (ORCPT ); Wed, 31 May 2023 03:00:14 -0400 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89E3018B; Wed, 31 May 2023 00:00:05 -0700 (PDT) Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6af6ec6d73bso2006483a34.3; Wed, 31 May 2023 00:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685516405; x=1688108405; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uSW2PnFIqnxjHbhpdzsjGcpZqsHNCS8CfUjd/XLbYNc=; b=cZTV4a1cXkeM22BGXe2aogFTeSVqHuc2NVjxiitTuvpT3uSyYFdg6baqDZ/iIt0o+l LIfONdVzVhGToxON/QYad3gbFrRAev08rq4kBIqhLNSN8PGhPLd5g4zbXIGqlFFYbsCo FU6Fp0Cl/kqsQYpVTGAMWFvRU2sO3/xEZOOFFAS+w2gFuwU91lGn86OyrqVBYTGf3Tzn upZ53y3Jr74eDNT1H0OKpYeQUSSsHhJQ1m2L1XSVUn6WpEYnryTw86XozbDNz0Z4Y4Er t8IodxGm/dzburm21S06tar0zvchV4UpmY8GCveeBFR/Rv/RBKrtQjvlXjCWsd0MlgXT bYPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685516405; x=1688108405; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uSW2PnFIqnxjHbhpdzsjGcpZqsHNCS8CfUjd/XLbYNc=; b=aLm6HumBih88E97KkP1sIXR+7eZfhKxBS17a6z2bv3EIT7gZj/+IVn6xQLProFLpyQ qz0n3s7M2QqFHpV9R/Vpq6t1BpXeOQVlQ8lsOkWqEjNJMCmP/JQ48knf2zGdDQbEaxZa 99JHFu7Ct/71ZZ/xK7K+WvE4La1XcaU5AYCfWaDQvKwSH0pTiFJYeR7GvHNlnq7zO6L3 Q7v08yGDEh02y17clwSSo8Uf/uYUTzRZWs1gFcJDo6nOmwLkWLFa8VNXO5oC5VDpJ40P Spt1GurZXLaq/3iV/uw7Wfu+n9l5Tp802Xy6Y2FiCxewS/yABafJ30fGBPPmEGRtvBJv 0FEw== X-Gm-Message-State: AC+VfDzAUEG0teZnsiWwRl0DVyhv0hLLd8eFf9AkfBXnzatMalkH1DQ5 zRL1gW6c7cTrbFg96UXK7zNA1fVKAJT33bEBTt0= X-Received: by 2002:a05:6808:3d9:b0:398:29bb:dd49 with SMTP id o25-20020a05680803d900b0039829bbdd49mr2380629oie.34.1685516404602; Wed, 31 May 2023 00:00:04 -0700 (PDT) MIME-Version: 1.0 References: <20230530075311.400686-1-fl.scratchpad@gmail.com> <20230530075311.400686-6-fl.scratchpad@gmail.com> <20230530-cannabis-headstone-883c5b891dd3@spud> In-Reply-To: <20230530-cannabis-headstone-883c5b891dd3@spud> From: Fabrizio Lamarque Date: Wed, 31 May 2023 08:59:53 +0200 Message-ID: Subject: Re: [PATCH v3 5/5] dt-bindings: iio: ad7192: Allow selection of clock modes To: Conor Dooley Cc: jic23@kernel.org, Lars-Peter Clausen , Michael Hennerich , Alexandru Tachici , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Tue, May 30, 2023 at 7:22=E2=80=AFPM Conor Dooley wro= te: > > On Tue, May 30, 2023 at 09:53:11AM +0200, fl.scratchpad@gmail.com wrote: > > From: Fabrizio Lamarque > > > > AD7192 supports external clock sources, generated by a digital clock > > source or a crystal oscillator, or internally generated clock option > > without external components. > > > > Describe choice between internal and external clock, crystal or externa= l > > oscillator, and internal clock output enable. > > > > Signed-off-by: Fabrizio Lamarque > > --- > > .../bindings/iio/adc/adi,ad7192.yaml | 27 ++++++++++++++++--- > > 1 file changed, 24 insertions(+), 3 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml = b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml > > index 16def2985ab4..f7ecfd65ad80 100644 > > --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml > > +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml > > @@ -32,7 +32,8 @@ properties: > > > > clocks: > > maxItems: 1 > > - description: phandle to the master clock (mclk) > > + description: | > > + Master clock (mclk). If not set, internal clock is used. > > > > clock-names: > > items: > > @@ -50,6 +51,17 @@ properties: > > vref-supply: > > description: VRef voltage supply > > > > + adi,clock-xtal: > > + description: | > > + Select whether an external crystal oscillator or an external > > + clock is applied as master (mclk) clock. > > + type: boolean > > Am I being daft, or are these the same thing? If they are not, and use > different input pins, I think it should be explained as it not clear. > Could you explain why we actually care that the source is a xtal versus > it being mclk, and why just having master clock is not sufficient? I may revise the description as follows. Feel free to add your suggestions in case it is still not clear enough. "Select whether an external crystal oscillator between MCLK1 and MCLK2 or an external CMOS-compatible clock on MCLK2 is used as master clock". This is used to properly set CLK0 and CLK1 bits in the MODE register. I guess most applications would use an external crystal or internal clock. The external digital clock would allow synchronization of multiple ADCs, > > > + adi,int-clock-output-enable: > > + description: | > > + When internal clock is selected, this bit enables clock out pin. > > + type: boolean > > And this one makes you a clock provider, so the devices advocate > position would be that you know that this bit should be set if > "clocks" is not present and a consumer requests a clock. > I don't seem to have got the driver patches (at least not in this > mailbox), so I have got no information on how you've actually implemented > this. I see... When this bit is set, the AD7192 node should also be a clock provi= der. The clock is output on MCLK2 pin, hence it can be used with internally generated clock only. I tend to dislike the idea of a "conditional clock provider". Also, I'd gue= ss there is a very limited usage of a low precision clock output for synchronization purposes between multiple ADCs. In the remote case, I would rather use a precise, dedicated external digital clock. Would you agree if I remove the related lines from the change set? If not, I kindly ask for your suggestions. The existing implementation from AD already includes all these configurations (there are no driver patches, the proposed changes are just related to documentation). Thank you! Fabrizio > > Cheers, > Conor. > > > + > > adi,rejection-60-Hz-enable: > > description: | > > This bit enables a notch at 60 Hz when the first notch of the si= nc > > @@ -84,11 +96,12 @@ properties: > > description: see Documentation/devicetree/bindings/iio/adc/adc.yam= l > > type: boolean > > > > +dependencies: > > + adi,clock-xtal: ['clocks', 'clock-names'] > > + > > required: > > - compatible > > - reg > > - - clocks > > - - clock-names > > - interrupts > > - dvdd-supply > > - avdd-supply > > @@ -98,6 +111,13 @@ required: > > > > allOf: > > - $ref: /schemas/spi/spi-peripheral-props.yaml# > > + - if: > > + required: > > + - clocks > > + - clock-names > > + then: > > + properties: > > + adi,int-clock-output-enable: false > > > > unevaluatedProperties: false > > > > @@ -115,6 +135,7 @@ examples: > > spi-cpha; > > clocks =3D <&ad7192_mclk>; > > clock-names =3D "mclk"; > > + adi,clock-xtal; > > interrupts =3D <25 0x2>; > > interrupt-parent =3D <&gpio>; > > dvdd-supply =3D <&dvdd>; > > -- > > 2.34.1 > >