Linus Walleij | 741c798 | 2014-05-22 00:35:37 +0200 | [diff] [blame] | 1 | Device Tree Bindings for Register Bit LEDs |
| 2 | |
| 3 | Register bit leds are used with syscon multifunctional devices |
| 4 | where single bits in a certain register can turn on/off a |
| 5 | single LED. The register bit LEDs appear as children to the |
| 6 | syscon device, with the proper compatible string. For the |
| 7 | syscon bindings see: |
| 8 | Documentation/devicetree/bindings/mfd/syscon.txt |
| 9 | |
| 10 | Each LED is represented as a sub-node of the syscon device. Each |
| 11 | node's name represents the name of the corresponding LED. |
| 12 | |
| 13 | LED sub-node properties: |
| 14 | |
| 15 | Required properties: |
| 16 | - compatible : must be "register-bit-led" |
| 17 | - offset : register offset to the register controlling this LED |
| 18 | - mask : bit mask for the bit controlling this LED in the register |
| 19 | typically 0x01, 0x02, 0x04 ... |
| 20 | |
| 21 | Optional properties: |
| 22 | - label : (optional) |
| 23 | see Documentation/devicetree/bindings/leds/common.txt |
| 24 | - linux,default-trigger : (optional) |
| 25 | see Documentation/devicetree/bindings/leds/common.txt |
| 26 | - default-state: (optional) The initial state of the LED. Valid |
| 27 | values are "on", "off", and "keep". If the LED is already on or off |
| 28 | and the default-state property is set the to same value, then no |
| 29 | glitch should be produced where the LED momentarily turns off (or |
| 30 | on). The "keep" setting will keep the LED at whatever its current |
| 31 | state is, without producing a glitch. The default is off if this |
| 32 | property is not present. |
| 33 | |
| 34 | Example: |
| 35 | |
| 36 | syscon: syscon@10000000 { |
| 37 | compatible = "arm,realview-pb1176-syscon", "syscon"; |
| 38 | reg = <0x10000000 0x1000>; |
| 39 | |
| 40 | led@08.0 { |
| 41 | compatible = "register-bit-led"; |
| 42 | offset = <0x08>; |
| 43 | mask = <0x01>; |
| 44 | label = "versatile:0"; |
| 45 | linux,default-trigger = "heartbeat"; |
| 46 | default-state = "on"; |
| 47 | }; |
| 48 | led@08.1 { |
| 49 | compatible = "register-bit-led"; |
| 50 | offset = <0x08>; |
| 51 | mask = <0x02>; |
| 52 | label = "versatile:1"; |
| 53 | linux,default-trigger = "mmc0"; |
| 54 | default-state = "off"; |
| 55 | }; |
| 56 | led@08.2 { |
| 57 | compatible = "register-bit-led"; |
| 58 | offset = <0x08>; |
| 59 | mask = <0x04>; |
| 60 | label = "versatile:2"; |
| 61 | linux,default-trigger = "cpu0"; |
| 62 | default-state = "off"; |
| 63 | }; |
| 64 | led@08.3 { |
| 65 | compatible = "register-bit-led"; |
| 66 | offset = <0x08>; |
| 67 | mask = <0x08>; |
| 68 | label = "versatile:3"; |
| 69 | default-state = "off"; |
| 70 | }; |
| 71 | led@08.4 { |
| 72 | compatible = "register-bit-led"; |
| 73 | offset = <0x08>; |
| 74 | mask = <0x10>; |
| 75 | label = "versatile:4"; |
| 76 | default-state = "off"; |
| 77 | }; |
| 78 | led@08.5 { |
| 79 | compatible = "register-bit-led"; |
| 80 | offset = <0x08>; |
| 81 | mask = <0x20>; |
| 82 | label = "versatile:5"; |
| 83 | default-state = "off"; |
| 84 | }; |
| 85 | led@08.6 { |
| 86 | compatible = "register-bit-led"; |
| 87 | offset = <0x08>; |
| 88 | mask = <0x40>; |
| 89 | label = "versatile:6"; |
| 90 | default-state = "off"; |
| 91 | }; |
| 92 | led@08.7 { |
| 93 | compatible = "register-bit-led"; |
| 94 | offset = <0x08>; |
| 95 | mask = <0x80>; |
| 96 | label = "versatile:7"; |
| 97 | default-state = "off"; |
| 98 | }; |
| 99 | }; |