[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250811163749.47028-3-ziyao@disroot.org>
Date: Mon, 11 Aug 2025 16:37:48 +0000
From: Yao Zi <ziyao@...root.org>
To: Linus Walleij <linus.walleij@...aro.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Huacai Chen <chenhuacai@...nel.org>,
WANG Xuerui <kernel@...0n.name>
Cc: linux-gpio@...r.kernel.org,
devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org,
loongarch@...ts.linux.dev,
Mingcong Bai <jeffbai@...c.io>,
Kexy Biscuit <kexybiscuit@...c.io>,
Yao Zi <ziyao@...root.org>
Subject: [PATCH 1/3] dt-binding: pinctrl: Document Loongson 2K0300 pin controller
The pincontroller integarted in Loongson 2K0300 is able to configure
function multiplexing for all the pins. It could also configure drive
strength on basis of functions, which means all pins set to the same
function share drive-strength setting. Drive-strength configuration
isn't available for all functions, either.
This binding utilizes two levels of subnodes, where the outer represents
function and the inner represents groups. Drive-strength is allowed in
the outer since it's shared among all groups configured to the function.
Signed-off-by: Yao Zi <ziyao@...root.org>
---
.../pinctrl/loongson,ls2k0300-pinctrl.yaml | 92 +++++++++++++++++++
MAINTAINERS | 6 ++
2 files changed, 98 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pinctrl/loongson,ls2k0300-pinctrl.yaml
diff --git a/Documentation/devicetree/bindings/pinctrl/loongson,ls2k0300-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/loongson,ls2k0300-pinctrl.yaml
new file mode 100644
index 000000000000..cbd74cb45342
--- /dev/null
+++ b/Documentation/devicetree/bindings/pinctrl/loongson,ls2k0300-pinctrl.yaml
@@ -0,0 +1,92 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pinctrl/loongson,ls2k0300-pinctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson-2K0300 SoC Pinctrl Controller
+
+maintainers:
+ - Yao Zi <ziyao@...root.org>
+
+allOf:
+ - $ref: pinctrl.yaml#
+
+properties:
+ compatible:
+ const: loongson,ls2k0300-pinctrl
+
+ reg:
+ items:
+ - description: Pin function-multiplexing configuration registers
+ - description: Pin drive-strength configuration registers
+
+ reg-names:
+ items:
+ - const: mux
+ - const: drive
+
+patternProperties:
+ '^func-':
+ type: object
+
+ $ref: pincfg-node.yaml#
+
+ properties:
+ drive-strength:
+ description:
+ Maximum sink or source current as defined in pincfg-node.yaml. Note
+ that drive strength could only be configured on function basis, i.e.,
+ all pins multiplexed to the same function share the same
+ configuration.
+
+ This could only be configured for several functions, including jtag,
+ dvo, uart, gmac, sdio, spi, i2s, timer, usb and emmc.
+ enum: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
+
+ additionalProperties: false
+
+ patternProperties:
+ '-pins$':
+ type: object
+ $ref: pinmux-node.yaml#
+
+ properties:
+ pinmux:
+ description:
+ Integer array, represents GPIO pin number and multiplexing
+ setting. Configuration for each pin takes one cell. The pin
+ number locates at the high 24 bits, and the setting locates at
+ the low 8 bits.
+
+ additionalProperties: false
+
+ required:
+ - pinmux
+
+required:
+ - compatible
+ - reg
+ - reg-names
+
+additionalProperties: false
+
+examples:
+ - |
+ pinctrl@...00420 {
+ compatible = "loongson,ls2k0300-pinctrl";
+ reg = <0x16000490 0x20>, <0x16000110 0x4>;
+ reg-names = "mux", "drive";
+
+ func-uart {
+ drive-strength = <2>;
+
+ uart0-pins {
+ pinmux = <((40 << 8) | 0x3)>, <((41 << 8) | 0x3)>;
+ };
+
+ uart1_pins: uart1-pins {
+ pinmux = <((42 << 8) | 0x3)>, <((43 << 8) | 0x3)>;
+ };
+ };
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index 7960e65d7dfc..dd50571b4072 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14414,6 +14414,12 @@ S: Maintained
F: Documentation/devicetree/bindings/thermal/loongson,ls2k-thermal.yaml
F: drivers/thermal/loongson2_thermal.c
+LOONGSON-2K0300 SOC PINCTRL DRIVER
+M: Yao Zi <ziyao@...root.org>
+L: linux-gpio@...r.kernel.org
+S: Maintained
+F: Documentation/devicetree/bindings/pinctrl/loongson,ls2k0300-pinctrl.yaml
+
LOONGSON EDAC DRIVER
M: Zhao Qunqin <zhaoqunqin@...ngson.cn>
L: linux-edac@...r.kernel.org
--
2.50.1
Powered by blists - more mailing lists