aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/ledtrig-heartbeat.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-07-17 22:41:50 +0200
committerArnd Bergmann <arnd@arndb.de>2012-07-17 22:41:50 +0200
commit36c678f3c91ac92e9524abcf9b39f9f539d60279 (patch)
treec9c0df006a7e9bcc14492b1d1fa6aa2c5c43d3a3 /drivers/leds/ledtrig-heartbeat.c
parentMerge tag 'omap-devel-am33xx-data-for-v3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/clk (diff)
parentARM: imx: clk-imx31: Fix clock id for rnga driver (diff)
downloadlinux-dev-36c678f3c91ac92e9524abcf9b39f9f539d60279.tar.xz
linux-dev-36c678f3c91ac92e9524abcf9b39f9f539d60279.zip
Merge tag 'imx-clk' of git://git.pengutronix.de/git/imx/linux-2.6 into next/clk
From Sascha Hauer <s.hauer@pengutronix.de>: i.MX clk noncritical fixes and updates * tag 'imx-clk' of git://git.pengutronix.de/git/imx/linux-2.6: ARM: imx: clk-imx31: Fix clock id for rnga driver ARM: imx: add missing item to the list of clock event modes ARM: i.MX5x CSPI: Fixed clock name for CSPI ARM: i.MX5x clocks: Fix GPT clocks ARM: i.MX5x clocks: Fix parent for PWM clocks ARM: i.MX5x clocks: Add EPIT support ARM: mx27: Reenable silicon version print ARM: clk-imx27: Fix rtc clock id Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/leds/ledtrig-heartbeat.c')
-rw-r--r--drivers/leds/ledtrig-heartbeat.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c
index 41dc76db4311..a019fbb70880 100644
--- a/drivers/leds/ledtrig-heartbeat.c
+++ b/drivers/leds/ledtrig-heartbeat.c
@@ -21,6 +21,8 @@
#include <linux/reboot.h>
#include "leds.h"
+static int panic_heartbeats;
+
struct heartbeat_trig_data {
unsigned int phase;
unsigned int period;
@@ -34,6 +36,11 @@ static void led_heartbeat_function(unsigned long data)
unsigned long brightness = LED_OFF;
unsigned long delay = 0;
+ if (unlikely(panic_heartbeats)) {
+ led_set_brightness(led_cdev, LED_OFF);
+ return;
+ }
+
/* acts like an actual heart beat -- ie thump-thump-pause... */
switch (heartbeat_data->phase) {
case 0:
@@ -111,12 +118,19 @@ static int heartbeat_reboot_notifier(struct notifier_block *nb,
return NOTIFY_DONE;
}
+static int heartbeat_panic_notifier(struct notifier_block *nb,
+ unsigned long code, void *unused)
+{
+ panic_heartbeats = 1;
+ return NOTIFY_DONE;
+}
+
static struct notifier_block heartbeat_reboot_nb = {
.notifier_call = heartbeat_reboot_notifier,
};
static struct notifier_block heartbeat_panic_nb = {
- .notifier_call = heartbeat_reboot_notifier,
+ .notifier_call = heartbeat_panic_notifier,
};
static int __init heartbeat_trig_init(void)