Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp942594rwb; Tue, 29 Nov 2022 07:11:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf750VJIUKiHMfieiwr5Tj5MdCm5PmwNxpkGLu4p9yxYVd1WnTe7IP3nO2cY7YwX/NAai6VU X-Received: by 2002:a17:906:2ec7:b0:79b:413b:d64 with SMTP id s7-20020a1709062ec700b0079b413b0d64mr31207715eji.538.1669734664562; Tue, 29 Nov 2022 07:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669734664; cv=none; d=google.com; s=arc-20160816; b=mGXhDHltaHIrozY5YsA4g46cHHDVzTw/k1FzosMbsP9oQrMyqJYpTgg7x/dXVduk2M nYU7EhWHeak1SmnRiBv6175KF4kCwZKVKyfq++TssP/paF5nCxUSuIKea3fLgHKQTFqU twnDsvQcrjSuuIpLmdu7+s6QJtYrMLPvHW+psJST2daFJXdU+VhM7btHXT9fTjQ528sA 4s1driSXJNDJtVUXAQ3j3Y4XfBJytxA7N7R0DG4szZ83ihp9OO6BKirh7k0O4vOxdRLx fcdDD0851ht5HduWT2qNIb6mdb6d5/hvZpr40COiu7xgb0b6WULlDm4pskQ4dslYw0S4 a4Yw== 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=cAmdPwxeV/gmwrZFUCjIqIdjxeWkPmcTFRtF8kijtD8=; b=rfY7Hu7Yzc+tfcs7YqGz6UEpiXAIehxUFM3N5osOZ3h4q3SDZLYiVE38c+xGJYUp1p tID1qa+VrZ78Mdo5FzgydAqfWjA4luqD4L1KNN7P7DXlXtet2RbuTzK7A4lefokn0+Ma gsKoaTNpJyEhuOLYwwWvgdwjrIUz9Lmg8lmX8eRTuposxDN6AmSJ4Y2RgXLCGdmmcmoe hsnj7FdXpqhNBKsIy0IOT6TO2VJDYpNekbewfK6JUMQZgHBb3XhtYfbXJ3nte5tPOiWL 8xLZnOpb8SCY6n08cFc822wOnOv6p0EXCgYgLWM/ybICZ3jYznjG+dFPCvSXORvkAXAn fBWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L7E15i11; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs17-20020a170906dc9100b00780def41dc4si12608718ejc.527.2022.11.29.07.10.39; Tue, 29 Nov 2022 07:11:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=L7E15i11; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235234AbiK2OKy (ORCPT + 83 others); Tue, 29 Nov 2022 09:10:54 -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-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 Content-Transfer-Encoding: 8bit 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: linux-kernel@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>; + }; + }; + }; + +... -- 2.38.1