From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/5] clocksource: h8300: Change to overflow interrupt
Date: Sat, 5 Dec 2015 02:48:14 +0900 [thread overview]
Message-ID: <1449251298-29933-2-git-send-email-ysato@users.sourceforge.jp> (raw)
In-Reply-To: <1449251298-29933-1-git-send-email-ysato@users.sourceforge.jp>
Counter overflow detection use for overflow interrupt
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
drivers/clocksource/h8300_timer16.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/clocksource/h8300_timer16.c b/drivers/clocksource/h8300_timer16.c
index fc14a3f..b14a8da 100644
--- a/drivers/clocksource/h8300_timer16.c
+++ b/drivers/clocksource/h8300_timer16.c
@@ -14,7 +14,6 @@
#include <linux/of_irq.h>
#define TSTR 0
-#define TISRA 4
#define TISRC 6
#define TCR 0
@@ -27,9 +26,8 @@ struct timer16_priv {
void __iomem *mapcommon;
unsigned short cs_enabled;
unsigned char enb;
- unsigned char imfa;
- unsigned char imiea;
unsigned char ovf;
+ unsigned char ovie;
struct clk *clk;
};
@@ -59,8 +57,8 @@ static irqreturn_t timer16_interrupt(int irq, void *dev_id)
{
struct timer16_priv *p = (struct timer16_priv *)dev_id;
- writeb(readb(p->mapcommon + TISRA) & ~p->imfa,
- p->mapcommon + TISRA);
+ writeb(readb(p->mapcommon + TISRC) & ~p->ovf,
+ p->mapcommon + TISRC);
p->total_cycles += 0x10000;
return IRQ_HANDLED;
@@ -93,6 +91,8 @@ static int timer16_enable(struct clocksource *cs)
writeb(0x83, p->mapbase + TCR);
writeb(readb(p->mapcommon + TSTR) | p->enb,
p->mapcommon + TSTR);
+ writeb(readb(p->mapcommon + TISRC) | p->ovie,
+ p->mapcommon + TSTR);
p->cs_enabled = true;
return 0;
@@ -161,8 +161,8 @@ static void __init h8300_16timer_init(struct device_node *node)
timer16_priv.mapbase = base[REG_CH];
timer16_priv.mapcommon = base[REG_COMM];
timer16_priv.enb = 1 << ch;
- timer16_priv.imfa = 1 << ch;
- timer16_priv.imiea = 1 << (4 + ch);
+ timer16_priv.ovf = 1 << ch;
+ timer16_priv.ovie = 1 << (4 + ch);
ret = request_irq(irq, timer16_interrupt,
IRQF_TIMER, timer16_priv.cs.name, &timer16_priv);
--
2.6.1
next prev parent reply other threads:[~2015-12-04 17:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-04 5:56 [PATCH 0/5] clocksource: h8300: driver update Yoshinori Sato
2015-12-04 5:56 ` [PATCH 1/5] clocksource: h8300: Change to overflow interrupt Yoshinori Sato
2015-12-04 5:56 ` [PATCH 2/5] clocksource: h8300: Fix timer not overflow case Yoshinori Sato
2015-12-04 5:56 ` [PATCH 3/5] clocksource: h8300: Simplify delta handling Yoshinori Sato
2015-12-04 5:56 ` [PATCH 4/5] clocksource: h8300: Initializer cleanup Yoshinori Sato
2015-12-04 5:56 ` [PATCH 5/5] clocksource: h8300: Use ioread / iowrite Yoshinori Sato
2015-12-04 14:38 ` kbuild test robot
2015-12-04 17:48 ` [PATCH v2 0/5] h8300 clocksource update Yoshinori Sato
2015-12-04 17:48 ` Yoshinori Sato [this message]
2015-12-04 17:48 ` [PATCH v2 2/5] clocksource: h8300: Fix timer not overflow case Yoshinori Sato
2015-12-04 17:48 ` [PATCH v2 3/5] clocksource: h8300: Simplify delta handling Yoshinori Sato
2015-12-04 17:48 ` [PATCH v2 4/5] clocksource: h8300: Initializer cleanup Yoshinori Sato
2015-12-04 17:48 ` [PATCH v2 5/5] h8300: clocksource: Use ioread / iowrite Yoshinori Sato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1449251298-29933-2-git-send-email-ysato@users.sourceforge.jp \
--to=ysato@users.sourceforge.jp \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.