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 <asm/system.h>
14 #include <asm/overdrive/overdrive.h>
16 static void mach_led(int position, int value)
21 local_irq_save(flags);
23 reg = readl(OVERDRIVE_CTRL);
29 writel(reg, OVERDRIVE_CTRL);
31 local_irq_restore(flags);
34 #ifdef CONFIG_HEARTBEAT
36 #include <linux/sched.h>
38 /* acts like an actual heart beat -- ie thump-thump-pause... */
39 void heartbeat_od(void)
41 static unsigned cnt = 0, period = 0, dist = 0;
43 if (cnt == 0 || cnt == dist)
45 else if (cnt == 7 || cnt == dist+7)
50 /* The hyperbolic function below modifies the heartbeat period
51 * length in dependency of the current (5min) load. It goes
52 * through the points f(0)=126, f(1)=86, f(5)=51,
54 period = ((672<<FSHIFT)/(5*avenrun[0]+(7<<FSHIFT))) + 30;
58 #endif /* CONFIG_HEARTBEAT */