From nobody Mon Feb 9 03:11:11 2026 Received: from polaris.svanheule.net (polaris.svanheule.net [84.16.241.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 821F6322B8F for ; Mon, 15 Dec 2025 17:51:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=84.16.241.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765821094; cv=none; b=rFTSPKjd4QV4y63rFF3kuf5yU4Tug2ZLPqyb7n31jFFSbNS2XtOIjXS4a38DqFv1SuXzflJ2gbv4+YIzzqAt5YHrxu2RPPA76eV6jAHuJyGACV9nxlmb0Z96TMN9U/X+5hnlxMZ4RNF+Wsg/RxY3BNqpzjOyXuGyDK/CKjWaJLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765821094; c=relaxed/simple; bh=aSBlYp4Qha3Zya9u9B9Eqkd2Og1xwSLgf/0MSa/tgIo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FU9D79HSSPeyn2czDASy0/nqjzTAz617CXbBPJxxKaA+0NO2qH55gWU1eXpRiReFoVZHGVtqteImZ03Kk/N95FGpr5rpnvO70SV/bkhbrgRzrxsNNM1qzkXJ7+U4Xi25yQ3bnTJomPrtHhaDKMPnoK4dtV80pdbsdOp7qogF8v0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=svanheule.net; spf=pass smtp.mailfrom=svanheule.net; dkim=pass (2048-bit key) header.d=svanheule.net header.i=@svanheule.net header.b=FGJOSTTs; arc=none smtp.client-ip=84.16.241.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=svanheule.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=svanheule.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=svanheule.net header.i=@svanheule.net header.b="FGJOSTTs" Received: from terra.vega.svanheule.net (2a02-1812-162c-8f00-1e2d-b404-3319-eba8.ip6.access.telenet.be [IPv6:2a02:1812:162c:8f00:1e2d:b404:3319:eba8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 8D40E6B1FA3; Mon, 15 Dec 2025 18:51:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1765821082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gEGImmEoawlt13KAG1f2EyWrDC7lMFFAt0RzzgLEZgY=; b=FGJOSTTsorQ/xw9TU04JIkEyx6oVDN4DfXcrZjneOR3ERty10VM6TjQMzg1eOu+Ncqu0Fg nRvYR/6TgXO8FReKJeRfCwol9CTmVBHRN6suHtaG+8rEaH7CVf2cr5aGFJRuYtIGSecEze +jt0q/cHCvmgG726BxoSpr2SMQj4JzlEQueAI4HyYukWClB0fU7apTd1A+EI1u3v70G2xt f9tmWxWnJnINCtXT69DbCDM4Xm0gwT0jYYCxJ9jk1dCO4hAoOXtj6cJVthfp2JqP14ntWG 3Wx0+pA+H+G7DU2aSSd7Q/BffuUgNGW8UORcUkdlOaU0vJoYhLrXgUR5sZJE5w== From: Sander Vanheule To: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , Michael Walle , Bartosz Golaszewski Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Sander Vanheule Subject: [PATCH v9 1/6] dt-bindings: leds: Binding for RTL8231 scan matrix Date: Mon, 15 Dec 2025 18:51:09 +0100 Message-ID: <20251215175115.135294-2-sander@svanheule.net> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251215175115.135294-1-sander@svanheule.net> References: <20251215175115.135294-1-sander@svanheule.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add a binding description for the Realtek RTL8231's LED support, which consists of up to 88 LEDs arranged in a number of scanning matrices. Signed-off-by: Sander Vanheule Reviewed-by: Rob Herring (Arm) --- Changes since v8: - Add Rob's tag Changes since v7: - Move $ref and add unevaluatedProperties for led nodes - Drop example redundant with MFD binding Changes since v6: - Relax description formatting - Enforce address format for led node names - Use absolute paths for schema references --- .../bindings/leds/realtek,rtl8231-leds.yaml | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/realtek,rtl8231-= leds.yaml diff --git a/Documentation/devicetree/bindings/leds/realtek,rtl8231-leds.ya= ml b/Documentation/devicetree/bindings/leds/realtek,rtl8231-leds.yaml new file mode 100644 index 000000000000..c19911582a08 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/realtek,rtl8231-leds.yaml @@ -0,0 +1,136 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/realtek,rtl8231-leds.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Realtek RTL8231 LED scan matrix. + +maintainers: + - Sander Vanheule + +description: | + The RTL8231 has support for driving a number of LED matrices, by scanning + over the LEDs pins, alternatingly lighting different columns and/or rows. + + This functionality is available on an RTL8231, when it is configured for= use + as an MDIO device, or SMI device. + + In single color scan mode, 88 LEDs are supported. These are grouped into + three output matrices: + - Group A of 6=C3=976 single color LEDs. Rows and columns are driven b= y GPIO + pins 0-11. + L0[n] L1[n] L2[n] L0[n+6] L1[n+6] L2[n+6] + | | | | | | + P0/P6 --<--------<--------<--------<--------<--------< (3) + | | | | | | + P1/P7 --<--------<--------<--------<--------<--------< (4) + | | | | | | + P2/P8 --<--------<--------<--------<--------<--------< (5) + | | | | | | + P3/P9 --<--------<--------<--------<--------<--------< (6) + | | | | | | + P4/P10 --<--------<--------<--------<--------<--------< (7) + | | | | | | + P5/P11 --<--------<--------<--------<--------<--------< (8) + (0) (1) (2) (9) (10) (11) + - Group B of 6=C3=976 single color LEDs. Rows and columns are driven b= y GPIO + pins 12-23. + L0[n] L1[n] L2[n] L0[n+6] L1[n+6] L2[n+6] + | | | | | | + P12/P18 --<--------<--------<--------<--------<--------< (15) + | | | | | | + P13/P19 --<--------<--------<--------<--------<--------< (16) + | | | | | | + P14/P20 --<--------<--------<--------<--------<--------< (17) + | | | | | | + P15/P21 --<--------<--------<--------<--------<--------< (18) + | | | | | | + P16/P22 --<--------<--------<--------<--------<--------< (19) + | | | | | | + P17/P23 --<--------<--------<--------<--------<--------< (20) + (12) (13) (14) (21) (22) (23) + - Group C of 8 pairs of anti-parallel (or bi-color) LEDs. LED selectio= n is + provided by GPIO pins 24-27 and 29-32, polarity selection by GPIO 28. + P24 P25 ... P30 P31 + | | | | + LED POL --X-------X---/\/---X-------X (28) + (24) (25) ... (31) (32) + + In bi-color scan mode, 72 LEDs are supported. These are grouped into four + output matrices: + - Group A of 12 pairs of anti-parallel LEDs. LED selection is provided + by GPIO pins 0-11, polarity selection by GPIO 12. + - Group B of 6 pairs of anti-parallel LEDs. LED selection is provided + by GPIO pins 23-28, polarity selection by GPIO 21. + - Group C of 6 pairs of anti-parallel LEDs. LED selection is provided + by GPIO pins 29-34, polarity selection by GPIO 22. + - Group of 4=C3=976 single color LEDs. Rows are driven by GPIO pins 15= -20, + columns by GPIO pins 13-14 and 21-22 (shared with groups B and C). + L2[n] L2[n+6] L2[n+12] L2[n+18] + | | | | + +0 --<--------<---------<---------< (15) + | | | | + +1 --<--------<---------<---------< (16) + | | | | + +2 --<--------<---------<---------< (17) + | | | | + +3 --<--------<---------<---------< (18) + | | | | + +4 --<--------<---------<---------< (19) + | | | | + +6 --<--------<---------<---------< (20) + (13) (14) (21) (22) + + This node must always be a child of a 'realtek,rtl8231' node. + +properties: + $nodename: + const: led-controller + + compatible: + const: realtek,rtl8231-leds + + "#address-cells": + const: 2 + + "#size-cells": + const: 0 + + realtek,led-scan-mode: + $ref: /schemas/types.yaml#/definitions/string + description: + Specify the scanning mode the chip should run in. See general descri= ption + for how the scanning matrices are wired up. + enum: [single-color, bi-color] + +patternProperties: + "^led@([1-2]?[0-9]|3[0-1]),[0-2]": + $ref: /schemas/leds/common.yaml# + description: + LEDs are addressed by their port index and led index. Ports 0-23 alw= ays + support three LEDs. Additionally, but only when used in single color= scan + mode, ports 24-31 support two LEDs. + type: object + + properties: + reg: + items: + - items: + - description: port index + maximum: 31 + - description: led index + maximum: 2 + + required: + - reg + + unevaluatedProperties: false + +required: + - compatible + - "#address-cells" + - "#size-cells" + - realtek,led-scan-mode + +additionalProperties: false --=20 2.52.0