diff --git a/Documentation/devicetree/bindings/leds/common.rst b/Documentation/devicetree/bindings/leds/common.rst index 5a592d6..911a55f 100644 --- a/Documentation/devicetree/bindings/leds/common.rst +++ b/Documentation/devicetree/bindings/leds/common.rst @@ -12,3 +12,6 @@ * ``label``: The label for this LED. If omitted, the label is taken from the node name (excluding the unit address). + +* ``panic-indicator`` - This property specifies that the LED should be used as a + panic indicator. diff --git a/drivers/led/core.c b/drivers/led/core.c index 4bf19ab..e727148 100644 --- a/drivers/led/core.c +++ b/drivers/led/core.c @@ -286,11 +286,16 @@ void led_of_parse_trigger(struct led *led, struct device_node *np) { - enum led_trigger trg; + enum led_trigger trg = LED_TRIGGER_MAX; const char *trigger; - trigger = of_get_property(np, "linux,default-trigger", NULL); - trg = trigger_by_name(trigger); + if (of_property_read_bool(np, "panic-indicator")) + trg = LED_TRIGGER_PANIC; + + if (trg == LED_TRIGGER_MAX) { + trigger = of_get_property(np, "linux,default-trigger", NULL); + trg = trigger_by_name(trigger); + } if (trg == LED_TRIGGER_MAX) { trigger = of_get_property(np, "barebox,default-trigger", NULL);