dt-bindings: leds: lacie,netxbig-leds: Convert to DT schema
Subsystems (2)
PATCH v4 1/2 dt-bindings: leds: lacie,netxbig-leds: Convert to DT schema
Convert lacie,netxbig-leds devicetree binding from legacy text format to DT schema.
---
Changelog:
Changes since v3:
- Correct patternProperties to use generic led node names
- Rename example device name to leds
- Drop optional subnode properties
Link to v3:https://lore.kernel.org/all/[email protected]/
Changes since v2:
- Add reference to led common.yaml
- Drop type for all common properties
Link to v2:https://lore.kernel.org/all/[email protected]/
Changes since v1:
- Use pattenProperties for LED child nodes instead of additionalProperties
- Explicitly list the two optional properties supported by the binding
- Place the top-level required block after child-node definition
Link to v1:https://lore.kernel.org/all/[email protected]/
--- .../bindings/leds/lacie,netxbig-leds.yaml | 136 ++++++++++++++++++ .../devicetree/bindings/leds/leds-netxbig.txt | 92 ------------ 2 files changed, 136 insertions(+), 92 deletions(-) create mode 100644 Documentation/devicetree/bindings/leds/lacie,netxbig-leds.yaml delete mode 100644 Documentation/devicetree/bindings/leds/leds-netxbig.txt
Documentation/devicetree/bindings/leds/lacie,netxbig-leds.yaml new file +136 -0
@@ -0,0 +1,136 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/lacie,netxbig-leds.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: LaCie/Seagate netxbig CPLD LEDs + +maintainers: + - Simon Guinot <[email protected]> + +description: | + Binding for the CPLD LEDs (GPIO extension bus) found on some LaCie/Seagate + boards (Example: 2Big/5Big Network v2, 2Big NAS). + +properties: + compatible: + const: lacie,netxbig-leds + + gpio-ext: + description: Phandle for the gpio-ext bus. + $ref: /schemas/types.yaml#/definitions/phandle + + timers: + description: + Timer array. Each timer entry is represented by three integers - + Mode (gpio-ext bus), delay_on and delay_off. + $ref: /schemas/types.yaml#/definitions/uint32-array + +patternProperties: + "^led-[a-z0-9]+$": + type: object + $ref: common.yaml# + unevaluatedProperties: false + + properties: + mode-addr: + description: Mode register address on gpio-ext bus. + $ref: /schemas/types.yaml#/definitions/uint32 + + mode-val: + description: + Mode to value mapping. Each entry is represented by two integers - + a mode and the corresponding value on the gpio-ext bus. + $ref: /schemas/types.yaml#/definitions/uint32-array + + bright-addr: + description: Brightness register address on gpio-ext bus. + $ref: /schemas/types.yaml#/definitions/uint32 + + max-brightness: + description: Maximum brightness value. + $ref: /schemas/types.yaml#/definitions/uint32 + + required: + - mode-addr + - mode-val + - bright-addr + - max-brightness + +required: + - compatible + - gpio-ext + +additionalProperties: false + +examples: + - | + #include <dt-bindings/leds/leds-netxbig.h> + + leds { + compatible = "lacie,netxbig-leds"; + + gpio-ext = <&netxbig_gpio_ext>; + + timers = <NETXBIG_LED_TIMER1 500 500 + NETXBIG_LED_TIMER2 500 1000>; + + led-0 { + label = "netxbig:blue:power"; + mode-addr = <0>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 1 + NETXBIG_LED_TIMER1 3 + NETXBIG_LED_TIMER2 7>; + bright-addr = <1>; + max-brightness = <7>; + }; + led-1 { + label = "netxbig:red:power"; + mode-addr = <0>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 2 + NETXBIG_LED_TIMER1 4>; + bright-addr = <1>; + max-brightness = <7>; + }; + led-2 { + label = "netxbig:blue:sata0"; + mode-addr = <3>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 7 + NETXBIG_LED_SATA 1 + NETXBIG_LED_TIMER1 3>; + bright-addr = <2>; + max-brightness = <7>; + }; + led-3 { + label = "netxbig:red:sata0"; + mode-addr = <3>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 2 + NETXBIG_LED_TIMER1 4>; + bright-addr = <2>; + max-brightness = <7>; + }; + led-4 { + label = "netxbig:blue:sata1"; + mode-addr = <4>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 7 + NETXBIG_LED_SATA 1 + NETXBIG_LED_TIMER1 3>; + bright-addr = <2>; + max-brightness = <7>; + }; + led-5 { + label = "netxbig:red:sata1"; + mode-addr = <4>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 2 + NETXBIG_LED_TIMER1 4>; + bright-addr = <2>; + max-brightness = <7>; + }; + };
Documentation/devicetree/bindings/leds/leds-netxbig.txt deleted +0 -92
92 lines not on this page · raw message
Signature · 1 line
2.34.1
Quoted 24 lines · Udaya Kiran Challa
Convert lacie,netxbig-leds devicetree binding from legacy text format to DT schema.
Signed-off-by Udaya Kiran Challa <[email protected]>---
Changelog:
Changes since v3:
- Correct patternProperties to use generic led node names
- Rename example device name to leds
- Drop optional subnode propertiesLink to v3:https://lore.kernel.org/all/[email protected]/
Changes since v2:
- Add reference to ledcommon.yaml
- Drop type for all common propertiesLink to v2:https://lore.kernel.org/all/[email protected]/
Changes since v1:
- Use pattenProperties for LED child nodes instead of additionalProperties
- Explicitly list the two optional properties supported by the binding
- Place the top-level required block after child-node definition
Quoted 8 lines
Link to v1:https://lore.kernel.org/all/[email protected]/
--- .../bindings/leds/lacie,netxbig-leds.yaml | 136 ++++++++++++++++++ .../devicetree/bindings/leds/leds-netxbig.txt | 92 ------------ 2 files changed, 136 insertions(+), 92 deletions(-) create mode 100644 Documentation/devicetree/bindings/leds/lacie,netxbig-leds.yaml delete mode 100644 Documentation/devicetree/bindings/leds/leds-netxbig.txt
Re: (subset) [PATCH v4 1/2] dt-bindings: leds: lacie,netxbig-leds: Convert to DT schema
In reply to Udaya Kiran ChallaQuoted 2 lines · Udaya Kiran Challa
Convert lacie,netxbig-leds devicetree binding from legacy text format to DT schema.
Applied, thanks!
[1/2] dt-bindings: leds: lacie,netxbig-leds: Convert to DT schema
commit: 59cf91cf87abb67a49b1bb7b9d3b06486abde8cf
--
Lee Jones [李琼斯]