* [PATCH v3] dt-bindings: leds: lacie,ns2-leds: Convert to DT schema
@ 2026-07-24 16:23 Ninad Naik
2026-07-24 16:36 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Ninad Naik @ 2026-07-24 16:23 UTC (permalink / raw)
To: lee, pavel, robh, krzk+dt, conor+dt, simon.guinot
Cc: linux-leds, devicetree, linux-kernel, me, linux-kernel-mentees,
skhan, Ninad Naik, kernel test robot
Convert lacie,ns2-leds to DT schema.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202607231542.6ovJrInT-lkp@intel.com/
Signed-off-by: Ninad Naik <ninadnaik07@gmail.com>
---
Changes in v3:
- Add optional property num-modes to the schema.
.../bindings/leds/lacie,ns2-leds.yaml | 85 +++++++++++++++++++
.../devicetree/bindings/leds/leds-ns2.txt | 35 --------
2 files changed, 85 insertions(+), 35 deletions(-)
create mode 100644 Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml
delete mode 100644 Documentation/devicetree/bindings/leds/leds-ns2.txt
diff --git a/Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml b/Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml
new file mode 100644
index 000000000000..2138c75c0413
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml
@@ -0,0 +1,85 @@
+# 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:
+ - Simon Guinot <simon.guinot@sequanux.org>
+
+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
+
+additionalProperties:
+ 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
+
+ num-modes:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ Number of entries in modes-map.
+
+ 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
+
+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>;
+ };
+ };
+...
diff --git a/Documentation/devicetree/bindings/leds/leds-ns2.txt b/Documentation/devicetree/bindings/leds/leds-ns2.txt
deleted file mode 100644
index 9f81258a5b6e..000000000000
--- a/Documentation/devicetree/bindings/leds/leds-ns2.txt
+++ /dev/null
@@ -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>;
- };
-};
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v3] dt-bindings: leds: lacie,ns2-leds: Convert to DT schema
2026-07-24 16:23 [PATCH v3] dt-bindings: leds: lacie,ns2-leds: Convert to DT schema Ninad Naik
@ 2026-07-24 16:36 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-07-24 16:36 UTC (permalink / raw)
To: Ninad Naik; +Cc: conor+dt, lee, robh, devicetree, linux-leds
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The top-level `additionalProperties` is incorrectly defined as a child-node schema, causing it to incorrectly reject standard device tree properties.
--
--- Patch [1]: [PATCH v3] dt-bindings: leds: lacie,ns2-leds: Convert to DT schema ---
commit 2e02c3a2b329288ad4aeeb155d96aec6b772c421
Author: Ninad Naik <ninadnaik07@gmail.com>
dt-bindings: leds: lacie,ns2-leds: Convert to DT schema
Convert lacie,ns2-leds to DT schema.
Closes: https://lore.kernel.org/r/202607231542.6ovJrInT-lkp@intel.com/
> diff --git a/Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml b/Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml
> new file mode 100644
> index 0000000000000..2138c75c04133
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/lacie,ns2-leds.yaml
[ ... ]
> +properties:
> + compatible:
> + const: lacie,ns2-leds
> +
> +additionalProperties:
> + type: object
> + $ref: common.yaml#
> + unevaluatedProperties: false
[Severity: Medium]
Does this incorrectly apply an object constraint to all unspecified top-level
properties?
It appears this schema logic will cause valid device trees containing standard
non-object properties (like status or pinctrl-0) to fail validation during
make dtbs_check.
Should child nodes instead be matched using patternProperties, with
additionalProperties: false or unevaluatedProperties: false used at the top
level to allow standard DT properties?
> +
> + description: Each child node represents a single LED
> +
> + properties:
> + cmd-gpio:
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724162332.32291-1-ninadnaik07@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-24 16:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 16:23 [PATCH v3] dt-bindings: leds: lacie,ns2-leds: Convert to DT schema Ninad Naik
2026-07-24 16:36 ` sashiko-bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.