2 * linux/arch/sh/overdrive/led.c
4 * Copyright (C) 1999 Stuart Menefy <stuart.menefy@st.com>
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
9 * This file contains an Overdrive specific LED feature.
12 #include <linux/config.h>
13 #include <asm/system.h>
15 #include <asm/overdrive/overdrive.h>
17 static void mach_led(int position, int value)
22 local_irq_save(flags);
24 reg = readl(OVERDRIVE_CTRL);
30 writel(reg, OVERDRIVE_CTRL);
32 local_irq_restore(flags);
35 #ifdef CONFIG_HEARTBEAT
37 #include <linux/sched.h>
39 /* acts like an actual heart beat -- ie thump-thump-pause... */
40 void heartbeat_od(void)
42 static unsigned cnt = 0, period = 0, dist = 0;
44 if (cnt == 0 || cnt == dist)
46 else if (cnt == 7 || cnt == dist+7)
51 /* The hyperbolic function below modifies the heartbeat period
52 * length in dependency of the current (5min) load. It goes
53 * through the points f(0)=126, f(1)=86, f(5)=51,
55 period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
59 #endif /* CONFIG_HEARTBEAT */