All of lore.kernel.org
 help / color / mirror / Atom feed
From: dsaxena@linaro.org (Deepak Saxena)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 05/12] ARM: h720x:  Remove LATCH and CLOCK_TICK_RATE dependency
Date: Thu, 4 Aug 2011 06:49:34 -0700	[thread overview]
Message-ID: <20110804134934.GC1019@plexity.net> (raw)
In-Reply-To: <cover.1312455035.git.dsaxena@linaro.org>

As part of work to remove the global CLOCK_TICK_RATE symbol,
this patch defines a sub-arch local value for use by the
h720x code.  Once all LATCH and CLOCK_TICK_RATE references
are removed, we will remove all the definitions across
sub-arches.

Signed-off-by: Deepak Saxena <dsaxena@linaro.org>
---
 arch/arm/mach-h720x/common.c    |    4 +++-
 arch/arm/mach-h720x/common.h    |    3 +++
 arch/arm/mach-h720x/cpu-h7201.c |    2 +-
 arch/arm/mach-h720x/cpu-h7202.c |    2 +-
 4 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-h720x/common.c b/arch/arm/mach-h720x/common.c
index 51d4e44..383c121 100644
--- a/arch/arm/mach-h720x/common.c
+++ b/arch/arm/mach-h720x/common.c
@@ -30,6 +30,8 @@
 
 #include <asm/mach/dma.h>
 
+#include "common.h"
+
 #if 0
 #define IRQDBG(args...) printk(args)
 #else
@@ -46,7 +48,7 @@ void __init arch_dma_init(dma_t *dma)
  */
 unsigned long h720x_gettimeoffset(void)
 {
-	return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / LATCH;
+	return (CPU_REG (TIMER_VIRT, TM0_COUNT) * tick_usec) / H720X_LATCH;
 }
 
 /*
diff --git a/arch/arm/mach-h720x/common.h b/arch/arm/mach-h720x/common.h
index 7dd5fa6..ac32f3c 100644
--- a/arch/arm/mach-h720x/common.h
+++ b/arch/arm/mach-h720x/common.h
@@ -27,3 +27,6 @@ extern void __init h7202_init_time(void);
 #ifdef CONFIG_ARCH_H7201
 extern struct sys_timer h7201_timer;
 #endif
+
+#define H720X_TICK_RATE		3686400
+#define H720X_LATCH		((H720X_TICK_RATE + HZ/2) / HZ)	/* For divider */
diff --git a/arch/arm/mach-h720x/cpu-h7201.c b/arch/arm/mach-h720x/cpu-h7201.c
index 24df2a3..8c2b36d 100644
--- a/arch/arm/mach-h720x/cpu-h7201.c
+++ b/arch/arm/mach-h720x/cpu-h7201.c
@@ -46,7 +46,7 @@ static struct irqaction h7201_timer_irq = {
  */
 void __init h7201_init_time(void)
 {
-	CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
+	CPU_REG (TIMER_VIRT, TM0_PERIOD) = H720X_LATCH;
 	CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
 	CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
 	CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT;
diff --git a/arch/arm/mach-h720x/cpu-h7202.c b/arch/arm/mach-h720x/cpu-h7202.c
index c37d570..c2879af 100644
--- a/arch/arm/mach-h720x/cpu-h7202.c
+++ b/arch/arm/mach-h720x/cpu-h7202.c
@@ -180,7 +180,7 @@ static struct irqaction h7202_timer_irq = {
  */
 void __init h7202_init_time(void)
 {
-	CPU_REG (TIMER_VIRT, TM0_PERIOD) = LATCH;
+	CPU_REG (TIMER_VIRT, TM0_PERIOD) = H720X_LATCH;
 	CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_RESET;
 	CPU_REG (TIMER_VIRT, TM0_CTRL) = TM_REPEAT | TM_START;
 	CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) = ENABLE_TM0_INTR | TIMER_ENABLE_BIT;
-- 
1.7.4.1

  parent reply	other threads:[~2011-08-04 13:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1312455035.git.dsaxena@linaro.org>
2011-08-04 13:44 ` [PATCH 01/12] ARM: Remove LATCH reference for time-acorn.c Deepak Saxena
2011-08-05  9:21   ` Russell King - ARM Linux
2011-08-05  9:23   ` Russell King - ARM Linux
2011-08-05 14:59     ` Deepak Saxena
2011-08-04 13:46 ` [PATCH 02/12] ARM: at91: Remove LATCH and CLOCK_TICK_RATE dependency Deepak Saxena
2011-08-04 13:47 ` [PATCH 03/12] ARM: unicore32: Remove depency on LATCH Deepak Saxena
2011-08-04 13:56   ` Deepak Saxena
2011-08-04 13:49 ` [PATCH 04/12] ARM: clps711x: Remove LATCH and CLOCK_TICK_RATE dependency Deepak Saxena
2011-08-04 13:49 ` Deepak Saxena [this message]
2011-08-04 13:50 ` [PATCH 06/12] ARM: IXP23xx: " Deepak Saxena
2011-08-04 14:03   ` Lennert Buytenhek
2011-08-04 13:50 ` [PATCH 07/12] ARM: IXP4x: " Deepak Saxena
2011-08-04 13:52 ` [PATCH 08/12] ARM: ks8695: " Deepak Saxena
2011-08-04 13:53 ` [PATCH 09/12] ARM: netx: " Deepak Saxena
2011-08-04 13:53 ` [PATCH 10/12] ARM: pnx4000: " Deepak Saxena
2011-08-04 13:53 ` [PATCH 11/12] ARM: sa1100: " Deepak Saxena
2011-08-04 13:54 ` [PATCH 12/12] ARM: Remove mach-*/include/mach/timex.h Deepak Saxena
2011-08-04 15:57   ` Linus Walleij
2011-08-04 17:52   ` H Hartley Sweeten
2011-08-04 18:14     ` H Hartley Sweeten

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=20110804134934.GC1019@plexity.net \
    --to=dsaxena@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.