Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1833169imm; Thu, 23 Aug 2018 09:28:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxDFK7tbA6EmMS4cGuO/RWyBiKlLdU2s6N1RpCWpeZ0HxY77atFBI0WYGUiOWTPrYgg8yfz X-Received: by 2002:a17:902:4401:: with SMTP id k1-v6mr57597637pld.97.1535041715696; Thu, 23 Aug 2018 09:28:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535041715; cv=none; d=google.com; s=arc-20160816; b=FZOIBDe8/ijvx7bg6wBdmDTLAeuds7D9Sx53EC7+6yfHtRgxZY9IXiGG67Iplcm0e8 1FOJt3mHgk5bQNSiiKMFUFj/yxr+2ue/4DeLA2bchivZAcQM/1Z5+rLY9TaD5mOPCkGj LiuhUNdLUyWoMA5LRxuI45FATZMRXtoIuRIucKQpWz+b6L61++VeU4+8xVWwGdCoUT2q YyfnbTUpNwTNJgxt6au6pqoAL5WSBvsjUsCjbsmCpqrIvJV/3ypg5YvSkwMTyytFQJnX N9aJ/vGmrEHJ7sQaHNfM3/yK/11VH18bQSNPgPFPaYX9/HkwcXr0J60Vt/GF5tEsJieK gpAA== 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=nsewRARmzWwB7pFW1Oo3pk5rfx99Zzsy5VvQ/1Bm7S4=; b=vKq6/Wgh4zJ+bjEKp1TaLh9otax+4tUlUVyB/EIQZ3akCrskAlX4JdVMZbNuJ1zIZS G1rt1jAiL4+hN8flsqlElR2o+29PUaYez8k5aOcd2YTTjB8VKUQIlgMSjiMaySnx85nx A16JOmrpTPq1JoNoHQc6B/g/f7N0rnRUBRuGQ6Tgf60Dov3nDiPJuYIgxbSjGHDSRqh9 rZ6rCNS0YvRSe1KmBMnQcF8akpNJqSrdph9SASjg4a/vQjsDkWR7PapBD+gyXZ8VpoOB 85XQhjXeqjf93NfFtWSDIXOrTct0WKr9txmqtu3nYGnnJ0y7InqffZtYcBDFpLuCxhvq 2Crw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=BcWzwgag; 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 i5-v6si4165017pgc.607.2018.08.23.09.28.20; Thu, 23 Aug 2018 09:28:35 -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=BcWzwgag; 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 S1732984AbeHWSae (ORCPT + 99 others); Thu, 23 Aug 2018 14:30:34 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:39072 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732888AbeHWSad (ORCPT ); Thu, 23 Aug 2018 14:30:33 -0400 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id CA77824E211F; Thu, 23 Aug 2018 08:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1535036430; bh=Zu+VO24t76cGohiWONUfkPZiz3vmckx2AlPcPdKR490=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BcWzwgagtmGd6h/0l9TSl1lSE3byuoxHOxLQUbc07kKWzesXlpV5Rk03AIL2Kxxt4 DRtywGDuZmFyLwmDUhnsnCvn5e+cMXA+2n6tll4vJ8C/aSvCXTpHOyP0Zpq2/1Dcsq YgYUrPhtBhK8lgjCYDqS7TFkdgB7j5y9yLPDevAZ/0JKp7JZi7ocHYwZKX1mHiEPmV WMYZOreEdwwfx1MDI0qWPxpEmhqMWJg7Lq8zBGsH4FP8Mb9ufMAd14gtb18ruXUAr4 dIUCUSnAfG3i8d51s7qrrT7XUeZ2FGDRuF9VnxG4+G2GxtDjSNw3IRfniq7AvwBuxi k99ARUur2bD+w== Received: from paltsev-e7480.internal.synopsys.com (paltsev-e7480.internal.synopsys.com [10.121.3.36]) by mailhost.synopsys.com (Postfix) with ESMTP id F3F423FF7; Thu, 23 Aug 2018 08:00:27 -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 2/2] dt-bindings: Document the Synopsys GPIO via CREG bindings Date: Thu, 23 Aug 2018 18:00:13 +0300 Message-Id: <20180823150013.21837-3-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180823150013.21837-1-Eugeniy.Paltsev@synopsys.com> References: <20180823150013.21837-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 | 48 ++++++++++++++++++++++ 1 file changed, 48 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..2ab1b49eee7b --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/snps,creg-gpio.txt @@ -0,0 +1,48 @@ +GPIO via CREG (Control REGisers) driver + +To control such strangely mapped MMIO 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