public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: linux-arm-kernel@lists.arm.linux.org.uk
Cc: linux-omap@vger.kernel.org, Kevin Hilman <khilman@mvista.com>,
	Tim Bird <tim.bird@am.sony.com>, Tony Lindgren <tony@atomide.com>
Subject: [PATCH 1/6] ARM: OMAP: Fix clockevent support for hrtimers
Date: Thu, 13 Mar 2008 17:45:14 +0200	[thread overview]
Message-ID: <1205423119-22292-2-git-send-email-tony@atomide.com> (raw)
In-Reply-To: <1205423119-22292-1-git-send-email-tony@atomide.com>

From: Kevin Hilman <khilman@mvista.com>

One-shot mode was broken in MPU-timer support for OMAP1 due to a typo.

Also, ensure timer is stopped before changing the auto-reload flag.
The TRM says changing the AR flag when timer is running is undefined.

Also set GENERIC_CLOCKEVENTS for all omaps.

Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Kevin Hilman <khilman@mvista.com.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/Kconfig           |    1 +
 arch/arm/mach-omap1/time.c |   10 +++++++++-
 arch/arm/plat-omap/Kconfig |    1 -
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 955fc53..4039a13 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -469,6 +469,7 @@ config ARCH_OMAP
 	bool "TI OMAP"
 	select GENERIC_GPIO
 	select GENERIC_TIME
+	select GENERIC_CLOCKEVENTS
 	help
 	  Support for TI's OMAP platform (OMAP1 and OMAP2).
 
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 237651e..572a2db 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -132,13 +132,20 @@ static inline void omap_mpu_timer_start(int nr, unsigned long load_val,
 	timer->cntl = timerflags;
 }
 
+static inline void omap_mpu_timer_stop(int nr)
+{
+	volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
+
+	timer->cntl &= ~MPU_TIMER_ST;
+}
+
 /*
  * ---------------------------------------------------------------------------
  * MPU timer 1 ... count down to zero, interrupt, reload
  * ---------------------------------------------------------------------------
  */
 static int omap_mpu_set_next_event(unsigned long cycles,
-				    struct clock_event_device *evt)
+				   struct clock_event_device *evt)
 {
 	omap_mpu_timer_start(0, cycles, 0);
 	return 0;
@@ -152,6 +159,7 @@ static void omap_mpu_set_mode(enum clock_event_mode mode,
 		omap_mpu_set_autoreset(0);
 		break;
 	case CLOCK_EVT_MODE_ONESHOT:
+		omap_mpu_timer_stop(0);
 		omap_mpu_remove_autoreset(0);
 		break;
 	case CLOCK_EVT_MODE_UNUSED:
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index c1f7e5a..b917206 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -11,7 +11,6 @@ choice
 
 config ARCH_OMAP1
 	bool "TI OMAP1"
-	select GENERIC_CLOCKEVENTS
 
 config ARCH_OMAP2
 	bool "TI OMAP2"
-- 
1.5.3.6


  reply	other threads:[~2008-03-13 15:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 15:45 [PATCH 0/6] Few more omap fixes for 2.6.25 Tony Lindgren
2008-03-13 15:45 ` Tony Lindgren [this message]
2008-03-13 15:45   ` [PATCH 2/6] ARM: OMAP: Fix GPIO IRQ unmask Tony Lindgren
2008-03-13 15:45     ` [PATCH 3/6] ARM: OMAP: Fix missing makefile options Tony Lindgren
2008-03-13 15:45       ` [PATCH 4/6] ARM: OMAP: Fix chain_a_transfer return value Tony Lindgren
2008-03-13 15:45         ` [PATCH 5/6] ARM: OMAP: Fix DMA CLINK mask, clear spurious interrupt Tony Lindgren
2008-03-13 15:45           ` [PATCH 6/6] ARM: OMAP1: Fix typo in OMAP1 MPU clock source initialization Tony Lindgren
2008-03-20 14:43   ` [PATCH 1/6] ARM: OMAP: Fix clockevent support for hrtimers Russell King - ARM Linux
2008-03-20 15:03     ` Tony Lindgren
2008-03-13 23:19 ` [PATCH 0/6] Few more omap fixes for 2.6.25 Russell King - ARM Linux
2008-03-14  8:42   ` 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=1205423119-22292-2-git-send-email-tony@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=tim.bird@am.sony.com \
    /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