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

dt-bindings: leds: as3645: Convert to DT schema

Convert the ams,as3645a.txt to DT Schema format.

Signed-off-by: Harrison Carter <hcarter@thegoodpenguin.co.uk>
Reviewed-by: "Rob Herring (Arm)" <robh@kernel.org>
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Harrison Carter and committed by
Lee Jones
64826db1 ef381e17

+130 -85
-85
Documentation/devicetree/bindings/leds/ams,as3645a.txt
··· 1 - Analog devices AS3645A device tree bindings 2 - 3 - The AS3645A flash LED controller can drive two LEDs, one high current 4 - flash LED and one indicator LED. The high current flash LED can be 5 - used in torch mode as well. 6 - 7 - Ranges below noted as [a, b] are closed ranges between a and b, i.e. a 8 - and b are included in the range. 9 - 10 - Please also see common.txt in the same directory. 11 - 12 - 13 - Required properties 14 - =================== 15 - 16 - compatible : Must be "ams,as3645a". 17 - reg : The I2C address of the device. Typically 0x30. 18 - #address-cells : 1 19 - #size-cells : 0 20 - 21 - 22 - Required properties of the flash child node (0) 23 - =============================================== 24 - 25 - reg: 0 26 - flash-timeout-us: Flash timeout in microseconds. The value must be in 27 - the range [100000, 850000] and divisible by 50000. 28 - flash-max-microamp: Maximum flash current in microamperes. Has to be 29 - in the range between [200000, 500000] and 30 - divisible by 20000. 31 - led-max-microamp: Maximum torch (assist) current in microamperes. The 32 - value must be in the range between [20000, 160000] and 33 - divisible by 20000. 34 - ams,input-max-microamp: Maximum flash controller input current. The 35 - value must be in the range [1250000, 2000000] 36 - and divisible by 50000. 37 - 38 - 39 - Optional properties of the flash child node 40 - =========================================== 41 - 42 - function : See Documentation/devicetree/bindings/leds/common.txt. 43 - color : See Documentation/devicetree/bindings/leds/common.txt. 44 - label : See Documentation/devicetree/bindings/leds/common.txt (deprecated). 45 - 46 - 47 - Required properties of the indicator child node (1) 48 - =================================================== 49 - 50 - reg: 1 51 - led-max-microamp: Maximum indicator current. The allowed values are 52 - 2500, 5000, 7500 and 10000. 53 - 54 - Optional properties of the indicator child node 55 - =============================================== 56 - 57 - function : See Documentation/devicetree/bindings/leds/common.txt. 58 - color : See Documentation/devicetree/bindings/leds/common.txt. 59 - label : See Documentation/devicetree/bindings/leds/common.txt (deprecated). 60 - 61 - 62 - Example 63 - ======= 64 - 65 - #include <dt-bindings/leds/common.h> 66 - 67 - as3645a@30 { 68 - #address-cells = <1>; 69 - #size-cells = <0>; 70 - reg = <0x30>; 71 - compatible = "ams,as3645a"; 72 - led@0 { 73 - reg = <0x0>; 74 - flash-timeout-us = <150000>; 75 - flash-max-microamp = <320000>; 76 - led-max-microamp = <60000>; 77 - ams,input-max-microamp = <1750000>; 78 - function = LED_FUNCTION_FLASH; 79 - }; 80 - led@1 { 81 - reg = <0x1>; 82 - led-max-microamp = <10000>; 83 - function = LED_FUNCTION_INDICATOR; 84 - }; 85 - };
+130
Documentation/devicetree/bindings/leds/ams,as3645a.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/ams,as3645a.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Analog Devices AS3645A LED Controller 8 + 9 + maintainers: 10 + - Sakari Ailus <sakari.ailus@iki.fi> 11 + 12 + description: 13 + The AS3645A flash LED controller can drive two LEDs, one 14 + high current flash LED and one indicator LED. The high 15 + current flash LED can be used in torch mode as well. 16 + 17 + properties: 18 + compatible: 19 + const: ams,as3645a 20 + 21 + "#address-cells": 22 + const: 1 23 + 24 + "#size-cells": 25 + const: 0 26 + 27 + reg: 28 + maxItems: 1 29 + 30 + led@0: 31 + description: led0 describes the 'flash' feature 32 + type: object 33 + $ref: common.yaml# 34 + unevaluatedProperties: false 35 + 36 + properties: 37 + reg: 38 + const: 0 39 + 40 + flash-timeout-us: 41 + minimum: 100000 42 + maximum: 850000 43 + multipleOf: 50000 44 + 45 + flash-max-microamp: 46 + minimum: 200000 47 + maximum: 500000 48 + multipleOf: 20000 49 + 50 + led-max-microamp: 51 + minimum: 20000 52 + maximum: 160000 53 + multipleOf: 20000 54 + description: 55 + Maximum current when in torch (assist) mode. 56 + 57 + ams,input-max-microamp: 58 + minimum: 1250000 59 + maximum: 2000000 60 + multipleOf: 50000 61 + 62 + required: 63 + - reg 64 + - flash-timeout-us 65 + - flash-max-microamp 66 + - led-max-microamp 67 + - ams,input-max-microamp 68 + 69 + led@1: 70 + description: led1 describes the 'indicator' feature 71 + type: object 72 + $ref: common.yaml# 73 + unevaluatedProperties: false 74 + 75 + properties: 76 + reg: 77 + const: 1 78 + 79 + led-max-microamp: 80 + enum: 81 + - 2500 82 + - 5000 83 + - 7500 84 + - 10000 85 + description: 86 + Maximum indicator current. 87 + 88 + required: 89 + - reg 90 + - led-max-microamp 91 + 92 + required: 93 + - compatible 94 + - reg 95 + - "#size-cells" 96 + - "#address-cells" 97 + 98 + additionalProperties: false 99 + 100 + examples: 101 + - | 102 + #include <dt-bindings/leds/common.h> 103 + 104 + i2c{ 105 + #address-cells = <1>; 106 + #size-cells = <0>; 107 + 108 + led-controller@30 { 109 + compatible = "ams,as3645a"; 110 + #address-cells = <1>; 111 + #size-cells = <0>; 112 + reg = <0x30>; 113 + 114 + led@0 { 115 + reg = <0>; 116 + flash-timeout-us = <150000>; 117 + flash-max-microamp = <320000>; 118 + led-max-microamp = <60000>; 119 + ams,input-max-microamp = <1750000>; 120 + function = LED_FUNCTION_FLASH; 121 + }; 122 + 123 + led@1 { 124 + reg = <1>; 125 + led-max-microamp = <10000>; 126 + function = LED_FUNCTION_INDICATOR; 127 + }; 128 + }; 129 + }; 130 + ...