From patchwork Wed Oct 11 09:05:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacky Huang X-Patchwork-Id: 13416927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C90A2CD6E4F for ; Wed, 11 Oct 2023 09:05:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W15X2RcCjlgTHl0c/ep/HJDlFlFAPJiH4mJ/CB4sLE8=; b=ShIDDmR5uYykPG M4YChsvOEnZjo/IUF1nkVtufOAE3Ex3EXNRbpNsz0L65OPQ6+EBUNcMjNxOldoaweXGS/EBx8I+Jv k36t4ij5flLvVr+0flSWs1gsdK+FI2L7FT98PGD8Konw0TqnMJ4L5vcKRyd066s6EnyMMYD4HT8pf InBM05M0RGcuYUa67SGdEYT604p0HFktfWV/jp6nl5wirwGUw+xfFbRlV4JlxF3apvJJh43T8Tvpx eAI0aiXq1aWqovesZOrunqRUgpzNgazvHJnsBHQYSNLPKtER6/rq6V0tQlziKgb7XWkTfcOPKI15G T9e0tiQRewhvbFqqJvnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqV9h-00FIW5-21; Wed, 11 Oct 2023 09:05:25 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqV9d-00FITl-2e for linux-arm-kernel@lists.infradead.org; Wed, 11 Oct 2023 09:05:23 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1c5ff5f858dso46057425ad.2 for ; Wed, 11 Oct 2023 02:05:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697015120; x=1697619920; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rP+cC4Mbb/gp/3RvoRNIIeydGHiY8BBAyci0bzJmdbw=; b=YYCP+Ab3uTZQshAdjWi8Cb8qe0YUQFHxZcFYExEKU1/fSEzu7bvQPgCoRf8kKhoH+C 2tWsmhUVpgRofekZppJqxCerYyy/kxGKTMnY2d1A4IMP1mH3wJuJQn4wxref3M0P2wlW 2EhpKbjFfI0VK+FuzjZiFybPSoX/tnNsOHv2Uyyppghnj2jWOvtz/cN4Uu0gnNeY5IwH Bk2ZKebHFodtXz3GmBk8Z4dKxbQ7afycHlPrItG6gzND332cIo6CCV65N6KmNQs6rg6c 208La2KZ/f/tYZaMyGibJODIMP44Z4XDm+5jkHjhDBGYxJgJqtLl0d0CBW7ANbBxfSnR 3NhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697015120; x=1697619920; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rP+cC4Mbb/gp/3RvoRNIIeydGHiY8BBAyci0bzJmdbw=; b=PUKniqJ+lwN6XRoZ19KjPuXMHfANNt5tp117NZF70S2vbzj1ZgASy8n0J9Szufm3GK aF1o2Z8RWF4mv6PF+xtaUi17KqqTUbTIaCYJ6QKLYbmORkijpDEdfA4MPdmiPJj5PmSX xS+c93l9KuvNVk6yfSP/bURNqnsqpXp9z5vF19rt4qcRYhPRGJOJvj8gw+e1QP1VPNrH 7zacqrA//a+FeKDuxQGsUkVi1uTAEVFeKnqTVUa1QWYNtE6fGd31XWUWqb2OxOhZf96d Kgv994SLxF+OuhFhg3gb/sESzQOK6CP3HU7Hidz3KtnpsDk3F4ZHl/Xi4L7kbCJBIjNh BgaA== X-Gm-Message-State: AOJu0Yyvnv78Y+NDS750lgedAWtbt+g7mSvaYbz3MMPw7t84qiiE9IUm njeTi5uY/88jukuxwfFJinw= X-Google-Smtp-Source: AGHT+IGigYw2NHuJ9S5jl5BvcSCG7n3LNDVxlzN8+5/GiR6eWwM5JH9JyIcjsOKBD9stYpzayTo+Bg== X-Received: by 2002:a17:902:aa05:b0:1c5:8a0e:b01e with SMTP id be5-20020a170902aa0500b001c58a0eb01emr16204646plb.63.1697015120106; Wed, 11 Oct 2023 02:05:20 -0700 (PDT) Received: from a28aa0606c51.. (60-250-192-107.hinet-ip.hinet.net. [60.250.192.107]) by smtp.gmail.com with ESMTPSA id z18-20020a170903019200b001c61df93afdsm13346699plg.59.2023.10.11.02.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 02:05:19 -0700 (PDT) From: Jacky Huang To: linus.walleij@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, j.neuschaefer@gmx.net Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, schung@nuvoton.com, Jacky Huang Subject: [PATCH 2/4] dt-bindings: pinctrl: Document nuvoton ma35d1 pin control Date: Wed, 11 Oct 2023 09:05:08 +0000 Message-Id: <20231011090510.114476-3-ychuang570808@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231011090510.114476-1-ychuang570808@gmail.com> References: <20231011090510.114476-1-ychuang570808@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231011_020521_861033_863B7D6A X-CRM114-Status: GOOD ( 18.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jacky Huang Add the dt-bindings header for nuvoton ma35d1 pinctrl, that gets shared between the pin control driver and pin configuration in the dts. Add documentation to describe nuvoton ma35d1 pin control and GPIO. Signed-off-by: Jacky Huang --- .../pinctrl/nuvoton,ma35d1-pinctrl.yaml | 180 ++++++++++++++++++ include/dt-bindings/pinctrl/ma35d1-pinfunc.h | 38 ++++ 2 files changed, 218 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/nuvoton,ma35d1-pinctrl.yaml create mode 100644 include/dt-bindings/pinctrl/ma35d1-pinfunc.h diff --git a/Documentation/devicetree/bindings/pinctrl/nuvoton,ma35d1-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/nuvoton,ma35d1-pinctrl.yaml new file mode 100644 index 000000000000..0ddedbad4b78 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/nuvoton,ma35d1-pinctrl.yaml @@ -0,0 +1,180 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pinctrl/nuvoton,ma35d1-pinctrl.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Nuvoton MA35D1 pin control and GPIO + +maintainers: + - Shan-Chun Hung + +properties: + compatible: + enum: + - nuvoton,ma35d1-pinctrl + + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + + nuvoton,sys: + description: + phandle to the syscon node + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + maxItems: 1 + + ranges: true + +allOf: + - $ref: pinctrl.yaml# + +patternProperties: + "gpio[a-n]@[0-9a-f]+$": + type: object + additionalProperties: false + properties: + + gpio-controller: true + + '#gpio-cells': + const: 2 + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + interrupt-controller: true + + '#interrupt-cells': + const: 2 + + interrupts: + description: + The interrupt outputs to sysirq. + maxItems: 1 + + required: + - reg + - interrupts + - interrupt-controller + - '#interrupt-cells' + - gpio-controller + - '#gpio-cells' + + "pcfg-[a-z0-9-.]+$": + 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. + + allOf: + - $ref: pincfg-node.yaml# + + properties: + bias-disable: true + + bias-pull-down: true + + bias-pull-up: true + + drive-strength: + minimum: 0 + maximum: 7 + + input-enable: true + + input-schmitt-enable: true + + power-source: + description: + I/O voltage in millivolt. + enum: [ 1800, 3300 ] + +additionalProperties: + type: object + additionalProperties: + type: object + properties: + nuvoton,pin: + description: + Each entry consists of 4 parameters and represents the mux and config + setting for one pin. + $ref: /schemas/types.yaml#/definitions/uint32-matrix + minItems: 1 + items: + items: + - minimum: 0x80 + maximum: 0xec + description: + The pinctrl register offset in syscon registers. + - minimum: 0 + maximum: 30 + description: + The bit offset in the pinctrl register. + - minimum: 0 + maximum: 15 + description: + The multi-function pin value. + - description: + The phandle of a node contains the generic pinconfig options + to use as described in pinctrl-bindings.txt. + +examples: + - | + #include + #include + #include + #include + + pinctrl@40040000 { + compatible = "nuvoton,ma35d1-pinctrl"; + #address-cells = <1>; + #size-cells = <1>; + nuvoton,sys = <&sys>; + ranges = <0 0x40040000 0xc00>; + + gpioa@40040000 { + reg = <0x0 0x40>; + interrupts = ; + clocks = <&clk GPA_GATE>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + }; + + pcfg_default: pcfg-default { + slew-rate = <0>; + input-schmitt-disable; + bias-disable; + power-source = <3300>; + drive-strength = <0>; + }; + }; + + pinctrl { + uart13 { + pinctrl_uart13: uart13grp { + nuvoton,pins = + , + ; + }; + }; + }; + + serial@407d0000 { + compatible = "nuvoton,ma35d1-uart"; + reg = <0x407d0000 0x100>; + interrupts = ; + clocks = <&clk UART13_GATE>; + pinctrl-0 = <&pinctrl_uart13>; + }; diff --git a/include/dt-bindings/pinctrl/ma35d1-pinfunc.h b/include/dt-bindings/pinctrl/ma35d1-pinfunc.h new file mode 100644 index 000000000000..a2609d466dc9 --- /dev/null +++ b/include/dt-bindings/pinctrl/ma35d1-pinfunc.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) */ +/* + * Copyright (C) 2023 Nuvoton Technologies. + */ + +#ifndef __DT_BINDINGS_PINCTRL_NUVOTON_MA35D1_H +#define __DT_BINDINGS_PINCTRL_NUVOTON_MA35D1_H + +#define MA35_SYS_REG_GPA_L 0x80 +#define MA35_SYS_REG_GPA_H 0x84 +#define MA35_SYS_REG_GPB_L 0x88 +#define MA35_SYS_REG_GPB_H 0x8c +#define MA35_SYS_REG_GPC_L 0x90 +#define MA35_SYS_REG_GPC_H 0x94 +#define MA35_SYS_REG_GPD_L 0x98 +#define MA35_SYS_REG_GPD_H 0x9c +#define MA35_SYS_REG_GPE_L 0xa0 +#define MA35_SYS_REG_GPE_H 0xa4 +#define MA35_SYS_REG_GPF_L 0xa8 +#define MA35_SYS_REG_GPF_H 0xac +#define MA35_SYS_REG_GPG_L 0xb0 +#define MA35_SYS_REG_GPG_H 0xb4 +#define MA35_SYS_REG_GPH_L 0xb8 +#define MA35_SYS_REG_GPH_H 0xbc +#define MA35_SYS_REG_GPI_L 0xc0 +#define MA35_SYS_REG_GPI_H 0xc4 +#define MA35_SYS_REG_GPJ_L 0xc8 +#define MA35_SYS_REG_GPJ_H 0xcc +#define MA35_SYS_REG_GPK_L 0xd0 +#define MA35_SYS_REG_GPK_H 0xd4 +#define MA35_SYS_REG_GPL_L 0xd8 +#define MA35_SYS_REG_GPL_H 0xdc +#define MA35_SYS_REG_GPM_L 0xe0 +#define MA35_SYS_REG_GPM_H 0xe4 +#define MA35_SYS_REG_GPN_L 0xe8 +#define MA35_SYS_REG_GPN_H 0xec + +#endif /* __DT_BINDINGS_PINCTRL_NUVOTON_MA35D1_H */