From: dsaxena@linaro.org (Deepak Saxena)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/12] ARM: Remove LATCH reference for time-acorn.c
Date: Thu, 4 Aug 2011 06:44:37 -0700 [thread overview]
Message-ID: <20110804134437.GB919@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 time-acorn.c file. This is only used
when mach-rpc is built and the tick rate was taken
from that sub-arch's timex.h header.
Signed-off-by: Deepak Saxena <dsaxena@linaro.org>
---
arch/arm/common/time-acorn.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/arch/arm/common/time-acorn.c b/arch/arm/common/time-acorn.c
index deeed56..0cc3a0d 100644
--- a/arch/arm/common/time-acorn.c
+++ b/arch/arm/common/time-acorn.c
@@ -24,6 +24,9 @@
#include <asm/mach/time.h>
+#define ACORN_TICK_RATE 2000000
+#define ACORN_TIMER_LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ)
+
unsigned long ioc_timer_gettimeoffset(void)
{
unsigned int count1, count2, status;
@@ -46,23 +49,23 @@ unsigned long ioc_timer_gettimeoffset(void)
* and count2.
*/
if (status & (1 << 5))
- offset -= LATCH;
+ offset -= ACORN_TIMER_LATCH;
} else if (count2 > count1) {
/*
* We have just had another interrupt between reading
* count1 and count2.
*/
- offset -= LATCH;
+ offset -= ACORN_TIMER_LATCH;
}
- offset = (LATCH - offset) * (tick_nsec / 1000);
- return (offset + LATCH/2) / LATCH;
+ offset = (ACORN_TIMER_LATCH - offset) * (tick_nsec / 1000);
+ return (offset + ACORN_TIMER_LATCH/2) / ACORN_TIMER_LATCH;
}
void __init ioctime_init(void)
{
- ioc_writeb(LATCH & 255, IOC_T0LTCHL);
- ioc_writeb(LATCH >> 8, IOC_T0LTCHH);
+ ioc_writeb(ACORN_TIMER_LATCH & 255, IOC_T0LTCHL);
+ ioc_writeb(ACORN_TIMER_LATCH >> 8, IOC_T0LTCHH);
ioc_writeb(0, IOC_T0GO);
}
--
1.7.4.1
next parent reply other threads:[~2011-08-04 13:44 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 ` Deepak Saxena [this message]
2011-08-05 9:21 ` [PATCH 01/12] ARM: Remove LATCH reference for time-acorn.c 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 ` [PATCH 05/12] ARM: h720x: " Deepak Saxena
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=20110804134437.GB919@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).