Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp128322imm; Tue, 28 Aug 2018 18:04:46 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbtox+/F2EWV0wioagWZPWVEVnxJsK2pQ05chWOZmJWw28kH+u3FUVn3jhhHS5ZCieY7Jbs X-Received: by 2002:a65:6110:: with SMTP id z16-v6mr3751429pgu.412.1535504686490; Tue, 28 Aug 2018 18:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535504686; cv=none; d=google.com; s=arc-20160816; b=NwPlPALkyU3og4jASR1jqoSOUqLM6eO5jfMdUqYXO+wtuV17P0vNG1uypakdkx9/1G ixyu6tL3lRsw0S0TKjWRd+96GKTO+ro3bIBROdvJWjCMAnWBiRVXRDZG8rnjzUb9sfqA T/IULk1q9OuXOGaM2a8ahTc82IxKU5nF9vyGiQJLtn+75uCPnSVuWp8otGORQNwijuZA UlzVB7RKtoTTxGG+U1JVas63puzQcFyrJ+zDsYGfm0+C2k7OaiFvG3UU9QFu1w0ynOI5 GT5reBiCJj6IrA4UIrTMYOkeHLtsPOjarvx5hzFeNrqp5FFwj5KgVwHAWM7scEk0ULu8 Ysvg== 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:arc-authentication-results; bh=6u5pDWncMuuXcSOYA63+Yybt7J38Dq56BpU3SX9IL/g=; b=JneNGUHIYjWTmEnu/WN8ilxApAbU0Vs9nxTz1lOTfXeUXpO8+d1wUezmEuYN18xwtw RDaSZDu3GhE3gmi3N1eTkJrR9ADDYUgLah/QZn45CGcu6WKReQEqnbrg6ge2SkxFtLAs UMdB3zo3R9tFLU9G0/3psyeoFLuULpvxTL1B5b2Pyxh516LRpoumFMvPyS4LM+Y9QT3D MGVfkduu+12kXUm+Dd7HFLx3kv2ey3d6SmwTHXTqjkwRxWq+IV1POxhjC6fXE6z85f5a RQWN3mwdXFnDM65dMvaFxDgjdfz8Wt9ayGtYcZT8xLijinV+HaDZpKag1bJOOMnzQeB9 +sug== 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 bd6-v6si2214096plb.265.2018.08.28.18.04.19; Tue, 28 Aug 2018 18:04:46 -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 S1727088AbeH2E4s (ORCPT + 99 others); Wed, 29 Aug 2018 00:56:48 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:40708 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725723AbeH2E4s (ORCPT ); Wed, 29 Aug 2018 00:56:48 -0400 Received: by mail-oi0-f65.google.com with SMTP id l202-v6so6237158oig.7; Tue, 28 Aug 2018 18:02:32 -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=6u5pDWncMuuXcSOYA63+Yybt7J38Dq56BpU3SX9IL/g=; b=cfIAUrDz2YyRcQxOX+QY9XBURnLgzdgyMOOuXsXZO/qsPItkoCwsuRIVuIebKJoDSU GjLxnDS8J3oWUFQOxSqqjjTRFaid0jmHVJEGHSQVjE/hAKJZdyYOTg+mNQSYJ12ZweSG wRsU0yQxNFB4+jxeIMWKHwoUnxNl0QGkLkQWlrzlwATeBOViG1CnUkW9/r0dY8qwh6V3 MtfCJWBg4xjhV+w5TlQSrsuLN6zuGa7w4Cphily0/ozb0noQ1Y9EdILHZmMIxXDNXAmA 8y3nLLGzeZesnwIKK64CsHzBcZySzodVY9o7M04CMFo55OJk8yb9+X5Bd0FlivTbudST RjJQ== X-Gm-Message-State: APzg51CRbLy2qe3VWp8PakXXBNaVTGfES42IT7eIxetW60WdoKQZgrAv nainSih/eqsobcyOtVVulFHNd1JfSQ== X-Received: by 2002:aca:c34b:: with SMTP id t72-v6mr608711oif.338.1535504551853; Tue, 28 Aug 2018 18:02:31 -0700 (PDT) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id w84-v6sm2435131oie.40.2018.08.28.18.02.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Aug 2018 18:02:30 -0700 (PDT) Date: Tue, 28 Aug 2018 20:02:30 -0500 From: Rob Herring To: Eugeniy Paltsev Cc: linux-snps-arc@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet Gupta , Alexey Brodkin , Linus Walleij , devicetree@vger.kernel.org, Mark Rutland Subject: Re: [PATCH v2 2/2] dt-bindings: Document the Synopsys GPIO via CREG bindings Message-ID: <20180829010230.GA16393@bogus> References: <20180828112721.28178-1-Eugeniy.Paltsev@synopsys.com> <20180828112721.28178-3-Eugeniy.Paltsev@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180828112721.28178-3-Eugeniy.Paltsev@synopsys.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 28, 2018 at 02:27:21PM +0300, Eugeniy Paltsev wrote: > This patch adds documentation of device tree bindings for the Synopsys > GPIO via CREG driver. > > Signed-off-by: Eugeniy Paltsev > --- > .../devicetree/bindings/gpio/snps,creg-gpio.txt | 49 ++++++++++++++++++++++ > 1 file changed, 49 insertions(+) > create mode 100644 Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt > > diff --git a/Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt b/Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt > new file mode 100644 > index 000000000000..eb022d44ccda > --- /dev/null > +++ b/Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt > @@ -0,0 +1,49 @@ > +GPIO via CREG (Control REGisers) driver REGisters? Bindings don't describe drivers. > + > +This is is single-register MMIO GPIO driver to control such strangely mapped > +outputs: > + > +31 11 8 7 5 0 < bit number > +| | | | | | > +[ not used | gpio-1 | shift-1 | gpio-0 | shift-0 ] < 32 bit MMIO register > + ^ ^ > + | | > + | write 0x2 == set output to "1" (on) > + | write 0x3 == set output to "0" (off) > + | > + write 0x1 == set output to "1" (on) > + write 0x4 == set output to "0" (off) What kind of crazy h/w designer designed this? > +Required properties: > +- compatible : "snps,creg-gpio" > +- reg : Exactly one register range with length 0x4. > +- #gpio-cells : Should be one - the pin number. > +- gpio-controller : Marks the device node as a GPIO controller. > +- snps,ngpios: Number of GPIO pins. > +- snps,bit-per-line: Number of bits per each gpio line (see picture). > + Array the size of "snps,ngpios" > +- snps,shift: Shift (in bits) of the each GPIO field from the previous one in > + register (see picture). Array the size of "snps,ngpios" > +- snps,on-val: Value should be set in corresponding field to set > + output to "1" (see picture). Array the size of "snps,ngpios" > +- snps,off-val: Value should be set in corresponding field to set > + output to "0" (see picture). Array the size of "snps,ngpios" Convince me we need to parameterize all this. We try to avoid describing h/w like this. > + > +Optional properties: > +- snps,default-val: default output field values. Array the size of "snps,ngpios" > + > +Example (see picture): > + > +gpio: gpio@f00014b0 { > + compatible = "snps,creg-gpio"; > + reg = <0xf00014b0 0x4>; > + gpio-controller; > + #gpio-cells = <1>; > + snps,ngpios = <2>; > + snps,shift = <5 1>; > + snps,bit-per-line = <2 3>; > + snps,on-val = <2 1>; > + snps,off-val = <3 4>; > + snps,default-val = <2 1>; > +}; > -- > 2.14.4 >