xref: /freebsd/sys/contrib/device-tree/Bindings/leds/register-bit-led.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1Device Tree Bindings for Register Bit LEDs
2
3Register bit leds are used with syscon multifunctional devices
4where single bits in a certain register can turn on/off a
5single LED. The register bit LEDs appear as children to the
6syscon device, with the proper compatible string. For the
7syscon bindings see:
8Documentation/devicetree/bindings/mfd/syscon.yaml
9
10Each LED is represented as a sub-node of the syscon device. Each
11node's name represents the name of the corresponding LED.
12
13LED sub-node properties:
14
15Required 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
21Optional 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
27  see Documentation/devicetree/bindings/leds/common.txt
28
29Example:
30
31syscon: syscon@10000000 {
32	compatible = "arm,realview-pb1176-syscon", "syscon";
33	reg = <0x10000000 0x1000>;
34
35	led@8.0 {
36		compatible = "register-bit-led";
37		offset = <0x08>;
38		mask = <0x01>;
39		label = "versatile:0";
40		linux,default-trigger = "heartbeat";
41		default-state = "on";
42	};
43	led@8.1 {
44		compatible = "register-bit-led";
45		offset = <0x08>;
46		mask = <0x02>;
47		label = "versatile:1";
48		linux,default-trigger = "mmc0";
49		default-state = "off";
50	};
51	led@8.2 {
52		compatible = "register-bit-led";
53		offset = <0x08>;
54		mask = <0x04>;
55		label = "versatile:2";
56		linux,default-trigger = "cpu0";
57		default-state = "off";
58	};
59	led@8.3 {
60		compatible = "register-bit-led";
61		offset = <0x08>;
62		mask = <0x08>;
63		label = "versatile:3";
64		default-state = "off";
65	};
66	led@8.4 {
67		compatible = "register-bit-led";
68		offset = <0x08>;
69		mask = <0x10>;
70		label = "versatile:4";
71		default-state = "off";
72	};
73	led@8.5 {
74		compatible = "register-bit-led";
75		offset = <0x08>;
76		mask = <0x20>;
77		label = "versatile:5";
78		default-state = "off";
79	};
80	led@8.6 {
81		compatible = "register-bit-led";
82		offset = <0x08>;
83		mask = <0x40>;
84		label = "versatile:6";
85		default-state = "off";
86	};
87	led@8.7 {
88		compatible = "register-bit-led";
89		offset = <0x08>;
90		mask = <0x80>;
91		label = "versatile:7";
92		default-state = "off";
93	};
94};
95