From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 325EBC433EF for ; Tue, 5 Jul 2022 11:51:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230220AbiGELvS (ORCPT ); Tue, 5 Jul 2022 07:51:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229922AbiGELvR (ORCPT ); Tue, 5 Jul 2022 07:51:17 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EDE5175AB for ; Tue, 5 Jul 2022 04:51:16 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id i18so20084813lfu.8 for ; Tue, 05 Jul 2022 04:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=/UGo3h1lFotrXUyVOn1vvOw10sA63ae5wh+VH5tG39s=; b=c3j2jGXVqGFeYL75sECqGf7InKbQhuBnnqkj1UqNiL/+dGSczDyMQcf9Atm1oKsz3d HsYqcKbvtKchDYMu6q2wripBe4bD5G3oo9GqFuvCXUMQViG23oVoqFbR9pPq4POpg+q3 CPTPYo0qtLsCba7MDASbJOliZCmGTPnmIXv+wgyG8h6Qy3bG+XdE1/ZcABa84jmGVEni DegY99VzxiaRDQ8BsRvthhlBO8Bcio7T46lRE6T16uEE3R7AVCQCZLd1TCc68zTqutFo e6xJIYJXzMR7CUK7NtYL+Dkbe33MssoJHi1PLUy/jdGbn5KmjBIbSh2Z1preu8ZIF2uK mCGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=/UGo3h1lFotrXUyVOn1vvOw10sA63ae5wh+VH5tG39s=; b=YXwHDgnwetPaUVLyMZXxbnQxEw0o7X6RCqCiukB4vfNaaUuUZ9r7h4I7Ejrz+qr/bh kl8nM4+rNEZ7OCSeUEWviEz7egx5kLHDkdrgiZ9AANol0BoFm3OGZ9QpTtAe/GUn2Wh2 Z5/77mAeSZC0iwVeCoBAfAfwZ30UHQvHZ3T3bvtPK5SlYvP66xQvagLgY5vES10ELy2f 9kRlaDLtJyonx08hlPC8yrVNQ08u+TsxUPIZb/vtBKPIdqVHOhE60lbFKm4HXrWdagip U0zESHbjqb9ZLT7xGIqTqFaY+6Em27m+J6ivR2utuQDWs8FC6FNKkfx+mh8qbgRxhnEe +nIA== X-Gm-Message-State: AJIora/fm7qXVgV1yojicR9GdOytAQDO/Yc2HvQi6Jp/3Cpb6r8d0P64 YI9qqF8AwqG2e36AFEz3RuwkJA== X-Google-Smtp-Source: AGRyM1vw6cA8apgUVB4nud8nMwX7wEE8bQbgw7xac6nBHVQglGxItugzYlWcsshQ3UiivXanpk/r6Q== X-Received: by 2002:a05:6512:2a8d:b0:47f:b3ba:4922 with SMTP id dt13-20020a0565122a8d00b0047fb3ba4922mr23997604lfb.38.1657021874399; Tue, 05 Jul 2022 04:51:14 -0700 (PDT) Received: from [192.168.1.52] ([84.20.121.239]) by smtp.gmail.com with ESMTPSA id s14-20020a19770e000000b0047faab456cesm5659965lfc.237.2022.07.05.04.51.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Jul 2022 04:51:13 -0700 (PDT) Message-ID: <90fd55cb-13f4-eac2-2b1a-85ae628ecc89@linaro.org> Date: Tue, 5 Jul 2022 13:51:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 1/2] dt-bindings: leds: Add cznic,turris1x-leds.yaml binding Content-Language: en-US To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: Pavel Machek , Rob Herring , Krzysztof Kozlowski , =?UTF-8?Q?Marek_Beh=c3=ban?= , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220705000448.14337-1-pali@kernel.org> <42d837dd-fbd1-6294-2fa0-8a07ae0f8d44@linaro.org> <20220705114238.xwgexavgozqskwbw@pali> From: Krzysztof Kozlowski In-Reply-To: <20220705114238.xwgexavgozqskwbw@pali> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 05/07/2022 13:42, Pali Rohár wrote: > On Tuesday 05 July 2022 13:36:54 Krzysztof Kozlowski wrote: >> On 05/07/2022 02:04, Pali Rohár wrote: >>> Add device-tree bindings documentation for Turris 1.x RGB LEDs. >>> >>> Signed-off-by: Pali Rohár >>> --- >>> .../bindings/leds/cznic,turris1x-leds.yaml | 116 ++++++++++++++++++ >>> 1 file changed, 116 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..fd09613c8d2d >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/leds/cznic,turris1x-leds.yaml >>> @@ -0,0 +1,116 @@ >>> +# 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: >>> + maxItems: 2 >> >> You need to describe the items, if it is really two items. However your >> example has only one item, so this was not tested and won't work. > > Ehm? Example has two items in the reg. No, you have exactly one item. <0x13 0x1d> Two items are for example: <0x13 0x1d>, <0x23 0x1d> > >> You'll get warning from Rob's robot soon... but you should test the >> bindings instead. > > I have tested bindings on the real hardware and it is working fine > together with the driver from patch 2/2. Bindings cannot be tested on real hardware. Bindings are tested with dt_binding_check, as explained in writing-schema.rst > >>> + >>> + "#address-cells": >>> + const: 1 >>> + >>> + "#size-cells": >>> + const: 0 >>> + >>> +patternProperties: >>> + "^multi-led@[0-7]$": >>> + type: object >>> + $ref: leds-class-multicolor.yaml# >> >> This looks incorrect, unless you rebased on my patchset? > > So what is the correct? (I used inspiration from > cznic,turris-omnia-leds.yaml file) Which according to current multicolor bindings is not correct. Correct is pwm-multicolor. However if you rebase on [1], it looks fine, except missing unevaluatedProperties. [1] https://lore.kernel.org/all/20220624112106.111351-1-krzysztof.kozlowski@linaro.org/ > >>> + >>> + properties: >>> + reg: >>> + minimum: 0 >>> + maximum: 7 >>> + >>> + required: >>> + - reg >>> + >>> +additionalProperties: false >>> + >>> +examples: >>> + - | >>> + >> >> No blank line. > > Ok. > >>> + #include >>> + >>> + cpld@3,0 { >> >> Generic node name. > > Is not cpld name generic enough? No, it means nothing to me. Just like "a", "ashjd" or "wrls". "The name of a node should be somewhat generic, reflecting the function of the device and not its precise programming model. If appropriate, the name should be one of the following choices:" Best regards, Krzysztof