2 * linux/arch/sh/stboards/led.c
4 * Copyright (C) 2000 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 ST40STB1 HARP and compatible code.
13 #include <asm/harp/harp.h>
15 /* Harp: Flash LD10 (front pannel) connected to EPLD (IC8) */
16 /* Overdrive: Flash LD1 (front panel) connected to EPLD (IC4) */
17 /* Works for HARP and overdrive */
18 static void mach_led(int position
, int value
)
21 ctrl_outl(EPLD_LED_ON
, EPLD_LED
);
23 ctrl_outl(EPLD_LED_OFF
, EPLD_LED
);
27 #ifdef CONFIG_HEARTBEAT
29 #include <linux/sched.h>
31 /* acts like an actual heart beat -- ie thump-thump-pause... */
32 void heartbeat_harp(void)
34 static unsigned cnt
= 0, period
= 0, dist
= 0;
36 if (cnt
== 0 || cnt
== dist
)
38 else if (cnt
== 7 || cnt
== dist
+7)
43 /* The hyperbolic function below modifies the heartbeat period
44 * length in dependency of the current (5min) load. It goes
45 * through the points f(0)=126, f(1)=86, f(5)=51,
47 period
= ((672<<FSHIFT
)/(5*avenrun
[0]+(7<<FSHIFT
))) + 30;