summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/leds/register-bit-led.txt
blob: c7af6f70a97bf50acd57dcb332506b8486322dc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Device Tree Bindings for Register Bit LEDs

Register bit leds are used with syscon multifunctional devices
where single bits in a certain register can turn on/off a
single LED. The register bit LEDs appear as children to the
syscon device, with the proper compatible string. For the
syscon bindings see:
Documentation/devicetree/bindings/mfd/syscon.yaml

Each LED is represented as a sub-node of the syscon device. Each
node's name represents the name of the corresponding LED.

LED sub-node properties:

Required properties:
- compatible : must be "register-bit-led"
- offset : register offset to the register controlling this LED
- mask : bit mask for the bit controlling this LED in the register
  typically 0x01, 0x02, 0x04 ...

Optional properties:
- label : (optional)
  see Documentation/devicetree/bindings/leds/common.txt
- linux,default-trigger : (optional)
  see Documentation/devicetree/bindings/leds/common.txt
- default-state: (optional) The initial state of the LED
  see Documentation/devicetree/bindings/leds/common.txt

Example:

syscon: syscon@10000000 {
	compatible = "arm,realview-pb1176-syscon", "syscon";
	reg = <0x10000000 0x1000>;

	led@8.0 {
		compatible = "register-bit-led";
		offset = <0x08>;
		mask = <0x01>;
		label = "versatile:0";
		linux,default-trigger = "heartbeat";
		default-state = "on";
	};
	led@8.1 {
		compatible = "register-bit-led";
		offset = <0x08>;
		mask = <0x02>;
		label = "versatile:1";
		linux,default-trigger = "mmc0";
		default-state = "off";
	};
	led@8.2 {
		compatible = "register-bit-led";
		offset = <0x08>;
		mask = <0x04>;
		label = "versatile:2";
		linux,default-trigger = "cpu0";
		default-state = "off";
	};
	led@8.3 {
		compatible = "register-bit-led";
		offset = <0x08>;
		mask = <0x08>;
		label = "versatile:3";
		default-state = "off";
	};
	led@8.4 {
		compatible = "register-bit-led";
		offset = <0x08>;
		mask = <0x10>;
		label = "versatile:4";
		default-state = "off";
	};
	led@8.5 {
		compatible = "register-bit-led";
		offset = <0x08>;
		mask = <0x20>;
		label = "versatile:5";
		default-state = "off";
	};
	led@8.6 {
		compatible = "register-bit-led";
		offset = <0x08>;
		mask = <0x40>;
		label = "versatile:6";
		default-state = "off";
	};
	led@8.7 {
		compatible = "register-bit-led";
		offset = <0x08>;
		mask = <0x80>;
		label = "versatile:7";
		default-state = "off";
	};
};