Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1341632ybg; Fri, 18 Oct 2019 16:18:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNg8lS4YkY5nxmYvS5Oo1tt4h2cD6l5eKlesVJDVRUuSBk+2pH8F5gnlRxub+IbVtDsz/x X-Received: by 2002:a17:906:6858:: with SMTP id a24mr11520209ejs.27.1571440731335; Fri, 18 Oct 2019 16:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571440731; cv=none; d=google.com; s=arc-20160816; b=JAUeHmYTizbPOAdrIEootGvVuZE8dxJRm4Z7Jd8wM+4SqHtTjVivT4o7EMFTgwVGGR FfKG6j67XGPvDY9oJ7Lx7+qvu7Am2Pn6L5bt1HZoOVezsEpquTk5j8GcSatwNXu2Jpzz MBPm+a8VEa2FS68GvGkmOh8bggjDyGdTuF3y0DT0Xm554x2HIuwDl6bb+FKRK9hv2AB2 ympVtEL8uGTrY1/eE+Ygah9AQorUASlbsc7/wtd92fHxZX1t3OMa5/bSH3J9g2rdCkv4 ZMq03ku2LgbXZ3YHDwEqz42OnRq4xebVNGALOWCm4vQnXYlbOkWCr5AmLaaufBENZjZA rnqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=UqfvRiIf/2+i2h/4Ujog5bIvchOk5tCgScNdijxQat0=; b=MA62dgXqVMLYORC2IXI5uF89JZ4PqylghSs4p7ggXneh6r/yNj8N9XA7rUWglYi2Sb zfN0lJ+HqKVONu/aqbdKZ6O/PS2qVzjBnrXoUNg/F5lNdVUGsp2d6Cd4upINWfN8TVZ9 9GCkXH9gdLasZcOKLjoZhaHXVmN12iDGD3bBLyFp31r91W6RJrmvnI9Jk4FhrWGDMf0o bb5TwfCPOBQaz3Nd2H9DwUA//0tkeXzVJspgG7bj3WaasKul1GV0zXU2orjf1JsksARG 5j0EFIihNVD2K7uvoFAukbzmep+0oSiUf1y/nlZnAUL7riTnb9BU7u05xqPlygN6OBHM KnuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=pYwivSRk; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d35si4716293ede.440.2019.10.18.16.18.28; Fri, 18 Oct 2019 16:18:51 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=pYwivSRk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392106AbfJRGAC (ORCPT + 99 others); Fri, 18 Oct 2019 02:00:02 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:36811 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388198AbfJRGAC (ORCPT ); Fri, 18 Oct 2019 02:00:02 -0400 Received: by mail-oi1-f193.google.com with SMTP id k20so4247485oih.3 for ; Thu, 17 Oct 2019 23:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=UqfvRiIf/2+i2h/4Ujog5bIvchOk5tCgScNdijxQat0=; b=pYwivSRkBCkHKIKFMDxSUQzYxZubKHj+eCQPph1DAVEMONHUi6BTkSvZFnrCvfLDxH V4OwguAODrasciR5IXTpPZ+z7pwLQDiwResq2ZCCpKPZ9gC9ReqObuK06qxyekoEAnkt Lin0M1x80JQOW86VzKE/a/V400dWUexZDggO72ItnaHM0dmXMfVd6xC6Wgn1BvHuCudQ +GULmOf7tQBP3UOhpQk3PQVJyZkQCwRxOjGivUuHXavq2ko60LD+eB6Rc+0/aL0XABBw ZHBPvTIj+om6O9AfsDy4rIhOHzfkZ4RgLtxOeN9hldC0DmH8GJoJBm56IH7+s1eU4WZH szjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=UqfvRiIf/2+i2h/4Ujog5bIvchOk5tCgScNdijxQat0=; b=iTgrIC6VykEgLKGCEmmGzuRe7my38FMSEx5OwgXZMtmUgC2weO6UujXk7JHy1tLYo8 +qEIHiU4X5060GcxezvL1GQFb/O/FWmQcT3ZMMDgh4tjriBWeZSUjR/2b42CC9n6OoEj vVPuhU8izIreyRtaGrg4FJgxlZnunXlNytUKzBVOV5n/gENQzzZl93Pz3fwt5CPhYihB plgLpeFUTTBw7VwnqwscsvsHh6FpJXIHYIYRfZ14yV7b4y6wYPgS3rFBUlqxT+MPZJAU h8/s3Wn/Gm1Bx0687fU9LW6t3FPtIrku4sSO+AfubTokUfFjZ63VOZjoYW4whLFNmniD 7Jtw== X-Gm-Message-State: APjAAAXwplf/d4VDtCHAxXsKyZOPDSdgCnm2IHUQPb/b5dkiQcKxwhFh 9TaWeuuBlfTOAkzN/7XXV9dAG+UkTNBSQCCpPkwdVQ== X-Received: by 2002:a54:4e83:: with SMTP id c3mr6575837oiy.170.1571378401053; Thu, 17 Oct 2019 23:00:01 -0700 (PDT) MIME-Version: 1.0 References: <20191017031051.20366-1-chris.packham@alliedtelesis.co.nz> <20191017031051.20366-2-chris.packham@alliedtelesis.co.nz> <20191017192437.GA24080@bogus> In-Reply-To: <20191017192437.GA24080@bogus> From: Bartosz Golaszewski Date: Fri, 18 Oct 2019 07:59:50 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] dt-bindings: gpio: brcm: Add bindings for xgs-iproc To: Rob Herring Cc: Chris Packham , Linus Walleij , Mark Rutland , rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, linux-gpio , linux-devicetree , arm-soc , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org czw., 17 pa=C5=BA 2019 o 21:24 Rob Herring napisa=C5=82(a= ): > > 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-ipr= oc.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 Bro= adcom > > + 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. > What if you don't know yet? For instance we use a const compatible and then a new chip is released for which we can reuse the driver? Is this something that is expected to remain stable in the binding document? The question is unrelated to this patch, I'm just unsure about my own approach to writing yaml bindings. Bart > > + > > + 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 =3D "brcm,iproc-gpio-cca"; > > + #gpio-cells =3D <2>; > > + reg =3D <0x18000060 0x50>, > > + <0x18000000 0x50>; > > + ngpios =3D <12>; > > + gpio-controller; > > + interrupt-controller; > > + #interrupt-cells =3D <2>; > > + interrupts =3D ; > > + }; > > + > > + > > +... > > -- > > 2.23.0 > >