Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6973994imm; Tue, 28 Aug 2018 04:29:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYmxcwaeZTSeLo6fcYqfak8yyO/ujpQLwUuaNKTM3up/3axgrHpAKfgCj49AOavLKEQ7Pug X-Received: by 2002:a63:ad44:: with SMTP id y4-v6mr1138972pgo.138.1535455744501; Tue, 28 Aug 2018 04:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535455744; cv=none; d=google.com; s=arc-20160816; b=0HflJp/cIvU4Hp7gMyBuXpxmUPFvzVjA6kMp85FZI5CP7bMULLzN+rlzh3B6JQBFFM AxfEJNzypezRSCXe3xAU2Ne36NTO6fY1FTnVlROfnyj1xlQKs3xVhUdYKeVxfFnQ/6W7 mgFQzSLJdqk4pEU7Q1YfTI+ErIs+wkUeOrCGa8qonFs0xd8Q8MxdkZv1tWS83y4PLwL3 nDDealtSTtJ4NoT7fS+Ri0Fam96eOzcg4oa3X7or39o2lHED+4lp4PzKCxvxvdp12vXt t0Ml3d1Uq0MUcDkYKHrkWSNt57k0RyvdNVfLiiuvvpL4kPvuhphegWJnjaAmr7fV+XkB ms2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=b8UtsSAOnrdENYaOXqv8I5lMqBX2476qyaJOgMg91hU=; b=W6xrwKXpexlCW0r6nUqt8P4puD6IY+MSr63S5uzxlveMRaZNZHKAsBn1/Z9ZpfiMS7 y2XWsHmy+j9kLQ/ajLL/TmE2YcBSIWxwsU9CjrwM5xL5IPYS3V3CAl7avivAdtEZ6e28 zD3jWWA4FWIfv0r7sZa85jHSXzcd+EY/vyFHC3BIOZsizPV/sOV7PMpZ1K86t2cbDAWR z39IbRDZbCHAVlj13DimG2nCEdpOEFfLM+lGfQkzVcnJFSJ90vk/ntXz/AFHxoWl4sgo EIfLBbp3/O6ql1iTz2D4GcLOWqSrRV8pCoZGaAfNJ3wE4Yu/8OqIk0NgctYl1fszVsvJ VRcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b="f+oAl/7Z"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n17-v6si730457pgh.501.2018.08.28.04.28.49; Tue, 28 Aug 2018 04:29:04 -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=@synopsys.com header.s=mail header.b="f+oAl/7Z"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727853AbeH1PSt (ORCPT + 99 others); Tue, 28 Aug 2018 11:18:49 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:33122 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbeH1PSt (ORCPT ); Tue, 28 Aug 2018 11:18:49 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 142BC24E2598; Tue, 28 Aug 2018 04:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1535455657; bh=nlHR5D9N0EP7Cw5Ci8HFhXlgGh7tq+qO1ECUGsO5mss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f+oAl/7ZUX54nl568hhRKYAVUohQMkEPM4YXzuxB9Wt8NLPxYTU3PqOJfWGyi5uSB mSkiYHiAaZJQwIhcqTi+tLCLuuu3UcLJCvP6rwUmUo1BORSg0Jzt9sLqh1fTbTY73P +LoG8u7Qexa3kvsOLlYVZTMMPg7ESdehX+HFGYx+KY2hnDdsudtcZf1TISPdnxU4ay qgeuJHpuewKNmC8PJsDSHa3G8PXWfHXuf99fh3X7x6IDms6CUTusDvQD3l+qjR7HKq GLxrXKG5R4K2hlFWfaPRqbYbHUyqtZ9Ehh3n0ylyBTz65jztl45m2zNsvIhZ6Z4v3D j1J21zREwglTw== Received: from paltsev-e7480.internal.synopsys.com (paltsev-e7480.internal.synopsys.com [10.121.3.36]) by mailhost.synopsys.com (Postfix) with ESMTP id 2C02E502B; Tue, 28 Aug 2018 04:27:32 -0700 (PDT) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org, linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Vineet Gupta , Alexey Brodkin , Linus Walleij , Rob Herring , devicetree@vger.kernel.org, Mark Rutland , Eugeniy Paltsev Subject: [PATCH v2 2/2] dt-bindings: Document the Synopsys GPIO via CREG bindings Date: Tue, 28 Aug 2018 14:27:21 +0300 Message-Id: <20180828112721.28178-3-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180828112721.28178-1-Eugeniy.Paltsev@synopsys.com> References: <20180828112721.28178-1-Eugeniy.Paltsev@synopsys.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 + +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) + + +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" + +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