From nobody Fri Oct 3 12:25:37 2025 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 001843314AF; Mon, 1 Sep 2025 13:38:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756733914; cv=none; b=UzuPWghhKAUq+2ks1AcydLzeUWbwVQYbeZwaFzKNuY0x/E2crgrlBzSK0lEgQ1KGGy6KmsVd8uJOHws2fvDXcjWssRsnB6ZZkrkVFriLenM74p8/jQayiBiHiVmMcE2UYncA1PH0PYWve3b3ig20NG3qLD6HILpcUSWNaGSpXcU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756733914; c=relaxed/simple; bh=LOMVwhCj+jjyPYlIVU2ct3Dp3VQW+O3+nR63vMu7r8Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=deOPv26Ax6tixezY5zc23pPeMqS1vPXQyMRO0lc1CRw3lM1wONMRQiqXvfY0dZ6YGsgRFo2l4DiB2ggLdkxZePlmNOctUDcF5Ls/U1Wwvl2tA4QN5duMkyRcZx2XzAl6FzZGOytFyLyCWyqsQqcfbg32y5D/SsCmTjVrbuUMFfQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=Ekq0so1u; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="Ekq0so1u" Received: from mail01.disroot.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 6D75C20F5E; Mon, 1 Sep 2025 15:38:30 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Sg5SsRGHO6cE; Mon, 1 Sep 2025 15:38:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1756733909; bh=LOMVwhCj+jjyPYlIVU2ct3Dp3VQW+O3+nR63vMu7r8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Ekq0so1uxYaJkKB2VLtEkIGVgZAOx1ECixTvBXUAqpzKLPDiPzlL0rXjz9bOu4isJ Vtk6e6hGPg3XJkcz18y0G77gJxyZvGDk0XG94+RduGAvc0tqI+2jaL3ymfrmNsTqlZ c4nYYWg7Gtr4uivMNheNfVR8fl2vJLNAeboljMeJFUW2Xae2ZLub64lTTSYnbT4/pv Xe+aZoNaC2dZcFCgzN8FOU9kRfuK9UWLY/3qAgsgyDiBM2BIMwgpWKRHjYGzf8umtZ s1UnP9vaG7giIwYYZoRNDiRIaZEqegfr30sRnhfYDjD592HgGcg/FzJPDOiSK9nBSA WEelyH/2v9oLQ== From: Yao Zi To: Yinbo Zhu , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Huacai Chen , WANG Xuerui , Philipp Zabel Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Mingcong Bai , Kexy Biscuit , Yao Zi , Krzysztof Kozlowski Subject: [PATCH v2 1/3] dt-bindings: gpio: loongson: Document GPIO controller of 2K0300 SoC Date: Mon, 1 Sep 2025 13:38:02 +0000 Message-ID: <20250901133804.38433-2-ziyao@disroot.org> In-Reply-To: <20250901133804.38433-1-ziyao@disroot.org> References: <20250901133804.38433-1-ziyao@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Loongson 2K0300 ships a GPIO controller whose input/output control logic is similar to previous generation of SoCs. Additionally, it acts as an interrupt-controller supporting both level and edge interrupts and has a distinct reset signal. Describe its compatible in devicetree. We enlarge the maximum value of ngpios to 128, since the controller technically supports at most 128 pins, although only 106 are routed out of the package. Properties for interrupt-controllers and resets are introduced and limited as 2K0300 only. Signed-off-by: Yao Zi Reviewed-by: Krzysztof Kozlowski Reviewed-by: Huacai Chen --- .../bindings/gpio/loongson,ls-gpio.yaml | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml b= /Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml index b68159600e2b..69852444df23 100644 --- a/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/loongson,ls-gpio.yaml @@ -14,6 +14,7 @@ properties: oneOf: - enum: - loongson,ls2k-gpio + - loongson,ls2k0300-gpio - loongson,ls2k0500-gpio0 - loongson,ls2k0500-gpio1 - loongson,ls2k2000-gpio0 @@ -36,7 +37,7 @@ properties: =20 ngpios: minimum: 1 - maximum: 64 + maximum: 128 =20 "#gpio-cells": const: 2 @@ -49,6 +50,14 @@ properties: minItems: 1 maxItems: 64 =20 + "#interrupt-cells": + const: 2 + + interrupt-controller: true + + resets: + maxItems: 1 + required: - compatible - reg @@ -58,6 +67,23 @@ required: - gpio-ranges - interrupts =20 +allOf: + - if: + properties: + compatible: + contains: + const: loongson,ls2k0300-gpio + then: + required: + - "#interrupt-cells" + - interrupt-controller + - resets + else: + properties: + "#interrupts-cells": false + interrupt-controller: false + resets: false + additionalProperties: false =20 examples: --=20 2.50.1