From patchwork Tue Nov 11 12:38:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongzhou Yang X-Patchwork-Id: 5274121 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DE229C11AC for ; Tue, 11 Nov 2014 12:42:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EFC09200E7 for ; Tue, 11 Nov 2014 12:42:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11252200DF for ; Tue, 11 Nov 2014 12:42:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XoAjV-00051p-5l; Tue, 11 Nov 2014 12:39:41 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XoAjN-00050C-Im for linux-arm-kernel@lists.infradead.org; Tue, 11 Nov 2014 12:39:34 +0000 X-Listener-Flag: 11101 Received: from mtkhts07.mediatek.inc [(172.21.101.69)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1496911629; Tue, 11 Nov 2014 20:39:13 +0800 Received: from mhfsdcap03.mhfswrd (10.17.3.153) by mtkhts07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 14.3.181.6; Tue, 11 Nov 2014 20:39:13 +0800 From: Hongzhou Yang To: Rob Herring , Linus Walleij , Matthias Brugger Subject: [PATCH v3 2/3] dt-bindings: Add pinctrl bindings for mt65xx/mt81xx. Date: Tue, 11 Nov 2014 20:38:54 +0800 Message-ID: <1415709535-31515-3-git-send-email-hongzhou.yang@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1415709535-31515-1-git-send-email-hongzhou.yang@mediatek.com> References: <1415709535-31515-1-git-send-email-hongzhou.yang@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141111_043934_041191_6C0E0B6B X-CRM114-Status: GOOD ( 11.82 ) X-Spam-Score: 1.3 (+) Cc: Mark Rutland , devicetree@vger.kernel.org, Vladimir Murzin , Russell King , =?UTF-8?q?Heiko=20St=FCbner?= , Pawel Moll , Ian Campbell , Hongzhou Yang , Catalin Marinas , dandan.he@mediatek.com, linux-kernel@vger.kernel.org, alan.cheng@mediatek.com, Ashwin Chaugule , toby.liu@mediatek.com, Sascha Hauer , Kumar Gala , Grant Likely , "Joe.C" , eddie.huang@mediatek.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hongzhou Yang Add devicetree bindings for Mediatek SoC pinctrl driver. Signed-off-by: Hongzhou Yang --- .../devicetree/bindings/pinctrl/pinctrl-mt65xx.txt | 123 +++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt new file mode 100644 index 0000000..70f35b8 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt65xx.txt @@ -0,0 +1,123 @@ +* Mediatek MT65XX Pin Controller + +The Mediatek's Pin controller is used to control GPIO pins. + +Required properties: +- compatible: value should be either of the following. + (a) "mediatek,mt8135-pinctrl", compatible with mt8135 pinctrl. +- mediatek,pctl-regmap: Should be a phandle of the syscfg node. +- gpio-controller : Marks the device node as a gpio controller. +- #gpio-cells: number of cells in GPIO specifier. Since the generic GPIO + binding is used, the amount of cells must be specified as 2. See the below + mentioned gpio binding representation for description of particular cells. + + Eg: <&pio 6 0> + <[phandle of the gpio controller node] + [pin number within the gpio controller] + [flags]> + + Values for gpio specifier: + - Pin number: is a value between 0 to 202. + - Flags: bit field of flags, as defined in . + Only the following flags are supported: + 0 - GPIO_ACTIVE_HIGH + 1 - GPIO_ACTIVE_LOW + +Please refer to pinctrl-bindings.txt in this directory for details of the +common pinctrl bindings used by client devices. + +A pinctrl node should contain at least one subnodes representing the +pinctrl groups available on the machine. Each subnode will list the +pins it needs, and how they should be configured, with regard to muxer +configuration, pullups, drive strngth, input enable/disable and input schmitt. + +Required subnode-properties: + +- mediatek,pins: 2 integers array, represents gpio pinmux number and config + setting. The format as following + + node { + mediatek,pins = ; + GENERIC_PINCONFIG; + }; + + The PIN_NUMBER_PINMUX is combination of GPIO number and pinmux, it can + use macros which already defind in boot/dts/mt8135-pinfunc.h directly. + The GENERIC_PINCONFIG is the generic pinconfig options to use, bias-disable, + bias-pull-down, bias-pull-up, input-enable, input-disable, output-low, output-high, + input-schmitt-enable and input-schmitt-disable are valid. + +Examples: + +#include "mt8135-pinfunc.h" + +... +{ + syscfg_pctl_a: syscfg_pctl_a@10005000 { + compatible = "mediatek,mt8135-pctl-a-syscfg", "syscon"; + reg = <0 0x10005000 0 0x1000>; + }; + + syscfg_pctl_b: syscfg_pctl_b@1020C020 { + compatible = "mediatek,mt8135-pctl-b-syscfg", "syscon"; + reg = <0 0x1020C020 0 0x1000>; + }; + + pinctrl@01c20800 { + compatible = "mediatek,mt8135-pinctrl"; + mediatek,pctl-regmap = <&syscfg_pctl_a &syscfg_pctl_b>; + gpio-controller; + #gpio-cells = <2>; + + i2c0_pins_a: i2c0@0 { + pins1 { + mediatek,pins = , + ; + bias-disable; + }; + }; + + i2c1_pins_a: i2c1@0 { + pins { + mediatek,pins = , + ; + bias-pull-up = <55>; + }; + }; + + i2c2_pins_a: i2c2@0 { + pins1 { + mediatek,pins = ; + bias-pull-down; + }; + + pins2 { + mediatek,pins = ; + bias-pull-up; + }; + }; + + i2c3_pins_a: i2c3@0 { + pins1 { + mediatek,pins = , + ; + bias-pull-up = <55>; + }; + + pins2 { + mediatek,pins = , + ; + output-low; + bias-pull-up = <55>; + }; + + pins3 { + mediatek,pins = , + ; + drive-strength = <32>; + }; + }; + + ... + } +};