-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mtd-nand-trigger' of git://git.kernel.org/pub/scm/linux…
…/kernel/git/j.anaszewski/linux-leds into nand/next Pull leds-trigger changes from Jacek Anaszewski. Create a generic mtd led-trigger to replace the exisitng nand led-trigger implementation. * 'mtd-nand-trigger' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: mtd: Hook I/O activity to the MTD LED trigger mtd: nand: Remove the "nand-disk" LED trigger leds: trigger: Introduce a MTD (NAND/NOR) trigger mtd: Uninline mtd_write_oob and move it to mtdcore.c leds: trigger: Introduce a kernel panic LED trigger
- Loading branch information
Showing
8 changed files
with
119 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o | ||
obj-$(CONFIG_LEDS_TRIGGER_ONESHOT) += ledtrig-oneshot.o | ||
obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o | ||
obj-$(CONFIG_LEDS_TRIGGER_MTD) += ledtrig-mtd.o | ||
obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o | ||
obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.o | ||
obj-$(CONFIG_LEDS_TRIGGER_GPIO) += ledtrig-gpio.o | ||
obj-$(CONFIG_LEDS_TRIGGER_CPU) += ledtrig-cpu.o | ||
obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o | ||
obj-$(CONFIG_LEDS_TRIGGER_TRANSIENT) += ledtrig-transient.o | ||
obj-$(CONFIG_LEDS_TRIGGER_CAMERA) += ledtrig-camera.o | ||
obj-$(CONFIG_LEDS_TRIGGER_PANIC) += ledtrig-panic.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* LED MTD trigger | ||
* | ||
* Copyright 2016 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> | ||
* | ||
* Based on LED IDE-Disk Activity Trigger | ||
* | ||
* Copyright 2006 Openedhand Ltd. | ||
* | ||
* Author: Richard Purdie <rpurdie@openedhand.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/init.h> | ||
#include <linux/leds.h> | ||
|
||
#define BLINK_DELAY 30 | ||
|
||
DEFINE_LED_TRIGGER(ledtrig_mtd); | ||
DEFINE_LED_TRIGGER(ledtrig_nand); | ||
|
||
void ledtrig_mtd_activity(void) | ||
{ | ||
unsigned long blink_delay = BLINK_DELAY; | ||
|
||
led_trigger_blink_oneshot(ledtrig_mtd, | ||
&blink_delay, &blink_delay, 0); | ||
led_trigger_blink_oneshot(ledtrig_nand, | ||
&blink_delay, &blink_delay, 0); | ||
} | ||
EXPORT_SYMBOL(ledtrig_mtd_activity); | ||
|
||
static int __init ledtrig_mtd_init(void) | ||
{ | ||
led_trigger_register_simple("mtd", &ledtrig_mtd); | ||
led_trigger_register_simple("nand-disk", &ledtrig_nand); | ||
|
||
return 0; | ||
} | ||
device_initcall(ledtrig_mtd_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Kernel Panic LED Trigger | ||
* | ||
* Copyright 2016 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/init.h> | ||
#include <linux/leds.h> | ||
|
||
static struct led_trigger *trigger; | ||
|
||
static long led_panic_blink(int state) | ||
{ | ||
led_trigger_event(trigger, state ? LED_FULL : LED_OFF); | ||
return 0; | ||
} | ||
|
||
static int __init ledtrig_panic_init(void) | ||
{ | ||
led_trigger_register_simple("panic", &trigger); | ||
panic_blink = led_panic_blink; | ||
return 0; | ||
} | ||
device_initcall(ledtrig_panic_init); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters