Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2168086pja; Thu, 26 Mar 2020 10:45:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuQcJ3mufJTLuvfN9COp+taVXYUl+uD7I2DMqe8IxYXTszpTpVvFbwI0/Goum1G2/186dog X-Received: by 2002:aca:cc41:: with SMTP id c62mr1047971oig.58.1585244704762; Thu, 26 Mar 2020 10:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585244704; cv=none; d=google.com; s=arc-20160816; b=ifIysroVcY6Vx1XRKcBCFo1vvRSLTuEsxV7UIzd2ND5beGj9mqfWv/Fc6DlYXb+IE9 dx6MpeDv28DFjG0Fjene0i8a9KfPKmoMVCQbS7X4R0a5sp4VIz0y7nu/QjAy/ycmcoH3 rp2rMwUCKCNFwhOQc3UUQbEw70OPZ8365m3u8bmnlEgDTT1/l5iFTiaP7ioCY0RGBJxz /KFXO+2bYo/nK5d5Bd5GXvmh6ISkWB5ijcGeUlgrqMn/AE/7NaWzz7+W7/epslLIJtX1 iEbj3sGgoJ5BbRI18GAILNlCNCE6hvDGHRYwZw+bQSCT9vh+I/WV0dCsEN7zUuqMcPnQ uFYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=13ZGsP4Smsi4/yTbSqCm3nuQPphS0KG0zKpYJaAABP4=; b=Owew7om0POLdEy//OHiBWVlFJEkokXV2Kiqn/tscJIUuiCSKksjTSn/xFfVwvvlajY v0pK58iKIVydVfR5PNk385JjnnW4L3ldL675RgAx3sD+f4Nqo7T/i+gVyV7RXpy/TSZg L7Qz1ywT6clPN33IHv7PAqAPn5FKLJ5Q3+aOZoH0V/CCtIvyi/obkWB9H0amIPOwMWCK 4xysU823pKv5mqBNO2ojP8KWDscpgULsfN9k4uWM2EOZgLM9eK4kQJtNpjncjJ93lwdt k9W5xFDXlTKCz7nNTlKLiFdjw5M6Xm1sota02CTe+OkfydugJy9RQ+ndzJQu7f6bZI+3 G5eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xNILAGIv; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si1443729oth.1.2020.03.26.10.44.50; Thu, 26 Mar 2020 10:45: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=@kernel.org header.s=default header.b=xNILAGIv; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727989AbgCZRnn (ORCPT + 99 others); Thu, 26 Mar 2020 13:43:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:45004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726260AbgCZRnn (ORCPT ); Thu, 26 Mar 2020 13:43:43 -0400 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 857AD2076A; Thu, 26 Mar 2020 17:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585244622; bh=TtDZckahdL5AL8VJ+LexPxv3PKEAendO/YOSxSYS9hI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=xNILAGIv5MuMdSImancNklOv7SOyS09TkRoRiqaH6rObrD0NBNlnNVxSbsVmW6nbt DwVSGNl2I4fwZHC0E7oY7mCl1azh3XoyyRjc/IxH/eLjV+6qn01+qnKf6++syYTbrt CQIQy8HjiKmP/U6T9WVpgsZLO2Lf7bs6yAGt8ATE= Received: by mail-qk1-f169.google.com with SMTP id l25so7656082qki.7; Thu, 26 Mar 2020 10:43:42 -0700 (PDT) X-Gm-Message-State: ANhLgQ3QNAzxNtQ0+dmwNKlOk260F2gqmSulqjV2/bm6Yl4uOAQeu+LQ 2XFMWfg6i9Wlf5qRtC1XyO0GPc/A2EgDCWN6cw== X-Received: by 2002:a37:634d:: with SMTP id x74mr9617823qkb.254.1585244621536; Thu, 26 Mar 2020 10:43:41 -0700 (PDT) MIME-Version: 1.0 References: <1585128694-13881-1-git-send-email-hanks.chen@mediatek.com> <1585128694-13881-2-git-send-email-hanks.chen@mediatek.com> In-Reply-To: <1585128694-13881-2-git-send-email-hanks.chen@mediatek.com> From: Rob Herring Date: Thu, 26 Mar 2020 11:43:27 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 1/6] dt-bindings: pinctrl: add bindings for MediaTek MT6779 SoC To: Hanks Chen Cc: Linus Walleij , Mark Rutland , Matthias Brugger , Sean Wang , Andy Teng , "linux-kernel@vger.kernel.org" , "moderated list:ARM/Mediatek SoC support" , devicetree@vger.kernel.org, wsd_upstream Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 25, 2020 at 3:31 AM Hanks Chen wrote: > > From: Andy Teng > > Add devicetree bindings for MediaTek MT6779 pinctrl driver. > > Signed-off-by: Andy Teng > --- > .../bindings/pinctrl/mediatek,mt6779-pinctrl.yaml | 208 ++++++++++++++++++++ > 1 file changed, 208 insertions(+) > create mode 100644 Documentation/devicetree/bindings/pinctrl/mediatek,mt6779-pinctrl.yaml The header belongs in this patch so that 'make dt_binding_check' works. > > diff --git a/Documentation/devicetree/bindings/pinctrl/mediatek,mt6779-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/mediatek,mt6779-pinctrl.yaml > new file mode 100644 > index 0000000..5f9bbf1 > --- /dev/null > +++ b/Documentation/devicetree/bindings/pinctrl/mediatek,mt6779-pinctrl.yaml > @@ -0,0 +1,208 @@ > +# SPDX-License-Identifier: GPL-2.0 > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/pinctrl/mediatek,mt6779-pinctrl.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Mediatek MT6779 Pin Controller Device Tree Bindings > + > +maintainers: > + - Andy Teng > + > +description: |+ > + The pin controller node should be the child of a syscon node with the > + required property: > + - compatible: "syscon" > + > +properties: > + compatible: > + const: mediatek,mt6779-pinctrl > + > + reg: > + minItems: 9 > + maxItems: 9 > + description: | > + physical address base for gpio-related control registers. > + > + reg-names: > + description: | > + GPIO base register names. Need to define what the names are and the order. > + > + gpio-controller: true > + > + "#gpio-cells": > + const: 2 > + description: | > + 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: > + minItems: 1 > + maxItems: 5 > + description: | > + GPIO valid number range. > + > + interrupt-controller: true > + > + interrupts: > + minItems: 1 > + maxItems: 4 Need to define what the interrupts are. > + description: | > + The interrupt outputs to sysirq. > + > + "#interrupt-cells": > + const: 2 > + > +required: > + - compatible > + - reg > + - reg-names > + - gpio-controller > + - "#gpio-cells" > + - gpio-ranges > + - interrupt-controller > + - interrupts > + - "#interrupt-cells" > + > +patternProperties: > + '^pins*$': '-pins$' would be preferred. > + type: object > + description: | > + 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. > + > + properties: > + pinmux: There's a common schema for all these properties. You need to reference it (with $ref) and only define which properties you are using and any additional constraints. > + description: > + 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. > + allOf: > + - $ref: /schemas/types.yaml#/definitions/uint32-array > + bias-disable: > + type: boolean > + > + bias-pull-up: > + oneOf: > + - type: boolean > + - $ref: /schemas/types.yaml#/definitions/uint32 > + > + bias-pull-down: > + oneOf: > + - type: boolean > + - $ref: /schemas/types.yaml#/definitions/uint32 > + > + input-enable: > + type: boolean > + > + input-disable: > + type: boolean > + > + output-low: > + type: boolean > + > + output-high: > + type: boolean > + > + input-schmitt-enable: > + type: boolean > + > + input-schmitt-disable: > + type: boolean > + > + mediatek,pull-up-adv: > + description: | > + Pull up setings for 2 pull resistors, R0 and R1. User can > + configure those special pins. Valid arguments are described as below: > + 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disable. > + 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. > + 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. > + 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. > + allOf: > + - $ref: /schemas/types.yaml#/definitions/uint32 > + - enum: [0, 1, 2, 3] > + > + mediatek,pull-down-adv: > + description: | > + Pull down settings for 2 pull resistors, R0 and R1. User can > + configure those special pins. Valid arguments are described as below: > + 0: (R1, R0) = (0, 0) which means R1 disabled and R0 disable. > + 1: (R1, R0) = (0, 1) which means R1 disabled and R0 enabled. > + 2: (R1, R0) = (1, 0) which means R1 enabled and R0 disabled. > + 3: (R1, R0) = (1, 1) which means R1 enabled and R0 enabled. > + allOf: > + - $ref: /schemas/types.yaml#/definitions/uint32 > + - enum: [0, 1, 2, 3] > + > + drive-strength: > + description: | > + Selects the drive strength for the specified pins in mA. > + allOf: > + - $ref: /schemas/types.yaml#/definitions/uint32 > + - enum: [2, 4, 6, 8, 10, 12, 14, 16] > + > + required: > + - pinmux Add: additionalProperties: false additionalProperties: false > + > +examples: > + - | > + #include > + #include > + #include > + > + pio: pinctrl@10005000 { > + compatible = "mediatek,mt6779-pinctrl"; > + reg = <0 0x10005000 0 0x1000>, > + <0 0x11c20000 0 0x1000>, > + <0 0x11d10000 0 0x1000>, > + <0 0x11e20000 0 0x1000>, > + <0 0x11e70000 0 0x1000>, > + <0 0x11ea0000 0 0x1000>, > + <0 0x11f20000 0 0x1000>, > + <0 0x11f30000 0 0x1000>, > + <0 0x1000b000 0 0x1000>; > + reg-names = "gpio", "iocfg_rm", > + "iocfg_br", "iocfg_lm", > + "iocfg_lb", "iocfg_rt", > + "iocfg_lt", "iocfg_tl", > + "eint"; > + gpio-controller; > + #gpio-cells = <2>; > + gpio-ranges = <&pio 0 0 210>; > + interrupt-controller; > + #interrupt-cells = <2>; > + interrupts = ; > + > + mmc0_pins_default: mmc0default { > + pins_cmd_dat { The 2 levels of nodes here doesn't match your schema. Also, don't use '_' in node names. > + pinmux = , > + , > + , > + , > + , > + , > + , > + , > + ; > + input-enable; > + mediatek,pull-up-adv = <1>; > + }; > + pins_clk { > + pinmux = ; > + mediatek,pull-down-adv = <2>; > + }; > + pins_rst { > + pinmux = ; > + mediatek,pull-up-adv = <0>; > + }; > + }; > + > + mmc0 { > + pinctrl-0 = <&mmc0_pins_default>; > + pinctrl-names = "default"; > + }; > + }; > + > -- > 1.7.9.5