Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: leds: pca955x: Convert text bindings to YAML

Convert the text bindings of pca955x to YAML so it could be used to
validate the DTS.

Signed-off-by: Ricky CX Wu <ricky.cx.wu.wiwynn@gmail.com>
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20241016093857.925467-1-Delphine_CC_Chiu@wiwynn.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Ricky CX Wu and committed by
Lee Jones
f92d2e93 6cbf5c99

+158 -89
-89
Documentation/devicetree/bindings/leds/leds-pca955x.txt
··· 1 - * NXP - pca955x LED driver 2 - 3 - The PCA955x family of chips are I2C LED blinkers whose pins not used 4 - to control LEDs can be used as general purpose I/Os. The GPIO pins can 5 - be input or output, and output pins can also be pulse-width controlled. 6 - 7 - Required properties: 8 - - compatible : should be one of : 9 - "nxp,pca9550" 10 - "nxp,pca9551" 11 - "nxp,pca9552" 12 - "ibm,pca9552" 13 - "nxp,pca9553" 14 - - #address-cells: must be 1 15 - - #size-cells: must be 0 16 - - reg: I2C slave address. depends on the model. 17 - 18 - Optional properties: 19 - - gpio-controller: allows pins to be used as GPIOs. 20 - - #gpio-cells: must be 2. 21 - - gpio-line-names: define the names of the GPIO lines 22 - 23 - LED sub-node properties: 24 - - reg : number of LED line. 25 - from 0 to 1 for the pca9550 26 - from 0 to 7 for the pca9551 27 - from 0 to 15 for the pca9552 28 - from 0 to 3 for the pca9553 29 - - type: (optional) either 30 - PCA955X_TYPE_NONE 31 - PCA955X_TYPE_LED 32 - PCA955X_TYPE_GPIO 33 - see dt-bindings/leds/leds-pca955x.h (default to LED) 34 - - label : (optional) 35 - see Documentation/devicetree/bindings/leds/common.txt 36 - - linux,default-trigger : (optional) 37 - see Documentation/devicetree/bindings/leds/common.txt 38 - 39 - Examples: 40 - 41 - pca9552: pca9552@60 { 42 - compatible = "nxp,pca9552"; 43 - #address-cells = <1>; 44 - #size-cells = <0>; 45 - reg = <0x60>; 46 - 47 - gpio-controller; 48 - #gpio-cells = <2>; 49 - gpio-line-names = "GPIO12", "GPIO13", "GPIO14", "GPIO15"; 50 - 51 - gpio@12 { 52 - reg = <12>; 53 - type = <PCA955X_TYPE_GPIO>; 54 - }; 55 - gpio@13 { 56 - reg = <13>; 57 - type = <PCA955X_TYPE_GPIO>; 58 - }; 59 - gpio@14 { 60 - reg = <14>; 61 - type = <PCA955X_TYPE_GPIO>; 62 - }; 63 - gpio@15 { 64 - reg = <15>; 65 - type = <PCA955X_TYPE_GPIO>; 66 - }; 67 - 68 - led@0 { 69 - label = "red:power"; 70 - linux,default-trigger = "default-on"; 71 - reg = <0>; 72 - type = <PCA955X_TYPE_LED>; 73 - }; 74 - led@1 { 75 - label = "green:power"; 76 - reg = <1>; 77 - type = <PCA955X_TYPE_LED>; 78 - }; 79 - led@2 { 80 - label = "pca9552:yellow"; 81 - reg = <2>; 82 - type = <PCA955X_TYPE_LED>; 83 - }; 84 - led@3 { 85 - label = "pca9552:white"; 86 - reg = <3>; 87 - type = <PCA955X_TYPE_LED>; 88 - }; 89 - };
+158
Documentation/devicetree/bindings/leds/nxp,pca955x.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/leds/nxp,pca955x.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NXP PCA955X LED controllers 8 + 9 + maintainers: 10 + - Nate Case <ncase@xes-inc.com> 11 + 12 + description: | 13 + The PCA955x family of chips are I2C LED blinkers whose pins not used 14 + to control LEDs can be used as general purpose I/Os. The GPIO pins can 15 + be input or output, and output pins can also be pulse-width controlled. 16 + 17 + For more product information please see the link below: 18 + - https://www.nxp.com/docs/en/data-sheet/PCA9552.pdf 19 + 20 + properties: 21 + compatible: 22 + enum: 23 + - nxp,pca9550 24 + - nxp,pca9551 25 + - nxp,pca9552 26 + - ibm,pca9552 27 + - nxp,pca9553 28 + 29 + reg: 30 + maxItems: 1 31 + 32 + "#address-cells": 33 + const: 1 34 + 35 + "#size-cells": 36 + const: 0 37 + 38 + gpio-controller: true 39 + 40 + gpio-line-names: 41 + minItems: 1 42 + maxItems: 16 43 + 44 + "#gpio-cells": 45 + const: 2 46 + 47 + patternProperties: 48 + "^led@[0-9a-f]$": 49 + type: object 50 + $ref: common.yaml# 51 + unevaluatedProperties: false 52 + 53 + properties: 54 + reg: 55 + maxItems: 1 56 + type: 57 + description: | 58 + Output configuration, see include/dt-bindings/leds/leds-pca955x.h 59 + $ref: /schemas/types.yaml#/definitions/uint32 60 + default: 0 61 + minimum: 0 62 + maximum: 2 63 + 64 + required: 65 + - reg 66 + 67 + allOf: 68 + - if: 69 + properties: 70 + compatible: 71 + contains: 72 + enum: 73 + - nxp,pca9550 74 + then: 75 + patternProperties: 76 + "^led@[0-9a-f]$": 77 + properties: 78 + reg: 79 + maximum: 1 80 + - if: 81 + properties: 82 + compatible: 83 + contains: 84 + enum: 85 + - nxp,pca9551 86 + then: 87 + patternProperties: 88 + "^led@[0-9a-f]$": 89 + properties: 90 + reg: 91 + maximum: 7 92 + - if: 93 + properties: 94 + compatible: 95 + contains: 96 + enum: 97 + - nxp,pca9552 98 + - ibm,pca9552 99 + then: 100 + patternProperties: 101 + "^led@[0-9a-f]$": 102 + properties: 103 + reg: 104 + maximum: 15 105 + - if: 106 + properties: 107 + compatible: 108 + contains: 109 + enum: 110 + - nxp,pca9553 111 + then: 112 + patternProperties: 113 + "^led@[0-9a-f]$": 114 + properties: 115 + reg: 116 + maximum: 3 117 + 118 + additionalProperties: false 119 + 120 + examples: 121 + - | 122 + #include <dt-bindings/leds/leds-pca955x.h> 123 + 124 + i2c { 125 + #address-cells = <1>; 126 + #size-cells = <0>; 127 + 128 + led-controller@60 { 129 + compatible = "nxp,pca9552"; 130 + reg = <0x60>; 131 + #address-cells = <1>; 132 + #size-cells = <0>; 133 + 134 + led@0 { 135 + reg = <0>; 136 + label = "red:power"; 137 + linux,default-trigger = "default-on"; 138 + type = <PCA955X_TYPE_LED>; 139 + }; 140 + led@1 { 141 + reg = <1>; 142 + label = "green:power"; 143 + type = <PCA955X_TYPE_LED>; 144 + }; 145 + led@2 { 146 + reg = <2>; 147 + label = "pca9552:yellow"; 148 + type = <PCA955X_TYPE_LED>; 149 + }; 150 + led@3 { 151 + reg = <3>; 152 + label = "pca9552:white"; 153 + type = <PCA955X_TYPE_LED>; 154 + }; 155 + }; 156 + }; 157 + 158 + ...