aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/drivers/heartbeat.c
diff options
context:
space:
mode:
authorTakashi YOSHII <takashi.yoshii.ze@hitachi.com>2007-03-12 02:33:22 -0400
committerPaul Mundt <lethal@hera.kernel.org>2007-05-06 22:10:53 -0400
commitf6072896e3f4c577db7e3a06105ebdfd52d7e7c9 (patch)
tree7b597df6cd926953c8898a4c0ca121095d2da061 /arch/sh/drivers/heartbeat.c
parentf987fc880d191bf2ef66ac17e9d524aee6afa02e (diff)
sh: heartbeat double 0 fix.
This implements stricter and more compliant knightrider strobing in the heartbeat handler. While there still seems to be some debate as to whether the double 0 is "more" correct or not, this updated version appears to have general consensus. Fixes a long-term "bug". Signed-off-by: Takashi YOSHII <takashi.yoshii.ze@hitachi.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/drivers/heartbeat.c')
-rw-r--r--arch/sh/drivers/heartbeat.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/arch/sh/drivers/heartbeat.c b/arch/sh/drivers/heartbeat.c
index bc59cb6cd78b..23dd6080422f 100644
--- a/arch/sh/drivers/heartbeat.c
+++ b/arch/sh/drivers/heartbeat.c
@@ -40,16 +40,9 @@ static void heartbeat_timer(unsigned long data)
40 static unsigned bit = 0, up = 1; 40 static unsigned bit = 0, up = 1;
41 41
42 ctrl_outw(1 << hd->bit_pos[bit], (unsigned long)hd->base); 42 ctrl_outw(1 << hd->bit_pos[bit], (unsigned long)hd->base);
43 if (up) 43 bit += up;
44 if (bit == (ARRAY_SIZE(hd->bit_pos) - 1)) { 44 if ((bit == 0) || (bit == ARRAY_SIZE(hd->bit_pos)-1))
45 bit--; 45 up = -up;
46 up = 0;
47 } else
48 bit++;
49 else if (bit == 0)
50 up = 1;
51 else
52 bit--;
53 46
54 mod_timer(&hd->timer, jiffies + (110 - ((300 << FSHIFT) / 47 mod_timer(&hd->timer, jiffies + (110 - ((300 << FSHIFT) /
55 ((avenrun[0] / 5) + (3 << FSHIFT))))); 48 ((avenrun[0] / 5) + (3 << FSHIFT)))));