dt-bindings: leds: lacie,ns2-leds: Convert to DT schema
Subsystems (2)
PATCH 1/1 dt-bindings: leds: lacie,ns2-leds: Convert to DT schema
Convert lacie,ns2-leds to DT schema.
--- .../bindings/leds/lacie,ns2-leds.yaml | 87 +++++++++++++++++++ .../devicetree/bindings/leds/leds-ns2.txt | 35 -------- 2 files changed, 87 insertions(+), 35 deletions(-) create mode 100644 Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml delete mode 100644 Documentation/devicetree/bindings/leds/leds-ns2.txt
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +87 -0
@@ -0,0 +1,87 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/lacie,ns2-leds.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Dual-GPIO LEDs found on Network Space v2 (and parents) + +maintainers: + - Lee Jones <[email protected]> + - Pavel Machek <[email protected]> + +description: | + The Network Space v2 dual-GPIO LED is wired to a CPLD. Three different LED + modes are available: off, on and SATA activity blinking. The LED modes are + controlled through two GPIOs (command and slow): each combination of values + for the command/slow GPIOs corresponds to a LED mode. + +properties: + compatible: + const: lacie,ns2-leds + +patternProperties: + "^led(-[0-9a-z]+)?$": + type: object + $ref: common.yaml# + unevaluatedProperties: false + + description: + Each child node represents a single LED + + properties: + cmd-gpio: + maxItems: 1 + description: + GPIO connected to the command LED output + + slow-gpio: + maxItems: 1 + description: + GPIO connected to the slow LED output + + modes-map: + $ref: /schemas/types.yaml#/definitions/uint32-matrix + description: + A mapping between LED modes (off, on or SATA activity blinking) and + the corresponding cmd-gpio/slow-gpio values. All the GPIO values + combinations should be given in order to avoid having an unknown + mode at driver probe time. + + items: + items: + - description: LED mode + enum: [0, 1, 2] + - description: Command GPIO level + enum: [0, 1] + - description: Slow GPIO level + enum: [0, 1] + + required: + - cmd-gpio + - slow-gpio + - modes-map + +required: + - compatible + +additionalProperties: false + +examples: + - | + #include <dt-bindings/leds/leds-ns2.h> + + led-controller { + compatible = "lacie,ns2-leds"; + + led-0 { + label = "ns2:blue:sata"; + slow-gpio = <&gpio0 29 0>; + cmd-gpio = <&gpio0 30 0>; + modes-map = <NS_V2_LED_OFF 0 1 + NS_V2_LED_ON 1 0 + NS_V2_LED_ON 0 0 + NS_V2_LED_SATA 1 1>; + }; + }; +...
Documentation/devicetree/bindings/leds/leds-ns2.txt deleted +0 -35
@@ -1,35 +0,0 @@ -Binding for dual-GPIO LED found on Network Space v2 (and parents). - -Required properties: -- compatible: "lacie,ns2-leds". - -Each LED is represented as a sub-node of the ns2-leds device. - -Required sub-node properties: -- cmd-gpio: Command LED GPIO. See OF device-tree GPIO specification. -- slow-gpio: Slow LED GPIO. See OF device-tree GPIO specification. -- modes-map: A mapping between LED modes (off, on or SATA activity blinking) and - the corresponding cmd-gpio/slow-gpio values. All the GPIO values combinations - should be given in order to avoid having an unknown mode at driver probe time. - -Optional sub-node properties: -- label: Name for this LED. If omitted, the label is taken from the node name. -- linux,default-trigger: Trigger assigned to the LED. - -Example: - -#include <dt-bindings/leds/leds-ns2.h> - -ns2-leds { - compatible = "lacie,ns2-leds"; - - blue-sata { - label = "ns2:blue:sata"; - slow-gpio = <&gpio0 29 0>; - cmd-gpio = <&gpio0 30 0>; - modes-map = <NS_V2_LED_OFF 0 1 - NS_V2_LED_ON 1 0 - NS_V2_LED_ON 0 0 - NS_V2_LED_SATA 1 1>; - }; -};
Signature · 1 line
2.54.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The schema conversion incorrectly restricts LED child node names to `^led(-[0-9a-z]+)?$`, which…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The schema conversion incorrectly restricts LED child node names to ^led(-[0-9a-z]+)?$, which breaks dtbs_check validation for all existing upstream device trees using this binding. --
commit 6c59295f22b17d02a2b26847db54458f820fa4f3
Author: Ninad Naik <[email protected]>
dt-bindings: leds: lacie,ns2-leds: Convert to DT schema
Convert lacie,ns2-leds to DT schema.
Quoted 6 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +0
-0@@ -0,0 +1,87 @@
[ ... ]
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml line 24
Quoted 6 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +6
-0+properties: + compatible: + const: lacie,ns2-leds + +patternProperties: + "^led(-[0-9a-z]+)?$":
[Severity: Low]
Will this restrictive regex cause existing device trees to fail dtbs_check?
The old text binding example used a child node named blue-sata, which does not match this pattern. Since additionalProperties is set to false below, nodes in existing device trees that don't start with led will be rejected during validation.
Should this regex be relaxed to allow existing node names, or should those device tree files be updated alongside this conversion?
Quoted 3 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +3
-0+ type: object + $ref: common.yaml# + unevaluatedProperties: false
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Rob Herring
maintainerQuoted 28 lines · On Wed, Jul 01, 2026 at 06:05:52PM +0000, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The schema conversion incorrectly restricts LED child node names to^led(-[0-9a-z]+)?$, which breaksdtbs_checkvalidation for all existing upstream device trees using this binding. --commit
6c59295f22b17d02a2b26847db54458f820fa4f3
Author: Ninad Naik <[email protected]>dt-bindings: leds: lacie,ns2-leds: Convert to DT schema
Convert lacie,ns2-leds to DT schema.
Quoted 6 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +0
-0@@ -0,0 +1,87 @@[ ... ]
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml line 24
Quoted 6 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +6
-0+properties: + compatible: + const: lacie,ns2-leds + +patternProperties: + "^led(-[0-9a-z]+)?$":[Severity: Low]
Will this restrictive regex cause existing device trees to faildtbs_check?
Quoted 7 lines
The old text binding example used a child node named blue-sata, which does not match this pattern. Since additionalProperties is set to false below, nodes in existing device trees that don't start with led will be rejected during validation.
Should this regex be relaxed to allow existing node names, or should those device tree files be updated alongside this conversion?
While yes we prefer what you did, it's perhaps not worth changing these old .dts files to match the preference.
Rob
Quoted 33 lines · Rob Herring
Quoted 32 lines · On Wed, Jul 01, 2026 at 06:05:52PM +0000,[email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The schema conversion incorrectly restricts LED child node names to^led(-[0-9a-z]+)?$, which breaksdtbs_checkvalidation for all existing upstream device trees using this binding. --commit
6c59295f22b17d02a2b26847db54458f820fa4f3
Author: Ninad Naik<[email protected]>dt-bindings: leds: lacie,ns2-leds: Convert to DT schema
Convert lacie,ns2-leds to DT schema.
Quoted 6 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +0
-0@@ -0,0 +1,87 @@[ ... ]
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml line 24
Quoted 6 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +6
-0+properties: + compatible: + const: lacie,ns2-leds + +patternProperties: + "^led(-[0-9a-z]+)?$":[Severity: Low]
Will this restrictive regex cause existing device trees to faildtbs_check?The old text binding example used a child node named blue-sata, which does not match this pattern. Since additionalProperties is set to false below, nodes in existing device trees that don't start with led will be rejected during validation.
Quoted 6 lines
Quoted 2 lines
Should this regex be relaxed to allow existing node names, or should those device tree files be updated alongside this conversion?
While yes we prefer what you did, it's perhaps not worth changing these old .dts files to match the preference.
Rob
I understand this. Should I relax the regex to allow any pattern so that the existing as well
as new DTS files could be properly validated?
Thanks,
Ninad Naik
Rob Herring
maintainerQuoted 41 lines · Ninad Naik
Quoted 38 lines · Rob Herring
Quoted 27 lines · On Wed, Jul 01, 2026 at 06:05:52PM +0000,[email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The schema conversion incorrectly restricts LED child node names to^led(-[0-9a-z]+)?$, which breaksdtbs_checkvalidation for all existing upstream device trees using this binding. --commit
6c59295f22b17d02a2b26847db54458f820fa4f3
Author: Ninad Naik<[email protected]>dt-bindings: leds: lacie,ns2-leds: Convert to DT schema
Convert lacie,ns2-leds to DT schema.
Quoted 6 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +0
-0@@ -0,0 +1,87 @@[ ... ]
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml line 24
Quoted 6 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +6
-0+properties: + compatible: + const: lacie,ns2-leds + +patternProperties: + "^led(-[0-9a-z]+)?$":[Severity: Low]
Will this restrictive regex cause existing device trees to faildtbs_check?Quoted 7 lines
The old text binding example used a child node named blue-sata, which does not match this pattern. Since additionalProperties is set to false below, nodes in existing device trees that don't start with led will be rejected during validation.
Should this regex be relaxed to allow existing node names, or should those device tree files be updated alongside this conversion?
While yes we prefer what you did, it's perhaps not worth changing these old .dts files to match the preference.
Quoted 6 lines
Quoted 1 line
Rob
I understand this. Should I relax the regex to allow any pattern so that the existing as well
as new DTS files could be properly validated?
I doubt there will be new DTS files here, so you could just list the node names in use. Or to just allow anything, you can do:
additionalProperties:
type: object
...
Rob Herring
maintainerQuoted 17 lines · Ninad Naik
Convert lacie,ns2-leds to DT schema.
Signed-off-by Ninad Naik <[email protected]>--- .../bindings/leds/lacie,ns2-leds.yaml | 87 +++++++++++++++++++ .../devicetree/bindings/leds/leds-ns2.txt | 35 -------- 2 files changed, 87 insertions(+), 35 deletions(-) create mode 100644 Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml delete mode 100644 Documentation/devicetree/bindings/leds/leds-ns2.txtDocumentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +1
-0@@ -0,0 +1,87 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml line 11
Quoted 10 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +10
-0+%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/lacie,ns2-leds.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Dual-GPIO LEDs found on Network Space v2 (and parents) + +maintainers: + - Lee Jones <[email protected]> + - Pavel Machek <[email protected]>
This should be someone with the h/w, not subsystem maintainers.
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml line 13
Quoted 2 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +2
-0+ +description: |
Dont need '|'.
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml line 17
Quoted 4 lines
Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml new file +4
-0+ The Network Space v2 dual-GPIO LED is wired to a CPLD. Three different LED + modes are available: off, on and SATA activity blinking. The LED modes are + controlled through two GPIOs (command and slow): each combination of values + for the command/slow GPIOs corresponds to a LED mode.
Rest looks fine.
Rob