~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/arm/mach-lpc32xx/timer.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <mach/platform.h>
32
32
#include "common.h"
33
33
 
34
 
static cycle_t lpc32xx_clksrc_read(struct clocksource *cs)
35
 
{
36
 
        return (cycle_t)__raw_readl(LCP32XX_TIMER_TC(LPC32XX_TIMER1_BASE));
37
 
}
38
 
 
39
 
static struct clocksource lpc32xx_clksrc = {
40
 
        .name   = "lpc32xx_clksrc",
41
 
        .rating = 300,
42
 
        .read   = lpc32xx_clksrc_read,
43
 
        .mask   = CLOCKSOURCE_MASK(32),
44
 
        .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
45
 
};
46
 
 
47
34
static int lpc32xx_clkevt_next_event(unsigned long delta,
48
35
    struct clock_event_device *dev)
49
36
{
170
157
        __raw_writel(0, LCP32XX_TIMER_MCR(LPC32XX_TIMER1_BASE));
171
158
        __raw_writel(LCP32XX_TIMER_CNTR_TCR_EN,
172
159
                LCP32XX_TIMER_TCR(LPC32XX_TIMER1_BASE));
173
 
        clocksource_register_hz(&lpc32xx_clksrc, clkrate);
 
160
 
 
161
        clocksource_mmio_init(LCP32XX_TIMER_TC(LPC32XX_TIMER1_BASE),
 
162
                "lpc32xx_clksrc", clkrate, 300, 32, clocksource_mmio_readl_up);
174
163
}
175
164
 
176
165
struct sys_timer lpc32xx_timer = {