blob: 627b350c5ec3155b5d8e2879f083d45e44b136d4 [file] [log] [blame]
Ezequiel Garcia916fe612016-03-29 17:35:47 -03001/*
2 * Kernel Panic LED Trigger
3 *
4 * Copyright 2016 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11
12#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/leds.h>
15
16static struct led_trigger *trigger;
17
18static long led_panic_blink(int state)
19{
20 led_trigger_event(trigger, state ? LED_FULL : LED_OFF);
21 return 0;
22}
23
24static int __init ledtrig_panic_init(void)
25{
26 led_trigger_register_simple("panic", &trigger);
27 panic_blink = led_panic_blink;
28 return 0;
29}
30device_initcall(ledtrig_panic_init);