Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6858399imu; Thu, 31 Jan 2019 00:31:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN4R7muoEYZLbEGygAsqFU3VQ5uSs6EVGu3bXz3Swt0cWxfJGF2z1FnuvDA3KG4ofOqJo/2C X-Received: by 2002:a17:902:930b:: with SMTP id bc11mr34624784plb.17.1548923460607; Thu, 31 Jan 2019 00:31:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548923460; cv=none; d=google.com; s=arc-20160816; b=gVqtF1OgVznmEU26pk9O3SGeTYMV82k1OxpcdemmsMKEO1VQdJ+AhUYZ2/0WCng18S Eu3n2J4FDkYNW7GJ30Xbx2nW1e65MpaEAtdBu46q13P1v0xvqH/LmdXgbhB7OvrFC7KR cF6MAjlfym1CAh0dhYzKZcCc+5wqNH63eDGt7LjnFL8Ba7x25l79fnKa/zljpEB5yZym D2VSDjMNQU5cxWTNkveDAklkuBybGMqEkCqq7TxGtC6fFwJ/yxFWxfwGKnDi9hIp4GU4 6/ZSw+kAhHf550Q2FgJLb0479k7kOXn8EGVvl9EudruHBIFo+D3iqK3ixN+pCSA4yHcB yQZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=2rbIsPJF+IMDuv9hhDSE72kmwG4jnwbbL1UF9lvVMsE=; b=Nz4Vjz1AZ9mQRVEZ6S3nkgxtBpdk0uHVvi+a6HTOZgfLVhEbjrLez5UQP7M/3zsH6z kJz8ZITyEIk7W4gsmwqUbtj//6lp5kCBBd69NHBcNvZX7TbJThGhjki2kkrA2QEuurPD sdleQuj6RUwN2sZ/0EGdAWQtvHMyZyrdt7ObPmAFkbI18/BGwauo0y4asUJFBpLcV8QV EkYBLKkWgfuhWIPOjNezbkdR96vNhF8CT2F+7/Ajxw8bj5RxgAAQ53Jt0peyzl+XCXIV k30GgUzR/eY+v+zqkQ5C5UhH8jS0fLJ/jhCRYnzqUjapYLOA53FfjTCp2URaIW2L1a9n uE4A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u22si3819299pgh.286.2019.01.31.00.30.44; Thu, 31 Jan 2019 00:31:00 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731625AbfAaIac (ORCPT + 99 others); Thu, 31 Jan 2019 03:30:32 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:34386 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725855AbfAaIac (ORCPT ); Thu, 31 Jan 2019 03:30:32 -0500 X-UUID: 4065f1a1996e4b90a3a905abd93e9050-20190131 X-UUID: 4065f1a1996e4b90a3a905abd93e9050-20190131 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1817860604; Thu, 31 Jan 2019 16:30:26 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 31 Jan 2019 16:30:24 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 31 Jan 2019 16:30:22 +0800 Message-ID: <1548923422.4739.10.camel@mhfsdcap03> Subject: Re: [PATCH v6 5/6] dt-bindings: pinctrl: mt8183: add binding document From: Zhiyong Tao To: Rob Herring CC: Erin Lo , Matthias Brugger , Mark Rutland , "Thomas Gleixner" , Jason Cooper , "Marc Zyngier" , Greg Kroah-Hartman , Stephen Boyd , , srv_heupstream , , , , , , , , Date: Thu, 31 Jan 2019 16:30:22 +0800 In-Reply-To: <20190130161714.GA24352@bogus> References: <1548317240-44682-1-git-send-email-erin.lo@mediatek.com> <1548317240-44682-6-git-send-email-erin.lo@mediatek.com> <20190130161714.GA24352@bogus> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-TM-SNTS-SMTP: 0EB05CC0D78A45BC48B2B633DF2DCCA6FA80D1672525544E6236E08BF9CC55232000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-01-30 at 10:17 -0600, Rob Herring wrote: > On Thu, Jan 24, 2019 at 04:07:19PM +0800, Erin Lo wrote: > > From: Zhiyong Tao > > > > The commit adds mt8183 compatible node in binding document. > > > > Signed-off-by: Zhiyong Tao > > Signed-off-by: Erin Lo > > --- > > .../devicetree/bindings/pinctrl/pinctrl-mt8183.txt | 115 +++++++++++++++++++++ > > 1 file changed, 115 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/pinctrl/pinctrl-mt8183.txt > > > > diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8183.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8183.txt > > new file mode 100644 > > index 0000000..364e673 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-mt8183.txt > > @@ -0,0 +1,115 @@ > > +* Mediatek MT8183 Pin Controller > > + > > +The Mediatek's Pin controller is used to control SoC pins. > > + > > +Required properties: > > +- compatible: value should be one of the following. > > + "mediatek,mt8183-pinctrl", compatible with mt8183 pinctrl. > > +- 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. > > +- gpio-ranges : gpio valid number range. > > +- reg: physicall address base for gpio base registers. There are nine > > + physicall address base in mt8183. They are 0x10005000, 0x11F20000, > > Still have a typo in 'physicall' ==>sorry, we will change it in next version. > > > + 0x11E80000, 0x11E70000, 0x11E90000, 0x11D30000, 0x11D20000, 0x11C50000, > > + 0x11F30000. > > You don't need to list the address values. Only how many and what each > one is. ==>ok, because every base address don't have the detailed name. We will remove the address values list and change it like this: - reg: physical address base for gpio base registers. There are nine physical address base in mt8183. > > > + > > + Eg: <&pio 6 0> > > + <[phandle of the gpio controller node] > > + [line number within the gpio controller] > > + [flags]> > > + > > + Values for gpio specifier: > > + - Line 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 > > + > > +Optional properties: > > +- reg-names: gpio base register names. There are nine gpio base register > > + names in mt8183. They are "iocfg0", "iocfg1", "iocfg2", "iocfg3", "iocfg4", > > + "iocfg5", "iocfg6", "iocfg7", "iocfg8". > > As I said before, these names aren't useful. There's already > inheritently an index with 'reg'. > > Unless some are optional and can be sparsely populated. ==> Do you mean that we can remove Optional properties the reg-names description? > > > +- interrupt-controller: Marks the device node as an interrupt controller > > +- #interrupt-cells: Should be two. > > +- interrupts : The interrupt outputs from the controller. > > + > > +Please refer to pinctrl-bindings.txt in this directory for details of the > > +common pinctrl bindings used by client devices. > > + > > +Subnode format > > +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 strength, input enable/disable and input schmitt. > > + > > + node { > > + pinmux = ; > > + GENERIC_PINCONFIG; > > + }; > > + > > +Required properties: > > +- pinmux: integer array, represents gpio pin number and mux setting. > > + Supported pin number and mux varies for different SoCs, and are defined > > + as macros in boot/dts/-pinfunc.h directly. > > + > > +Optional properties: > > +- 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, input-schmitt-disable and drive-strength are valid. > > + > > + Some special pins have extra pull up strength, there are R0 and R1 pull-up > > + resistors available, but for user, it's only need to set R1R0 as 00, 01, 10 or 11. > > + So when config mediatek,pull-up-adv or mediatek,pull-down-adv, > > + it support arguments for those special pins. > > + > > + When config drive-strength, it can support some arguments, such as > > + MTK_DRIVE_4mA, MTK_DRIVE_6mA, etc. See dt-bindings/pinctrl/mt65xx.h. > > + > > +Examples: > > + > > +#include "mt8183-pinfunc.h" > > + > > +... > > +{ > > + pio: pinctrl@10005000 { > > + compatible = "mediatek,mt8183-pinctrl"; > > + reg = <0 0x10005000 0 0x1000>, > > + <0 0x11F20000 0 0x1000>, > > + <0 0x11E80000 0 0x1000>, > > + <0 0x11E70000 0 0x1000>, > > + <0 0x11E90000 0 0x1000>, > > + <0 0x11D30000 0 0x1000>, > > + <0 0x11D20000 0 0x1000>, > > + <0 0x11C50000 0 0x1000>, > > + <0 0x11F30000 0 0x1000>; > > Use lowercase hex. ==> we will change it in the next version. > > > + reg-names = "iocfg0", "iocfg1", "iocfg2", > > + "iocfg3", "iocfg4", "iocfg5", > > + "iocfg6", "iocfg7", "iocfg8"; > > + gpio-controller; > > + #gpio-cells = <2>; > > + gpio-ranges = <&pio 0 0 192>; > > + interrupt-controller; > > + interrupts = ; > > + interrupt-parent = <&gic>; > > + #interrupt-cells = <2>; > > + > > + i2c0_pins_a: i2c0 { > > + pins1 { > > + pinmux = , > > + ; > > + mediatek,pull-up-adv = <11>; > > + }; > > + }; > > + > > + i2c1_pins_a: i2c1 { > > + pins { > > + pinmux = , > > + ; > > + mediatek,pull-down-adv = <10>; > > + }; > > + }; > > + ... > > + }; > > +}; > > -- > > 1.9.1 > >