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