From patchwork Tue Nov 29 14:09:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chuanhong Guo X-Patchwork-Id: 1710140 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=SgtKAAor; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4NM44R3kZDz23nQ for ; Wed, 30 Nov 2022 01:10:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233610AbiK2OKm (ORCPT ); Tue, 29 Nov 2022 09:10:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235299AbiK2OKQ (ORCPT ); Tue, 29 Nov 2022 09:10:16 -0500 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D668C5EFA7; Tue, 29 Nov 2022 06:10:10 -0800 (PST) Received: by mail-pf1-x433.google.com with SMTP id x66so13798009pfx.3; Tue, 29 Nov 2022 06:10:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MBA40M/jf7iW7dWiX7G42nvg49ZSKMGIJyGQgzCsnPU=; b=SgtKAAorY7XnakOpyX4HtaOGDIoD7CS9X3TT3yasROFE3IXidNc7lI2FgfUvNzYdQS n83h8ZINTMmxIMPHZiS3D2iq0ZwhsqmczmnEKs+vwhhtfQHlLQE0VaL4F9tF/FI+ABN6 45vlUnhbH3t79TZxaiRv7gAXaOqr4XLQ5K7EP29yqwmrcL3BZwXnYzlGVcA74c4tCjmY S1ZZw3ym0HqCAekXACX7oitQE0tmJYJ75EGHIZvpEekupiAbo39mF/NVBverKMYS7xGM A+R/UluQGlsVia3fkGvBoktT4r+7hMV5wE5MFwMDjq1VwGaNVf+kW/O2lT15rbieZh4k ce3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MBA40M/jf7iW7dWiX7G42nvg49ZSKMGIJyGQgzCsnPU=; b=6Eig2Z4cM5O8ON4hMeI7NgumvVBnemSY54Faby+IsL8Vj600q5gcmG5pAiUIzanESr dcQdjhB2rfPijRot2YzVr3t2ZM9Bo092vVsbShOJA55mXg8kEeFMXVPF49/nX08FfXA1 Ydoug1Ca6BLTwEQJKCBkks0/XOWrqyPfoN7PDm81Kg+mtZKCJHODs1YCb0pgQx3y33JZ 0KS8Uoxrf7qVAAZ+UNvKtB3zbMuyOTQuE8UXEBJ20nbKl/gXbqnY/023DnI2BqWzfEvi HoDFafIZ4zqPfVZi6Av924TzuXP1JirHvRfmXXvDRGhVx2hfOLnCbqDprsmYN4Uwarx7 SxsA== X-Gm-Message-State: ANoB5pksoBH8BCeLoZq/4spETDcmEkT8FP5uNFiV0+ZgY86QaOwmbzjS mO3ZNWLu0H0eaDJ3taIJJagJKLFjUy0= X-Google-Smtp-Source: AA0mqf4ODFr+y6ZZXfIoDmYuJXEo/sKdmGcS5SD3icoCkpTIgpdFqw/Tv81k0hw6fxaZi8dzKtkAQg== X-Received: by 2002:a63:d74b:0:b0:450:3ae9:2590 with SMTP id w11-20020a63d74b000000b004503ae92590mr33728380pgi.410.1669731010120; Tue, 29 Nov 2022 06:10:10 -0800 (PST) Received: from guoguo-omen.scut.edu.cn ([2401:c080:1400:4da2:5400:3ff:feb4:7578]) by smtp.gmail.com with ESMTPSA id a5-20020a170902710500b0017854cee6ebsm10932342pll.72.2022.11.29.06.10.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 06:10:09 -0800 (PST) From: Chuanhong Guo To: linux-leds@vger.kernel.org Cc: Chuanhong Guo , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Stanislav Jakubek , Linus Walleij , Shawn Guo , Johan Hovold , Bjorn Andersson , Marijn Suijten , Sven Schwermer , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/3] dt-bindings: vendor-prefixes: add an entry for WorldSemi Date: Tue, 29 Nov 2022 22:09:53 +0800 Message-Id: <20221129140955.137361-2-gch981213@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221129140955.137361-1-gch981213@gmail.com> References: <20221129140955.137361-1-gch981213@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org WorldSemi is well-known for their WS2812B individually-addressable RGB LEDs on the market. Add a vendor prefix for it. Signed-off-by: Chuanhong Guo --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 10c178d97b02..32274d894664 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1462,6 +1462,8 @@ patternProperties: description: Wondermedia Technologies, Inc. "^wobo,.*": description: Wobo + "^worldsemi,.*": + description: WorldSemi Co., Limited "^wanchanglong,.*": description: Wanchanglong Electronics Technology(SHENZHEN)Co.,Ltd. "^x-powers,.*": From patchwork Tue Nov 29 14:09:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuanhong Guo X-Patchwork-Id: 1710139 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=L7E15i11; dkim-atps=neutral Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by legolas.ozlabs.org (Postfix) with ESMTP id 4NM44M0TZBz23nQ for ; Wed, 30 Nov 2022 01:10:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230217AbiK2OKk (ORCPT ); Tue, 29 Nov 2022 09:10:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235314AbiK2OKS (ORCPT ); Tue, 29 Nov 2022 09:10:18 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A3D5F858; Tue, 29 Nov 2022 06:10:16 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id p24so9764919plw.1; Tue, 29 Nov 2022 06:10:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cAmdPwxeV/gmwrZFUCjIqIdjxeWkPmcTFRtF8kijtD8=; b=L7E15i11LH899DwPT2jWyRY3zYfaCL5kCTEOkOHF0KRRPmojCmCpjHYU0ij1jOoREh q1w59KBmdEeCojMFJMg/I5mIS3/GMf4aaPt5TP37JPS0P+rbnzo22kaLJ3HnYSbVWi2g Juyhf8scAkjX4v/jgRKs8jBBuBxwPBQjuimrjS3YXCCbJ7MJ6aSLAXPYLhZogxdBUiBX Se1lJ5RMM8dzBwFSgsy7GS3arDKWTU9G7hEq5sGlq8KFAilP6KHgV8nLUN+iujHcniK4 txiYMY5o4efzDHnECBIWCeiQzOHg7sEBK5u4n11HbOLRgRAXAdlgyrdc/QqOBj6OUsRm +ufg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cAmdPwxeV/gmwrZFUCjIqIdjxeWkPmcTFRtF8kijtD8=; b=kRn1M0yCVD+KwCXO9D1BzvnwcOl1qWhAx+7kbzyrU2XPlTCPZOx+taGrWYHs0J2W7V A5dNLjugKWIf903vDx6eUw2BBJGzlHy0MrrQeWTPxeBbR9+MVUoJ08r6WmaoHLmGcKoW XgA9xAHOcDIf5RVtO7+42yZlOZbOez66t/ud5QW6eosmBWRuk+wfh2RuKEePakSJkdPK bE72LLHkiXgBrz4NFh2rbrzB5UuI2JwUqnyOppW+aR4muVbxafcLFJAm8cZ+Ff275om/ 7UvCfqK7SwjIEXa1srkAF3i4e0kpiYi7ke7V6/P5tzdI7XGPsFgLH9X5uOOMiAckAhsl bGig== X-Gm-Message-State: ANoB5plsLCBr+zw0Hr6k372DsST9PYY++HXsoUKB/YSeSaEpBBep+3iw rgr1wSqrZDthw0FTr7n6D4DQvJHq9nc= X-Google-Smtp-Source: AA0mqf5mVohJJr822gYGrE1q5vJhKvIkHt3GESFsGio1KQfQLRdc+Ed2Lq7KrobYE4dh5F0tQbtnhQ== X-Received: by 2002:a17:90b:3d0d:b0:1fd:5b5d:f09d with SMTP id pt13-20020a17090b3d0d00b001fd5b5df09dmr60832901pjb.69.1669731015551; Tue, 29 Nov 2022 06:10:15 -0800 (PST) Received: from guoguo-omen.scut.edu.cn ([2401:c080:1400:4da2:5400:3ff:feb4:7578]) by smtp.gmail.com with ESMTPSA id a5-20020a170902710500b0017854cee6ebsm10932342pll.72.2022.11.29.06.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 06:10:15 -0800 (PST) From: Chuanhong Guo To: linux-leds@vger.kernel.org Cc: Chuanhong Guo , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Stanislav Jakubek , Linus Walleij , Shawn Guo , Johan Hovold , Bjorn Andersson , Marijn Suijten , Sven Schwermer , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/3] dt-bindings: leds: add dt schema for worldsemi,ws2812b-spi Date: Tue, 29 Nov 2022 22:09:54 +0800 Message-Id: <20221129140955.137361-3-gch981213@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221129140955.137361-1-gch981213@gmail.com> References: <20221129140955.137361-1-gch981213@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds dt binding schema for WorldSemi WS2812B driven using SPI bus. Signed-off-by: Chuanhong Guo --- .../bindings/leds/worldsemi,ws2812b-spi.yaml | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/worldsemi,ws2812b-spi.yaml diff --git a/Documentation/devicetree/bindings/leds/worldsemi,ws2812b-spi.yaml b/Documentation/devicetree/bindings/leds/worldsemi,ws2812b-spi.yaml new file mode 100644 index 000000000000..8544bde4f261 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/worldsemi,ws2812b-spi.yaml @@ -0,0 +1,131 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/worldsemi,ws2812b-spi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: WS2812B LEDs driven using SPI + +maintainers: + - Chuanhong Guo + +description: | + WorldSemi WS2812B is a individually addressable LED chip that can be chained + together and controlled individually using a single wire. + This driver simulates the protocol used by this LED chip with SPI bus. + Typical setups includes connecting the data pin of the LED chain to MOSI as + the only device or using CS and MOSI with a tri-state voltage-level shifter + for the data pin. + The SPI frequency needs to be 2.105MHz~2.85MHz for the timing to be correct + and the controller needs to send all the bytes continuously. + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +properties: + compatible: + const: worldsemi,ws2812b-spi + + reg: + description: The chip-select line on the SPI bus + maxItems: 1 + + spi-max-frequency: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Maximum SPI clocking speed of the device in Hz. + minimum: 2105000 + maximum: 2850000 + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +patternProperties: + "^multi-led(@[0-9a-f])?$": + type: object + $ref: leds-class-multicolor.yaml# + + properties: + color-index: + description: | + A 3-item array specifying color of each components in this LED. It + should be one of the LED_COLOR_ID_* prefixed definitions from the + header include/dt-bindings/leds/common.h. Defaults to + + if unspecified. + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 3 + maxItems: 3 + + default-intensity: + description: | + An array of 3 integer specifying the default intensity of each color + components in this LED. <255 255 255> if unspecified. + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 3 + maxItems: 3 + items: + minimum: 0 + maximum: 255 + + reg: + description: | + Which LED this node represents. The reg of the first LED on the chain + is 0. + + required: + - reg + - color + - function + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include + spi { + #address-cells = <1>; + #size-cells = <0>; + + ws2812b@0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "worldsemi,ws2812b-spi"; + reg = <0>; + spi-max-frequency = <2850000>; + multi-led@0 { + reg = <0>; + color-index = ; + default-intensity = <10 50 90>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <0>; + }; + multi-led@1 { + reg = <1>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; + }; + multi-led@2 { + reg = <2>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; + }; + multi-led@3 { + reg = <3>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <3>; + }; + }; + }; + +...