Add an LED trigger acts like a heart beat. This can be used as a
replacement of CONFIG_HEARTBEAT code exists in some arch's timer code.
Signed-off-by: Atsushi Nemoto <anemo@xxxxxxxxxxxxx>
new file mode 100644
index 0000000..07ac645
--- /dev/null
+++ b/drivers/leds/ledtrig-heartbeat.c
+ heartbeat_data->period = heartbeat_data->period * HZ / 100;
+ delay = 7 * HZ / 100;
+static void heartbeat_trig_activate(struct led_classdev *led_cdev)
+{
+ struct heartbeat_trig_data *heartbeat_data;
+
+ heartbeat_data = kzalloc(sizeof(*heartbeat_data), GFP_KERNEL);
+ if (!heartbeat_data)
+ return;
+
+ led_cdev->trigger_data = heartbeat_data;
+ init_timer(&heartbeat_data->timer);
+ heartbeat_data->timer.function = led_heartbeat_function;
+ heartbeat_data->timer.data = (unsigned long) led_cdev;