public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Kevin Hilman <khilman@mvista.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.arm.linux.org.uk
Subject: Re: [PATCH 12/14] ARM: OMAP1: Timer32K: Fix timer32K for clockevents and clean it up, take #2
Date: Tue, 25 Mar 2008 12:09:41 +0200	[thread overview]
Message-ID: <20080325100940.GQ14978@atomide.com> (raw)
In-Reply-To: <20080321120425.GA3732@flint.arm.linux.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

* Russell King - ARM Linux <linux@arm.linux.org.uk> [080321 14:05]:
> On Thu, Mar 20, 2008 at 11:25:52AM -0700, Kevin Hilman wrote:
> > Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
> > 
> > > On Mon, Mar 17, 2008 at 11:42:36AM +0200, Tony Lindgren wrote:
> > >> This patch fixes timer32k for clockevents and syncs it with
> > >> linux-omap tree.
> > >> 
> > >> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > >> ---
> > >>  arch/arm/mach-omap1/timer32k.c |   20 ++++++++++++++------
> > >>  1 files changed, 14 insertions(+), 6 deletions(-)
> > >> 
> > >>...
> > >> @@ -126,9 +131,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode,
> > >>  
> > >>  	switch (mode) {
> > >>  	case CLOCK_EVT_MODE_PERIODIC:
> > >> +	case CLOCK_EVT_MODE_ONESHOT:
> > >>  		omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD);
> > >>  		break;
> > >> -	case CLOCK_EVT_MODE_ONESHOT:
> > >
> > > I didn't think an event was supposed to be programmed to fire when one
> > > shot mode is selected - from the other implementations, it appears that
> > > the timer should be disabled until set_next_event() has been called.
> > 
> > That is correct.  The 'start' should only be happening for the
> > periodic mode.  This following change should be done.
> 
> Or just omit the bogus change from the original patch.

OK, here's the fixed patch.

Tony

[-- Attachment #2: omap-timer32k-clockevent.patch --]
[-- Type: text/x-diff, Size: 2212 bytes --]

>From c23b8d7f1a25aea1452a0d94799c62bba154edfc Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Thu, 13 Mar 2008 08:47:21 +0200
Subject: [PATCH] ARM: OMAP1: Timer32K: Fix timer32K for clockevents and clean it up

This patch fixes timer32k for clockevents and syncs it with
linux-omap tree.

Signed-off-by: Tony Lindgren <tony@atomide.com>

diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 1f7365f..fbbdb80 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -1,5 +1,5 @@
 /*
- * linux/arch/arm/plat-omap/timer32k.c
+ * linux/arch/arm/mach-omap1/timer32k.c
  *
  * OMAP 32K Timer
  *
@@ -40,7 +40,6 @@
 #include <linux/interrupt.h>
 #include <linux/sched.h>
 #include <linux/spinlock.h>
-
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/clocksource.h>
@@ -71,8 +70,6 @@ struct sys_timer omap_timer;
 
 #if defined(CONFIG_ARCH_OMAP16XX)
 #define TIMER_32K_SYNCHRONIZED		0xfffbc410
-#elif defined(CONFIG_ARCH_OMAP24XX)
-#define TIMER_32K_SYNCHRONIZED		(OMAP24XX_32KSYNCT_BASE + 0x10)
 #else
 #error OMAP 32KHz timer does not currently work on 15XX!
 #endif
@@ -119,6 +116,14 @@ static inline void omap_32k_timer_stop(void)
 
 #define omap_32k_timer_ack_irq()
 
+static int omap_32k_timer_set_next_event(unsigned long delta,
+					 struct clock_event_device *dev)
+{
+	omap_32k_timer_start(delta);
+
+	return 0;
+}
+
 static void omap_32k_timer_set_mode(enum clock_event_mode mode,
 				    struct clock_event_device *evt)
 {
@@ -139,8 +144,9 @@ static void omap_32k_timer_set_mode(enum clock_event_mode mode,
 
 static struct clock_event_device clockevent_32k_timer = {
 	.name		= "32k-timer",
-	.features       = CLOCK_EVT_FEAT_PERIODIC,
+	.features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
 	.shift		= 32,
+	.set_next_event	= omap_32k_timer_set_next_event,
 	.set_mode	= omap_32k_timer_set_mode,
 };
 
@@ -171,6 +177,8 @@ static struct irqaction omap_32k_timer_irq = {
 
 static __init void omap_init_32k_timer(void)
 {
+	setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
+
 	clockevent_32k_timer.mult = div_sc(OMAP_32K_TICKS_PER_SEC,
 					   NSEC_PER_SEC,
 					   clockevent_32k_timer.shift);

  reply	other threads:[~2008-03-25 10:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17  9:42 [PATCH 0/14] Omap patches for post 2.6.25 Tony Lindgren
2008-03-17  9:42 ` [PATCH 1/14] ARM: OMAP: Use gpiolib Tony Lindgren
2008-03-17  9:42   ` [PATCH 2/14] ARM: OMAP: 5912 OSK GPIO updates Tony Lindgren
2008-03-17  9:42     ` [PATCH 3/14] ARM: OMAP: I2C: tps65010 driver converts to gpiolib Tony Lindgren
2008-03-17  9:42       ` [PATCH 4/14] ARM: OMAP: Use gpiolib with tps65010 for OSK 5912 Tony Lindgren
2008-03-17  9:42         ` [PATCH 5/14] ARM: OMAP: Clear level-triggered GPIO interrupts in unmask hook Tony Lindgren
2008-03-17  9:42           ` [PATCH 6/14] ARM: OMAP: use edge/level handlers from generic IRQ framework Tony Lindgren
2008-03-17  9:42             ` [PATCH 7/14] ARM: OMAP: Allow registering pin mux function Tony Lindgren
2008-03-17  9:42               ` [PATCH 8/14] ARM: OMAP: Split omap_cfg_reg() into omap processor specific functions Tony Lindgren
2008-03-17  9:42                 ` [PATCH 9/14] ARM: OMAP: Timer32K: Re-organize duplicated 32k-timer code Tony Lindgren
2008-03-17  9:42                   ` [PATCH 10/14] ARM: OMAP: Timer32K: Move 32k-based sched_clock() to common code Tony Lindgren
2008-03-17  9:42                     ` [PATCH 11/14] ARM: OMAP: Timer32K: Move timer32k to mach-omap1 Tony Lindgren
2008-03-17  9:42                       ` [PATCH 12/14] ARM: OMAP1: Timer32K: Fix timer32K for clockevents and clean it up Tony Lindgren
2008-03-17  9:42                         ` [PATCH 13/14] ARM: OMAP: TimerMPU: Remove unused cycles-to-nsec conversions Tony Lindgren
2008-03-17  9:42                           ` [PATCH 14/14] ARM: OMAP: TimerMPU: Remove MPU-timer based sched_clock() Tony Lindgren
2008-03-20 16:52                         ` [PATCH 12/14] ARM: OMAP1: Timer32K: Fix timer32K for clockevents and clean it up Russell King - ARM Linux
2008-03-20 18:25                           ` Kevin Hilman
2008-03-21 11:38                             ` Thomas Gleixner
2008-03-21 12:04                             ` Russell King - ARM Linux
2008-03-25 10:09                               ` Tony Lindgren [this message]
2008-03-25 22:16                                 ` [PATCH 12/14] ARM: OMAP1: Timer32K: Fix timer32K for clockevents and clean it up, take #2 Russell King - ARM Linux
2008-03-28 12:26                                   ` Tony Lindgren

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=20080325100940.GQ14978@atomide.com \
    --to=tony@atomide.com \
    --cc=khilman@mvista.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox