Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1609372pxj; Sat, 12 Jun 2021 14:15:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEz5JnnlyRvJzBFWOBEwJwsqEJYeokEojcHB3Td12aeZWKwknz+M8vl6KK+nCbg9V7TN5T X-Received: by 2002:a50:8dc6:: with SMTP id s6mr10140563edh.50.1623532556766; Sat, 12 Jun 2021 14:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623532556; cv=none; d=google.com; s=arc-20160816; b=S+9dR8z/+zItB4hQ0UKo9F7UByy2xxR3NuhPGBp3Yea/nU8qfqHURcjb/wmCK+JsJF gkySRQWJ3x9HNHWOLF5Q1YLB7nYpvEvuU8OMAlnDp9oRdqlS6drS4q5KguGDU5lXp4tu VBNmbNEvZfyrRwfvgoiYqcimtWfK5OYacBbG8M75lNV41oyIJpqpzJTmFkx7XBSoO7E5 B9eA5LNGD5yPRFLStmysmp2jTHMiPLWd5BZB9NbVLqCZMfPcxoKTmVBQuBtdBZnpEdnM X6+NNWGyryDOME9eRJTGHt4kvPi9OPYgi5PHabH74Ln+Gyc90qNRWLP/ovyt9tXh9jLk ymdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=peP4FAnUjgZie11Wu5ctmIlUK9lVBvMWufZX87gWY9E=; b=XaFOgux9ALr9R7ttYYfVkOQx0/i/kZ/O32oC1Z7bhThcAlzIk45FDU0CAEtv60Qtaw u+WdMvHq7tfEQcjnCqCMjQAGIZz2/jrpIVzl2D7lMIN+xHl24Pi+thRz1PC3IYMv0VcP IU+7l1Eg2PZz6cqZ+CR+LnI4jbzU+xCosaigQV9s2d2HW24lvlrF5mjlcaBJD8PRtryu uMkXmVWEo1fXSfTJVBfmJC6NanVw1idsP/s7xyLuBHItcRN6v+4mpMz3tZBaGqJOEWhG moK3Ruq62eXyq1afyDvYg3f8RURNr9zzFtDAuyFfmqSl+YA0Rgu8KgE2hUlFSUKtmmm/ +q1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=tl1+cYE+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j21si7700514edj.143.2021.06.12.14.15.34; Sat, 12 Jun 2021 14:15:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=tl1+cYE+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231651AbhFLVPt (ORCPT + 99 others); Sat, 12 Jun 2021 17:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231556AbhFLVPk (ORCPT ); Sat, 12 Jun 2021 17:15:40 -0400 Received: from polaris.svanheule.net (polaris.svanheule.net [IPv6:2a00:c98:2060:a004:1::200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDD2FC0613A2 for ; Sat, 12 Jun 2021 14:13:39 -0700 (PDT) Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:eafb:ee01:a4dd:c59:8cbd:ee0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 04A1020C9CF; Sat, 12 Jun 2021 23:13:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1623532416; 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=peP4FAnUjgZie11Wu5ctmIlUK9lVBvMWufZX87gWY9E=; b=tl1+cYE+UANjApqxEDcrlujOqyoffdtdMF/UevOJYMpqkBsKwnIb/cf+IgltRL2abliYND muRlJkWBwYuV0DOcH0GqRRxSyCjeQe+JSVXt43ufCNSFcz8bMUfy6IwiIQS+PYyz1X19hr BM2X4QEXgkM20Y7gxU8lAWyvI/zjvwOtGkKqQbnTU6sjJUWcFrSpc9ZcdS/sTzlCVTXIFA DxQWCiuOVKuZC0nE35+KZqLYwZSbf1bi20vS7XhjaqIPKgivgsddUl7g1b4TUSaTnQD30M od6a4atCk+si6HJXETE8h9SXFe1BOCJdyq2G4soyq/Osvaek5/MODvsAyHekeg== From: Sander Vanheule To: Pavel Machek , Rob Herring , Lee Jones , Mark Brown , Greg Kroah-Hartman , "Rafael J . Wysocki" , Michael Walle , Linus Walleij , Bartosz Golaszewski , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Andrew Lunn , Andy Shevchenko , linux-kernel@vger.kernel.org, Sander Vanheule , Rob Herring Subject: [PATCH v5 3/8] dt-bindings: leds: Binding for RTL8231 scan matrix Date: Sat, 12 Jun 2021 23:12:33 +0200 Message-Id: <22886e00f20e34338136e2e7afea90e6c87f9d68.1623532208.git.sander@svanheule.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v4: - Add Rob's review tag --- .../bindings/leds/realtek,rtl8231-leds.yaml | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/realtek,rtl8231-leds.yaml diff --git a/Documentation/devicetree/bindings/leds/realtek,rtl8231-leds.yaml b/Documentation/devicetree/bindings/leds/realtek,rtl8231-leds.yaml new file mode 100644 index 000000000000..560249cd7e8c --- /dev/null +++ b/Documentation/devicetree/bindings/leds/realtek,rtl8231-leds.yaml @@ -0,0 +1,166 @@ +# 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×6 single color LEDs. Rows and columns are driven by 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×6 single color LEDs. Rows and columns are driven by 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 selection 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×6 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 description + for how the scanning matrices are wired up. + enum: ["single-color", "bi-color"] + +patternProperties: + "^led@": + description: | + LEDs are addressed by their port index and led index. Ports 0-23 always + support three LEDs. Additionally, but only when used in single color scan + mode, ports 24-31 support two LEDs. + type: object + + properties: + reg: + items: + - description: port index + maximum: 31 + - description: led index + maximum: 2 + + allOf: + - $ref: ../leds/common.yaml# + + required: + - reg + +required: + - compatible + - "#address-cells" + - "#size-cells" + - realtek,led-scan-mode + +additionalProperties: false + +examples: + - | + #include + led-controller { + compatible = "realtek,rtl8231-leds"; + #address-cells = <2>; + #size-cells = <0>; + + realtek,led-scan-mode = "single-color"; + + led@0,0 { + reg = <0 0>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <0>; + }; + + led@0,1 { + reg = <0 1>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <0>; + }; + + led@0,2 { + reg = <0 2>; + color = ; + function = LED_FUNCTION_STATUS; + }; + }; -- 2.31.1