Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1288487ybg; Fri, 18 Oct 2019 15:16:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHy6AP6tZN/Y0wJXvMH0koBoP2oVfPyXiGq95kUWo34HvOKYz4/96vtsJk0lWvoAFzg6wM X-Received: by 2002:a17:906:615:: with SMTP id s21mr11089059ejb.276.1571437003008; Fri, 18 Oct 2019 15:16:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571437003; cv=none; d=google.com; s=arc-20160816; b=yyOJbEEFJuNYdtzWdgBLEYk8xG/O65LQ6R8GpQC8x3Rn5Wc+UdwGxlRHzOQqIbzchF T7AzegHind/1cdVSKAIVb3z6rMeBAwXrPVh+02jP+5nRPgDC475V79N8in2kognim2tH ij+3ta4LdrYxYRjeikvaE4DDg2QQbscYXJ2TwDEa7ZCOSLsE4HH2eT7t7uoAN1mxKQez hRpYvkbtH4e/BwoQhutBJ60MFjkD9lDjakqeA+W9OAgA8JdCoYTjoiZywaMLBBGiKz4s bwgqREhbNlyuE5BxZDHFI2SQ6ICQ/xXkpk6ociNAwwKH2Fh49ZAjXLsencb7iwyNV1Gj 3IEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=JbxUD4/Ch48OCt7IQSmlYFRVjr2GA3XCWfDDRfU4VJU=; b=sceztSjoDoFlbPNQvi3aKyuPQosAWUBUzhBS6TraKWB4ZA3t3kHrjxsNpI3SNaOV9n iQd6fo4XllnYm0FKvX3QwFnnx9Y85lgQsCcrNEqN9P5mbrBy+hh1SqKWDOzVYcb1mPld h3MDG3/w+htBNcWPFzcIdtQXLz/A5eeWT3jOzQVZhTUMqZLygbk4l6s9BjdSPT5ISUYy V0jbrfbQcy3iHK7dgWWWlaZU8CDpLJUt5VqMdyFO1mBUt7soIECQagVpf/4a6Pk0+GfB hjhPYDH1Et3wgwJUjtxdpKhZ9BXod4KdyZWePzSDK4jpSQtT3dipqy78uoCIlepQTim8 5KoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si4081420ejp.326.2019.10.18.15.16.19; Fri, 18 Oct 2019 15:16:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503498AbfJQTYl (ORCPT + 99 others); Thu, 17 Oct 2019 15:24:41 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:38462 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393438AbfJQTYl (ORCPT ); Thu, 17 Oct 2019 15:24:41 -0400 Received: by mail-oi1-f193.google.com with SMTP id k10so856376oij.5; Thu, 17 Oct 2019 12:24:39 -0700 (PDT) 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:user-agent; bh=JbxUD4/Ch48OCt7IQSmlYFRVjr2GA3XCWfDDRfU4VJU=; b=Lc6AY1pt3sW7zF2T8T636zz4Gsy44kCslv9x9jlzb8QS4BrnlkTt5EC5oUPVOLxVz8 57IupVDdiJUTinWI9huz3SY3ZNfMC46IXY/aFQ+u5pPXL5sG/P1JFG57YxXL+oxV51p9 rsmc2ZM+vtlauHKmEsoFAa25t5YkbzNoYM2JXQLnHQZcKnpufY8iCkE9GrWJ8g61KF9V DNxcEADzyU9XfneHCeyPWzjWcQL6+BxFNJ3Hj8CEdHQnlu23i+vnrXcO3QOWrIMrFb47 WcfLsqYEnwVmi4VaHp5ZSkAuZlZvMoTiPOuZsb8MGTvv/CBRutZrWEnq6m0MF7W7WVIU 5tQw== X-Gm-Message-State: APjAAAVx0fXPePlmIEqxpSntOr5Gva6fTDFBkehEkBCP/oVX+M9fDfIj thEd3J+K9wcHEPc8CbR61Q== X-Received: by 2002:aca:ef85:: with SMTP id n127mr4771640oih.42.1571340279227; Thu, 17 Oct 2019 12:24:39 -0700 (PDT) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id s6sm818858otr.5.2019.10.17.12.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 12:24:38 -0700 (PDT) Date: Thu, 17 Oct 2019 14:24:37 -0500 From: Rob Herring To: Chris Packham Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com, mark.rutland@arm.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] dt-bindings: gpio: brcm: Add bindings for xgs-iproc Message-ID: <20191017192437.GA24080@bogus> References: <20191017031051.20366-1-chris.packham@alliedtelesis.co.nz> <20191017031051.20366-2-chris.packham@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191017031051.20366-2-chris.packham@alliedtelesis.co.nz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 17, 2019 at 04:10:50PM +1300, Chris Packham wrote: > This GPIO controller is present on a number of Broadcom switch ASICs > with integrated SoCs. It is similar to the nsp-gpio and iproc-gpio > blocks but different enough to require a separate driver. > > Signed-off-by: Chris Packham > --- > > Notes: > Changes in v2: > - Document as DT schema > - Include ngpios, #gpio-cells and gpio-controller properties > > .../bindings/gpio/brcm,xgs-iproc.yaml | 83 +++++++++++++++++++ > 1 file changed, 83 insertions(+) > create mode 100644 Documentation/devicetree/bindings/gpio/brcm,xgs-iproc.yaml > > diff --git a/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc.yaml b/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc.yaml > new file mode 100644 > index 000000000000..71998551209e > --- /dev/null > +++ b/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc.yaml > @@ -0,0 +1,83 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/gpio/brcm,xgs-iproc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Broadcom XGS iProc GPIO controller > + > +maintainers: > + - Chris Packham > + > +description: | > + This controller is the Chip Common A GPIO present on a number of Broadcom > + switch ASICs with integrated SoCs. > + > +properties: > + compatible: > + enum: > + - brcm,iproc-gpio-cca enum vs. const usage depends on whether you think you'll add more compatibles. > + > + reg: > + minItems: 2 > + maxItems: 2 > + description: > + The first region defines the base I/O address containing > + the GPIO controller registers. The second region defines > + the I/O address containing the Chip Common A interrupt > + registers. items: - description: the I/O address containing the GPIO controller registers - description: the I/O address containing the Chip Common A interrupt registers And minItems/maxItems can be implicit. > + > + gpio-controller: true > + > + '#gpio-cells': > + const: 2 > + > + ngpios: > + $ref: /schemas/types.yaml#/definitions/uint32 Common property, doesn't need a type definition. Also, it would have to be under an 'allOf' to actually work. > + minimum: 0 > + maximum: 32 > + > + interrupt-controller: > + type: boolean Just 'interrupt-controller: true' > + > + '#interrupt-cells': > + const: 2 > + > + interrupts: > + maxItems: 1 > + > +required: > + - compatible > + - reg > + - "#gpio-cells" > + - gpio-controller > + > +allOf: > + - if: > + properties: > + interrupt-controller: > + contains: > + const: true > + then: > + required: > + - interrupts > + - '#interrupt-cells' This is mostly handled in the core schema already and 'dependencies' works better for this anyways. All you need here is: dependencies: interrupt-controller: [ interrupts ] > + > +examples: > + - | > + #include > + #include > + gpio@18000060 { > + compatible = "brcm,iproc-gpio-cca"; > + #gpio-cells = <2>; > + reg = <0x18000060 0x50>, > + <0x18000000 0x50>; > + ngpios = <12>; > + gpio-controller; > + interrupt-controller; > + #interrupt-cells = <2>; > + interrupts = ; > + }; > + > + > +... > -- > 2.23.0 >