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 X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65FFBC433DF for ; Thu, 16 Jul 2020 21:27:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2BBB120787 for ; Thu, 16 Jul 2020 21:27:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AGbKRlyp"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RzNAZoej" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BBB120787 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=ZNXfSR2pw169WOjd59Q1Zdwh5mQstvWdbypxDQELUAg=; b=AGbKRlypORTbZhvnkbKfeUu5g mOcykcwp67iZ3PKKnXZuiGLlTQIiC3v6onehsueYwyrbatXfI7KJdFno8/ft/v44LhEgB9AVUwGBW Cm6V60DDGgoVZDTBDXuWFq2Ci5zDsLLAxce++sa/MwBYBkn+KDYap4Lkfp5KSSDVRQMIoaYHMmUCA r6y9EZjopQ5ihZdi8YlvOZXDgnh0OZu8tVYvOYCFp3jNWxdQydFSCFkr26PxSSLLGEZncHeaibf8Y e5BdwZNDPFPelTwk6C6E4z3vlvyYNHUNXWpoIr90CDnczPwL/2bUqUtivvkbSGynPjcYN4t1CRlDS LlgodUjFg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwBOp-0006r1-62; Thu, 16 Jul 2020 21:26:39 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwBOm-0006qU-69; Thu, 16 Jul 2020 21:26:37 +0000 Received: by mail-ej1-x643.google.com with SMTP id dp18so8185944ejc.8; Thu, 16 Jul 2020 14:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vAseUwcQJdDJQQra5TLeLm+SJbx5n23UWFenIaII7YI=; b=RzNAZoejioCvLIzByvtQGVtgUKb7+UXluj3R4ebR91VeNxXDXqhn/1nQu7qixemUju lvd1pm3mo9dtStJ4jO1jA2sQD+J+y0XTqn0t7HjG/qPGj2is9EUTVvKNkixDUF105Ab5 SQINgUAcT3LjEbzb3g3qu4aAzpwfg+6AHBLhWTFZZhLIw1MG02TBNfGXudsDH9sioMwQ hwQtaJoXjnFlddCrOEfOhW732LZQaZSs0Ze+lpLPhhObICHV5LgRJAOlE93qjqiJwmUE QOrPzoZUiJee7xMoTbubCeTtzHCddwETMiGdL34b/4/JFdaUa4E76Lp3tnbBerKHKsin op2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vAseUwcQJdDJQQra5TLeLm+SJbx5n23UWFenIaII7YI=; b=UhL5MXam3WOf6ObBZMpOyHqdz0ZDx3YtGoIBmA4sqy99RCRhKI9N+NsAoU9sYMyAyf zPX0K0VS1+dVg5WJLMAchlqFybTddqiTaz4jvDIeZPu7CL3wAPg6e0NAxnyl0O6g3o6g BOok0pwJWfyr+QLMJEE0AgnyBQ45cp+j1yTyqbo52hiEZ+TUQzsUfnstE46W0E6AQqrb 6ASx+bo0jC4laR+/89R50m65EUnXPEU/FIYCgJjPQA8HuSy4H+zbye9LuP9MHi21xekd Zw1Cfwg7DtdUaSiD82qtCDBTzj30MrCHYCiXVLtnI8SOhtG/abQu4S/y7tHQ7cerAWJ7 lo4Q== X-Gm-Message-State: AOAM532IeCYfAAvNSb7nNBVdcx7hYPC5kKYmad6F1eLiC5rAcH2GGs0f rqM+ttNm7Pi6gRIgdCRwTEAEMzyz X-Google-Smtp-Source: ABdhPJy07RGdNa3FOJhhw3BUf5RTKV1JBhUIdwZloMswtbvXh0JJPkU0i4+HLCgqbVLI3plPHTGP+w== X-Received: by 2002:a17:906:434c:: with SMTP id z12mr5444703ejm.33.1594934794860; Thu, 16 Jul 2020 14:26:34 -0700 (PDT) Received: from BV030612LT ([188.24.137.55]) by smtp.gmail.com with ESMTPSA id o15sm6249168edv.55.2020.07.16.14.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 14:26:33 -0700 (PDT) Date: Fri, 17 Jul 2020 00:26:31 +0300 From: Cristian Ciocaltea To: Rob Herring Subject: Re: [PATCH 1/3] dt-bindings: pinctrl: Add bindings for Actions S500 SoC Message-ID: <20200716212631.GA348917@BV030612LT> References: <2a7610ff9f33cf72d9df6fc4598741fb6d7836e0.1593112402.git.cristian.ciocaltea@gmail.com> <20200715200309.GA722435@bogus> <20200716104316.GA309338@BV030612LT> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_172636_289147_86CF8E9A X-CRM114-Status: GOOD ( 33.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Linus Walleij , linux-actions@lists.infradead.org, "linux-kernel@vger.kernel.org" , "open list:GPIO SUBSYSTEM" , Manivannan Sadhasivam , Andreas =?iso-8859-1?Q?F=E4rber?= , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 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 Thu, Jul 16, 2020 at 08:50:36AM -0600, Rob Herring wrote: > On Thu, Jul 16, 2020 at 4:43 AM Cristian Ciocaltea > wrote: > > > > On Wed, Jul 15, 2020 at 02:03:09PM -0600, Rob Herring wrote: > > > On Thu, Jun 25, 2020 at 11:16:18PM +0300, Cristian Ciocaltea wrote: > > > > Add pinctrl and gpio bindings for Actions Semi S500 SoC. > > > > > > > > Signed-off-by: Cristian Ciocaltea > > > > --- > > > > .../pinctrl/actions,s500-pinctrl.yaml | 228 ++++++++++++++++++ > > > > 1 file changed, 228 insertions(+) > > > > create mode 100644 Documentation/devicetree/bindings/pinctrl/actions,s500-pinctrl.yaml > > > > > > > > diff --git a/Documentation/devicetree/bindings/pinctrl/actions,s500-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/actions,s500-pinctrl.yaml > > > > new file mode 100644 > > > > index 000000000000..856947c70844 > > > > --- /dev/null > > > > +++ b/Documentation/devicetree/bindings/pinctrl/actions,s500-pinctrl.yaml > > > > @@ -0,0 +1,228 @@ > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > > +%YAML 1.2 > > > > +--- > > > > +$id: http://devicetree.org/schemas/pinctrl/actions,s500-pinctrl.yaml# > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > > + > > > > +title: Actions Semi S500 SoC pinmux & GPIO controller > > > > + > > > > +maintainers: > > > > + - Manivannan Sadhasivam > > > > + > > > > +description: | > > > > + Pinmux & GPIO controller manages pin multiplexing & configuration including > > > > + GPIO function selection & GPIO attributes configuration. Please refer to > > > > + pinctrl-bindings.txt in this directory for common binding part and usage. > > > > + > > > > +properties: > > > > + compatible: > > > > + const: actions,s500-pinctrl > > > > + > > > > + reg: > > > > + minItems: 1 > > > > + maxItems: 4 > > > > > > Need to enumerate what each register range is. > > > > Hi Rob, > > > > Thanks for the review! > > > > Would the update below suffice? > > > > reg: > > description: | > > Specifies the memory region(s) associated with the pin-controller. > > To improve granularity, up to four register ranges can be provided: > > What does 'improve granularity' mean: Technically all the registers used by the driver could be specified via a single contiguous range. However, there are a few unrelated registers (i.e. PWM Output Control) which should be excluded in order to come up with a more accurate specification. The 4 ranges below are basically the result of this exclusion: > > * GPIO Output + GPIO Input + GPIO Data > > * Multiplexing Control > > * PAD Pull Control + PAD Schmitt Trigger enable + PAD Control > > * PAD Drive Capacity Select > > The h/w sometimes has these and sometimes doesn't? No, the h/w is fixed, the only reason of this approach was to allow a precise memory region specification, as explained above. I'm not sure if this should be made mandatory or it's also fine to let (a lazy) user provide combined ranges or just a contiguous one (like in the example), with the drawback of loosing the accuracy, of course. > If they do stay, then you want: > > items: > - description: GPIO Output + GPIO Input + GPIO Data > - description: ... Would this be applicable even if we keep this flexible approach and don't set 'minItems: 4'? > > > > > > + > > > > + clocks: > > > > + maxItems: 1 > > > > + > > > > + gpio-controller: true > > > > + > > > > + gpio-ranges: > > > > + maxItems: 1 > > > > + > > > > + '#gpio-cells': > > > > + description: > > > > + Specifies the pin number and flags, as defined in > > > > + include/dt-bindings/gpio/gpio.h > > > > + const: 2 > > > > + > > > > + interrupt-controller: true > > > > + > > > > + '#interrupt-cells': > > > > + description: > > > > + Specifies the pin number and flags, as defined in > > > > + include/dt-bindings/interrupt-controller/irq.h > > > > + const: 2 > > > > + > > > > + interrupts: > > > > + description: > > > > + One interrupt per each of the 5 GPIO ports supported by the controller, > > > > + sorted by port number ascending order. > > > > + minItems: 5 > > > > + maxItems: 5 > > > > + > > > > +patternProperties: > > > > + '^.*$': > > > > + if: > > > > + type: object > > > > > > For a new binding, can you do '-pins$' for the node names so we don't > > > need this if/then hack. > > > > Right, the idea was to be consistent with the existing bindings for > > S700 and S900, which allow free node names, although they are not yet > > converted to yaml format. > > If we want consistency, those should have their node names updated. Fair enough, I have already updated the node names to use the '-pins' suffix. > > > > > > + then: > > > > + patternProperties: > > > > + 'pinmux$': > > > > > > Is this really a pattern? Can't tell from the example. > > > > pinmux and pinconf subnodes may appear multiple times, that's why I > > decided to match their names based on the suffix. > > > > The example is not complex enough, I will change it to the following: > > > > mmc0_default: mmc0_default { > > pinmux { > > groups = "sd0_d0_mfp", "sd0_d1_mfp", "sd0_d2_d3_mfp", > > "sd0_cmd_mfp", "sd0_clk_mfp"; > > function = "sd0"; > > }; > > > > drv_pinconf { > > drv-pinconf > > Make the pattern '-?pinconf' to enforce that. (that '-' may need escaping?) Actually the pattern should be '^(.*-)?pinconf$', to restrict the names to either 'pinconf' or '