Commit 2a0ff877 authored by Yoshinori Sato's avatar Yoshinori Sato Committed by Daniel Lezcano

clocksource/drivers/h8300: Change to overflow interrupt

Counter overflow detection use for overflow interrupt
Signed-off-by: default avatarYoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent d662ed20
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <linux/of_irq.h> #include <linux/of_irq.h>
#define TSTR 0 #define TSTR 0
#define TISRA 4
#define TISRC 6 #define TISRC 6
#define TCR 0 #define TCR 0
...@@ -27,9 +26,8 @@ struct timer16_priv { ...@@ -27,9 +26,8 @@ struct timer16_priv {
void __iomem *mapcommon; void __iomem *mapcommon;
unsigned short cs_enabled; unsigned short cs_enabled;
unsigned char enb; unsigned char enb;
unsigned char imfa;
unsigned char imiea;
unsigned char ovf; unsigned char ovf;
unsigned char ovie;
struct clk *clk; struct clk *clk;
}; };
...@@ -59,8 +57,8 @@ static irqreturn_t timer16_interrupt(int irq, void *dev_id) ...@@ -59,8 +57,8 @@ static irqreturn_t timer16_interrupt(int irq, void *dev_id)
{ {
struct timer16_priv *p = (struct timer16_priv *)dev_id; struct timer16_priv *p = (struct timer16_priv *)dev_id;
writeb(readb(p->mapcommon + TISRA) & ~p->imfa, writeb(readb(p->mapcommon + TISRC) & ~p->ovf,
p->mapcommon + TISRA); p->mapcommon + TISRC);
p->total_cycles += 0x10000; p->total_cycles += 0x10000;
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -93,6 +91,8 @@ static int timer16_enable(struct clocksource *cs) ...@@ -93,6 +91,8 @@ static int timer16_enable(struct clocksource *cs)
writeb(0x83, p->mapbase + TCR); writeb(0x83, p->mapbase + TCR);
writeb(readb(p->mapcommon + TSTR) | p->enb, writeb(readb(p->mapcommon + TSTR) | p->enb,
p->mapcommon + TSTR); p->mapcommon + TSTR);
writeb(readb(p->mapcommon + TISRC) | p->ovie,
p->mapcommon + TSTR);
p->cs_enabled = true; p->cs_enabled = true;
return 0; return 0;
...@@ -161,8 +161,8 @@ static void __init h8300_16timer_init(struct device_node *node) ...@@ -161,8 +161,8 @@ static void __init h8300_16timer_init(struct device_node *node)
timer16_priv.mapbase = base[REG_CH]; timer16_priv.mapbase = base[REG_CH];
timer16_priv.mapcommon = base[REG_COMM]; timer16_priv.mapcommon = base[REG_COMM];
timer16_priv.enb = 1 << ch; timer16_priv.enb = 1 << ch;
timer16_priv.imfa = 1 << ch; timer16_priv.ovf = 1 << ch;
timer16_priv.imiea = 1 << (4 + ch); timer16_priv.ovie = 1 << (4 + ch);
ret = request_irq(irq, timer16_interrupt, ret = request_irq(irq, timer16_interrupt,
IRQF_TIMER, timer16_priv.cs.name, &timer16_priv); IRQF_TIMER, timer16_priv.cs.name, &timer16_priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment