Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / leds / trigger / ledtrig-mtd.c
blobbbe6876a249d7dd6c5d01f44d0121412e250b05c
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * LED MTD trigger
5 * Copyright 2016 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
7 * Based on LED IDE-Disk Activity Trigger
9 * Copyright 2006 Openedhand Ltd.
11 * Author: Richard Purdie <rpurdie@openedhand.com>
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/leds.h>
18 #define BLINK_DELAY 30
20 DEFINE_LED_TRIGGER(ledtrig_mtd);
21 DEFINE_LED_TRIGGER(ledtrig_nand);
23 void ledtrig_mtd_activity(void)
25 led_trigger_blink_oneshot(ledtrig_mtd, BLINK_DELAY, BLINK_DELAY, 0);
26 led_trigger_blink_oneshot(ledtrig_nand, BLINK_DELAY, BLINK_DELAY, 0);
28 EXPORT_SYMBOL(ledtrig_mtd_activity);
30 static int __init ledtrig_mtd_init(void)
32 led_trigger_register_simple("mtd", &ledtrig_mtd);
33 led_trigger_register_simple("nand-disk", &ledtrig_nand);
35 return 0;
37 device_initcall(ledtrig_mtd_init);