From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72495C433EF for ; Mon, 4 Oct 2021 16:59:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 420ED61357 for ; Mon, 4 Oct 2021 16:59:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 420ED61357 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=m6b2tucAyWEB5c5V4Hfi9OVjjUtYT7dhLw6HDdW6eP0=; b=zCaIFvaUKJg3bF gdDbCsoDL3EcDV/bNWO/BxGw6LosA2jQPuNbWhpprWIcjGL/k1h7moO9PiI+GxRdoFzkL9NReThk9 ANjZ8eBxe1XcsVLMScZEoquVfFFbuHrsbrTN2yawRHDN0AaFs+NNy0HGd6YmhMlLf9B0iTDezpW+8 GfG9zfyLKaxW74yJhhfRodj4XWVrtnZM7Yni6B2zdPZ7pZKd9GGs+qXjvpfckAKo+AXOK3M2m7tST speNKV4A8/BSg6UgQKH78uakta87y44x3dVQ+2RRKBDXydjw40b2XjenFv16JCr0aWbjzAJN/3cqT pvLC3zxUqmi5EErJ6KQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXRHi-007Dsc-BP; Mon, 04 Oct 2021 16:57:50 +0000 Received: from mail-ot1-f42.google.com ([209.85.210.42]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXRHR-007DmC-1r for linux-arm-kernel@lists.infradead.org; Mon, 04 Oct 2021 16:57:34 +0000 Received: by mail-ot1-f42.google.com with SMTP id d12-20020a05683025cc00b0054d8486c6b8so22488829otu.0 for ; Mon, 04 Oct 2021 09:57:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ih10pMBW5lUPCC/x9rLmG7kgKn8xGXvYQdK5s5DKY/o=; b=SmBLIm0uF7JsZqPUxdNn0TRCdx/ZItVRYdPtmPf0RaCxI13bUcDZB8f6P2b96F4ieG OVtMy2RfIVoJ65KUptl+UTCFh9YRFPdNIyvUa5ZJEKwY/GtdNwavmdK4oy/4UxBVvBNj h5lzjtiuSJJuqZalLJmlyrea63b7ME+4/MvJQBm7PAZf6a2wsNcUeMKqjsXKKqVmCQt5 3pP1R1rtYx81CxuseUZmXwKVHvsNJJFJJaaPa/evhSMTTLKAB3qfW0jbzlvLlVqVO7eG n+lokfpBXkVADTOJRP8lXkSSHnY3Sa9qje8yBVYUbLL/fIf0opaHGUI4Gcz0BLCXOe1/ iFkw== X-Gm-Message-State: AOAM533oZ1yKendCvIRdT2iksbAxIo5AFdLinsJzUiB2lRDxsY2zMvBm /VcfOSzu3l+TyxRYT17wCg== X-Google-Smtp-Source: ABdhPJwNC9tnHciX03F9NzQzjfCfZ8I0KRSJ7pyztQajIKv6PxnNqi55xufKjBxiyphYX0bFvE61uA== X-Received: by 2002:a9d:8a7:: with SMTP id 36mr10021321otf.263.1633366651128; Mon, 04 Oct 2021 09:57:31 -0700 (PDT) Received: from robh.at.kernel.org (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.gmail.com with ESMTPSA id s7sm2720818oiw.27.2021.10.04.09.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 09:57:30 -0700 (PDT) Received: (nullmailer pid 1469674 invoked by uid 1000); Mon, 04 Oct 2021 16:57:27 -0000 Date: Mon, 4 Oct 2021 11:57:27 -0500 From: Rob Herring To: Olivier Moysan Cc: Alexandre Torgue , Fabrice Gasnier , Jonathan Cameron , Lars-Peter Clausen , Maxime Coquelin , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: Re: [PATCH v3 1/7] dt-bindings: iio: stm32-adc: add generic channel binding Message-ID: References: <20210924083410.12332-1-olivier.moysan@foss.st.com> <20210924083410.12332-2-olivier.moysan@foss.st.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210924083410.12332-2-olivier.moysan@foss.st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211004_095733_129151_46E2FE11 X-CRM114-Status: GOOD ( 26.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 24, 2021 at 10:34:04AM +0200, Olivier Moysan wrote: > Add ADC generic channel binding. This binding should > be used as an alternate to legacy channel properties > whenever possible. > ADC generic channel binding allows to identify supported > internal channels through the following reserved label names: > "vddcore", "vrefint" and "vbat". > This binding also allows to set a different sampling time > for each channel. > > Signed-off-by: Olivier Moysan > --- > .../bindings/iio/adc/st,stm32-adc.yaml | 100 ++++++++++++++++-- > 1 file changed, 93 insertions(+), 7 deletions(-) > > diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml b/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml > index a58334c3bb76..1c13921b0556 100644 > --- a/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml > +++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-adc.yaml > @@ -222,6 +222,12 @@ patternProperties: > '#io-channel-cells': > const: 1 > > + '#address-cells': > + const: 1 > + > + '#size-cells': > + const: 0 > + > interrupts: > description: | > IRQ Line for the ADC instance. Valid values are: > @@ -256,6 +262,7 @@ patternProperties: > - 20 channels, numbered from 0 to 19 (for in0..in19) on stm32h7 and > stm32mp1. > $ref: /schemas/types.yaml#/definitions/uint32-array > + deprecated: true > > st,adc-diff-channels: > description: | > @@ -265,7 +272,9 @@ patternProperties: > , ,... vinp and vinn are numbered from 0 to 19. > > Note: At least one of "st,adc-channels" or "st,adc-diff-channels" is > - required. Both properties can be used together. Some channels can be > + required if no adc generic channel is defined. These legacy channel > + properties are exclusive with adc generic channel bindings. > + Both properties can be used together. Some channels can be > used as single-ended and some other ones as differential (mixed). But > channels can't be configured both as single-ended and differential. > $ref: /schemas/types.yaml#/definitions/uint32-matrix > @@ -279,6 +288,7 @@ patternProperties: > "vinn" indicates negative input number > minimum: 0 > maximum: 19 > + deprecated: true > > st,min-sample-time-nsecs: > description: > @@ -289,6 +299,42 @@ patternProperties: > list, to set sample time resp. for all channels, or independently for > each channel. > $ref: /schemas/types.yaml#/definitions/uint32-array > + deprecated: true > + > + patternProperties: > + "^channel@([0-9]|1[0-9])$": > + type: object > + $ref: "adc.yaml" You need 'additionalProperties: false' here. Or unevaluatedProperties if there are properties used and defined in adc.yaml, but not here. > + description: | Don't need '|' unless you need to maintain formatting (line breaks). > + Represents the external channels which are connected to the ADC. > + > + properties: > + reg: > + items: > + minimum: 0 > + maximum: 19 > + > + label: > + description: | > + Unique name to identify which channel this is. > + Reserved label names "vddcore", "vrefint" and "vbat" > + are used to identify internal channels with matching names. > + > + diff-channels: > + $ref: /schemas/types.yaml#/definitions/uint32-array > + items: > + minimum: 0 > + maximum: 19 > + > + st,min-sample-time-nsecs: Use standard unit suffix (-ns). > + $ref: /schemas/types.yaml#/definitions/uint32 And then drop this. > + description: | > + Minimum sampling time in nanoseconds. Depending on hardware (board) > + e.g. high/low analog input source impedance, fine tune of ADC > + sampling time may be recommended. > + > + required: > + - reg > > allOf: > - if: > @@ -369,12 +415,6 @@ patternProperties: > > additionalProperties: false > > - anyOf: > - - required: > - - st,adc-channels > - - required: > - - st,adc-diff-channels > - > required: > - compatible > - reg > @@ -451,4 +491,50 @@ examples: > // other adc child node follow... > }; > > + - | > + // Example 3: with stm32mp157c to setup ADC2 with: > + // - internal channels 13, 14, 15. > + #include > + #include > + adc122: adc@48003000 { > + compatible = "st,stm32mp1-adc-core"; > + reg = <0x48003000 0x400>; > + interrupts = , > + ; > + clocks = <&rcc ADC12>, <&rcc ADC12_K>; > + clock-names = "bus", "adc"; > + booster-supply = <&booster>; > + vdd-supply = <&vdd>; > + vdda-supply = <&vdda>; > + vref-supply = <&vref>; > + st,syscfg = <&syscfg>; > + interrupt-controller; > + #interrupt-cells = <1>; > + #address-cells = <1>; > + #size-cells = <0>; > + adc@100 { > + compatible = "st,stm32mp1-adc"; > + #io-channel-cells = <1>; > + reg = <0x100>; > + interrupts = <1>; > + #address-cells = <1>; > + #size-cells = <0>; > + channel@13 { > + reg = <13>; > + label = "vrefint"; > + st,min-sample-time-nsecs = <9000>; > + }; > + channel@14 { > + reg = <14>; > + label = "vddcore"; > + st,min-sample-time-nsecs = <9000>; > + }; > + channel@15 { > + reg = <15>; > + label = "vbat"; > + st,min-sample-time-nsecs = <9000>; > + }; > + }; > + }; > + > ... > -- > 2.17.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel