Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3506911rwb; Sat, 3 Dec 2022 06:06:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf6n/imps8AfbPpsiBmvWyMiseldfjScT/52pSHAQl7AJy/RjBK36gUKwoX/fIO9pgpicVCD X-Received: by 2002:a17:906:fcda:b0:7c0:a728:6cbb with SMTP id qx26-20020a170906fcda00b007c0a7286cbbmr12756613ejb.104.1670076408704; Sat, 03 Dec 2022 06:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670076408; cv=none; d=google.com; s=arc-20160816; b=qdr+MaQA643C2wqhfd6Fu9TNJSH35eiUsmu26Qb2HSrXI9mRGXaIPQFGKg2/Ror6Q/ LfhuTnpN1ah89l2fG9pFtLThbpCw3CE4ZSDooW9R2QNfQAj2Bsw/SKJwUdoKM1J80qnJ OQ4PfwLNhPwkOOCGZeMlzzb+tfBo5wnb03K1zSeDOe76rO5bpEFhA2qYmZAINRufg+yU GObd0FonLQHg34nfRQAQkxohb9Hy2escXgsAAhpTco+5Ag6GjrN7UQRadIbPQ4YWmT8+ zc/w+WPA5QHq3DnZzsSDnlwGF9vYNvdgrJtW9UWXQcOJqbBXeKm73IJ6LtyH1yKZ/9QJ 3eog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UZUeqVR+YNS254T8ghrOY0br3+YG9kpDkIyVm5x/F6Y=; b=jjZoaI3uwtwb9/N7JWSr8i0B66Wav7idSLTYvFP/sGWKbgbUIr6bEwoSgA3iLMGu17 x3PSWkkeuf0oSzNkUdXCCOAiFeDpwgnQqW6oGOetlrfMX1Rn4HyXkcmwfBY8YovBRlU4 mOc57zBnKfJHeNp8nYv+KFk4KpkFGwRWsWQwe4dw9Dp7tD35DVYLat8HJB/cysXFl52G +k7PV6kAAGZng47zSqDnKY0N4IK1LYVuaZx2N6if2Xoz1B5u+jM4aUod6jfBcm8yaPZ8 xvpt6WxNbi3xU1OznnjT101jOXHZOAjca4BziigmluIpf7fddhURujb67Fhzakp9ADHM r1RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qRGRjM8J; 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 js21-20020a17090797d500b007c0bc66e526si4894482ejc.622.2022.12.03.06.06.27; Sat, 03 Dec 2022 06:06:48 -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=qRGRjM8J; 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 S229576AbiLCNqR (ORCPT + 83 others); Sat, 3 Dec 2022 08:46:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbiLCNqO (ORCPT ); Sat, 3 Dec 2022 08:46:14 -0500 Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B7C9A1B8; Sat, 3 Dec 2022 05:46:13 -0800 (PST) Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-1441d7d40c6so8521858fac.8; Sat, 03 Dec 2022 05:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=UZUeqVR+YNS254T8ghrOY0br3+YG9kpDkIyVm5x/F6Y=; b=qRGRjM8J5rb2ZDwDTRn79jhnQNreMJM4+wgZxFQ2ktqCJa5uoCvkJLyYapat94blo+ ZFkjUp1v6+Akll140+hFahBUvNiKiJkPQMsUzAOPyraZ/nmbz0FYawnmYknzZ4YQg0l2 HDg5r3YdkBd1xhewe58Saj9dRAHIvEIJqEflYBzGFYvcmSsl90pynLeWVXk6Ff03KF7J rO2At1ZzLaa9QB1RseJ/uTrF6UW45GEQZnC1fvSALcTSmeR7GckKZiscnyl+7qrddx7H u+jdfXZZ9HpY7APpffFpVkZRjvhISzSOR9rBYHEWEdA7bRdfrnxnALavioLZk0yytspW cGgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UZUeqVR+YNS254T8ghrOY0br3+YG9kpDkIyVm5x/F6Y=; b=nDo1jasWAoadzY+QcAAFypfwmatD3aUFgwT/7183u6/swN5kUgDkkxig94fLYEG69f bi0ltX6k7x6a38VEH1BiPDkI0w2fx/xeowQ7ZuiTc+jxXeDjJuV6b+QFw1JhHK0J4yYe rJROzjsXojY7/LqCeZJ7hc4q1tjBaVbvbiDQVtK2fCLLJS+D9ziwxs/Gi59ZDGpzmnAf zV3gCgsqB04MEKG8IlUVXBYgijkrFH7NCjakkZB4FWep03SE+3DFPHIo7JMb0g5rkXvT mUBPD5RriZdJUJ68gOx11P8z3XH7gqH1ac9brLdbzMdggXIGB6B4lzvvayJHGLBS7W5/ kPPA== X-Gm-Message-State: ANoB5pknbd8CJWrjyLkcgmFj4l1sCp7lGy6LReNtIi9oRuIUMv86uvY1 mBPrIuCQzlBb4sLdiI+NJZT/QlJVBtITrSTRK0k= X-Received: by 2002:a05:6870:ab86:b0:13c:5763:9411 with SMTP id gs6-20020a056870ab8600b0013c57639411mr41158023oab.288.1670075172372; Sat, 03 Dec 2022 05:46:12 -0800 (PST) MIME-Version: 1.0 References: <20221202034240.455831-1-gch981213@gmail.com> <20221202034240.455831-3-gch981213@gmail.com> <783fd2ff-cf7a-d820-6be7-9863e1786349@linaro.org> In-Reply-To: From: Chuanhong Guo Date: Sat, 3 Dec 2022 21:46:01 +0800 Message-ID: Subject: Re: [PATCH v2 2/3] dt-bindings: leds: add dt schema for worldsemi,ws2812b-spi To: Krzysztof Kozlowski Cc: linux-leds@vger.kernel.org, Pavel Machek , Rob Herring , Krzysztof Kozlowski , Stanislav Jakubek , Linus Walleij , Shawn Guo , Johan Hovold , Bjorn Andersson , Marijn Suijten , Sven Schwermer , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list Content-Type: text/plain; charset="UTF-8" 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 On Sat, Dec 3, 2022 at 8:25 PM Krzysztof Kozlowski wrote: > >>>>> + 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. > >>>>> + maxItems: 1 > >>>>> + > >>>>> + required: > >>>>> + - reg > >>>>> + - color > >>>>> + - function > >>>>> + > >>>>> +required: > >>>>> + - compatible > >>>>> + > >>>>> +additionalProperties: false > >>>>> + > >>>>> +examples: > >>>>> + - | > >>>>> + #include > >>>>> + spi { > >>>>> + #address-cells = <1>; > >>>>> + #size-cells = <0>; > >>>>> + > >>>>> + leds@0 { > >>>> > >>>> git grep leds@ -- Documentation/devicetree/ | wc -l > >>>> 1 > >>>> git grep led@ -- Documentation/devicetree/ | wc -l > >>>> 165 > >>>> > >>>> so rather not the first one ("leds"). > >>> > >>> As you can see, this node describes a chain of LEDs, not > >>> a single LED, so the plural form is more appropriate than > >>> the singular form. > >>> > >>>> > >>>> There is also: > >>>> git grep led-controller@ -- Documentation/devicetree/ | wc -l > >>>> 30 > >>> > >>> This also isn't appropriate. WS2812B is a single LED package > >>> of 3 diodes and a microcontroller. If we treat every package > >>> as a LED, the SPI MOSI is connected directly to the LED > >>> packages themselves with no controller in between. > >>> If we treat the microcontroller as a led-controller, every > >>> LED contains its own controller, instead of one controller > >>> controlling all LEDs, and the parent node still shouldn't > >>> be called a led-controller. > >>> > >>> Here's a picture of the WS2812B LED package: > >>> https://cdn-shop.adafruit.com/970x728/1655-00.jpg > >>> and a chain of them: > >>> https://cdn-shop.adafruit.com/970x728/1463-00.jpg > >> > >> Then your bindings and DTS do not represent the hardware. > > > > How should this hardware be represented, then? > > > > The connection can be: > > > > SPI-MOSI---LED1---LED2---LED3---...---LEDN > > > > or > > > > SPI-MOSI---Tri-state signal gate---LED1---LED2---LED3---...---LEDN > > SPI-CS-----| > > I would look at it this as either of: > 1. serially linked separate LED controllers (so multiple device nodes) > > 2. one LED controller handling the entire LED system of many > sub-controllers. > > For the (2) I proposed the name led-controller. If you think this is not > (2), then looks like (1) and you should have many devices... which > probably is not doable on itself. And how to call this entire set of > separate LED controllers? Heh, can be also some controller, like > led-controller. OK. I'll name it led-controller in the next version. -- Regards, Chuanhong Guo