From patchwork Mon Dec 26 12:36:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 13081802 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 smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2BBA0C4708D for ; Mon, 26 Dec 2022 12:50:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) id 036A7C433A8; Mon, 26 Dec 2022 12:50:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95896C433F1; Mon, 26 Dec 2022 12:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672059009; bh=EFzVdiaH+zHs4e97fcsUZrZMSEeaqc3cPEhzJR5+8O0=; h=From:To:List-Id:Cc:Subject:Date:In-Reply-To:References:From; b=WuIo+Uf9f3K7tGcluGeiIndGmvox+0Y7W/AWXWKrjBxzyRbI/4Zqh3wgyRA6diFfN LW33duwgkF398G5ni0TF989X1l+RKTclmo/bhDMWxDJAcHFp8CQJP05bWX1QotE/HI nisIbLYvoGik36ilDPDh9cBpZT+ba88kxINjbH4ejftWqVtj/9Bn47agG53G1iB8ny zqNrsUPFP2zzW479l44o9bVzHecc3k7XF2XtzofOdA6mj+AdvgRHtR3nZTEnKC5qCM w13zbO6fnBcfEM2VYxKa+twDjwUCn1xlyi4ENDHbSzLFCOqqflb4ZkDNzVo92yJCZq B8MJZMTHCEY8A== Received: by pali.im (Postfix) id 50A989D7; Mon, 26 Dec 2022 13:50:09 +0100 (CET) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: "Arnd Bergmann" , Linus Walleij List-Id: Cc: soc@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND 4/8] dt-bindings: leds: Add cznic,turris1x-leds.yaml binding Date: Mon, 26 Dec 2022 13:36:26 +0100 Message-Id: <20221226123630.6515-5-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221226123630.6515-1-pali@kernel.org> References: <20221226123630.6515-1-pali@kernel.org> MIME-Version: 1.0 Add device-tree bindings documentation for Turris 1.x RGB LEDs. Signed-off-by: Pali Rohár --- .../bindings/leds/cznic,turris1x-leds.yaml | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/cznic,turris1x-leds.yaml diff --git a/Documentation/devicetree/bindings/leds/cznic,turris1x-leds.yaml b/Documentation/devicetree/bindings/leds/cznic,turris1x-leds.yaml new file mode 100644 index 000000000000..bcaab5b03128 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/cznic,turris1x-leds.yaml @@ -0,0 +1,118 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/cznic,turris1x-leds.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: CZ.NIC's Turris 1.x LEDs driver + +maintainers: + - Pali Rohár + +description: + This module adds support for the RGB LEDs found on the front panel of the + Turris 1.x routers. There are 8 RGB LEDs that are controlled by CZ.NIC CPLD + firmware running on Lattice FPGA. Firmware is open source and available at + https://gitlab.nic.cz/turris/hw/turris_cpld/-/blob/master/CZ_NIC_Router_CPLD.v + +properties: + compatible: + const: cznic,turris1x-leds + + reg: + description: CPLD address range where LED registers are mapped + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +patternProperties: + "^multi-led@[0-7]$": + type: object + $ref: leds-class-multicolor.yaml# + unevaluatedProperties: false + + properties: + reg: + minimum: 0 + maximum: 7 + + required: + - reg + +additionalProperties: false + +examples: + - | + #include + + cpld@3,0 { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x3 0x0 0x00020000>; + + led-controller@13 { + compatible = "cznic,turris1x-leds"; + reg = <0x13 0x1d>; + #address-cells = <1>; + #size-cells = <0>; + + multi-led@0 { + reg = <0x0>; + color = ; + function = LED_FUNCTION_WAN; + }; + + multi-led@1 { + reg = <0x1>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <5>; + }; + + multi-led@2 { + reg = <0x2>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <4>; + }; + + multi-led@3 { + reg = <0x3>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <3>; + }; + + multi-led@4 { + reg = <0x4>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + }; + + multi-led@5 { + reg = <0x5>; + color = ; + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + }; + + multi-led@6 { + reg = <0x6>; + color = ; + function = LED_FUNCTION_WLAN; + }; + + multi-led@7 { + reg = <0x7>; + color = ; + function = LED_FUNCTION_POWER; + }; + }; + }; + +...