1LEDs connected to GPIO lines 2 3Required properties: 4- compatible : should be "gpio-leds". 5 6Each LED is represented as a sub-node of the gpio-leds device. Each 7node's name represents the name of the corresponding LED. 8 9LED sub-node properties: 10- gpios : Should specify the LED's GPIO, see "gpios property" in 11 Documentation/devicetree/bindings/gpio/gpio.txt. Active low LEDs should be 12 indicated using flags in the GPIO specifier. 13- function : (optional) 14 see Documentation/devicetree/bindings/leds/common.txt 15- color : (optional) 16 see Documentation/devicetree/bindings/leds/common.txt 17- label : (optional) 18 see Documentation/devicetree/bindings/leds/common.txt (deprecated) 19- linux,default-trigger : (optional) 20 see Documentation/devicetree/bindings/leds/common.txt 21- default-state: (optional) The initial state of the LED. 22 see Documentation/devicetree/bindings/leds/common.txt 23- retain-state-suspended: (optional) The suspend state can be retained.Such 24 as charge-led gpio. 25- retain-state-shutdown: (optional) Retain the state of the LED on shutdown. 26 Useful in BMC systems, for example when the BMC is rebooted while the host 27 remains up. 28- panic-indicator : (optional) 29 see Documentation/devicetree/bindings/leds/common.txt 30 31Examples: 32 33#include <dt-bindings/gpio/gpio.h> 34#include <dt-bindings/leds/common.h> 35 36leds { 37 compatible = "gpio-leds"; 38 led0 { 39 gpios = <&mcu_pio 0 GPIO_ACTIVE_LOW>; 40 linux,default-trigger = "disk-activity"; 41 function = LED_FUNCTION_DISK; 42 }; 43 44 led1 { 45 gpios = <&mcu_pio 1 GPIO_ACTIVE_HIGH>; 46 /* Keep LED on if BIOS detected hardware fault */ 47 default-state = "keep"; 48 function = LED_FUNCTION_FAULT; 49 }; 50}; 51 52run-control { 53 compatible = "gpio-leds"; 54 led0 { 55 gpios = <&mpc8572 6 GPIO_ACTIVE_HIGH>; 56 color = <LED_COLOR_ID_RED>; 57 default-state = "off"; 58 }; 59 led1 { 60 gpios = <&mpc8572 7 GPIO_ACTIVE_HIGH>; 61 color = <LED_COLOR_ID_GREEN>; 62 default-state = "on"; 63 }; 64}; 65 66leds { 67 compatible = "gpio-leds"; 68 69 led0 { 70 gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; 71 linux,default-trigger = "max8903-charger-charging"; 72 retain-state-suspended; 73 function = LED_FUNCTION_CHARGE; 74 }; 75}; 76