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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <asm/mach/time.h>
28
28
#include <asm/mach/irq.h>
29
29
 
30
 
/* Be able to sleep for atleast 4 seconds (usually more) */
31
 
#define APPTIMER_MIN_RANGE 4
32
 
 
33
30
/*
34
31
 * APP side special timer registers
35
32
 * This timer contains four timers which can fire an interrupt each.
309
306
 
310
307
/* Use general purpose timer 1 as clock event */
311
308
static struct clock_event_device clockevent_u300_1mhz = {
312
 
        .name           = "GPT1",
313
 
        .rating         = 300, /* Reasonably fast and accurate clock event */
314
 
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
315
 
        .set_next_event = u300_set_next_event,
316
 
        .set_mode       = u300_set_mode,
 
309
        .name           = "GPT1",
 
310
        .rating         = 300, /* Reasonably fast and accurate clock event */
 
311
        .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
 
312
        .set_next_event = u300_set_next_event,
 
313
        .set_mode       = u300_set_mode,
317
314
};
318
315
 
319
316
/* Clock event timer interrupt handler */
328
325
}
329
326
 
330
327
static struct irqaction u300_timer_irq = {
331
 
        .name           = "U300 Timer Tick",
332
 
        .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
333
 
        .handler        = u300_timer_interrupt,
 
328
        .name           = "U300 Timer Tick",
 
329
        .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
 
330
        .handler        = u300_timer_interrupt,
334
331
};
335
332
 
336
333
/*
413
410
                        "GPT2", rate, 300, 32, clocksource_mmio_readl_up))
414
411
                pr_err("timer: failed to initialize U300 clock source\n");
415
412
 
416
 
        clockevents_calc_mult_shift(&clockevent_u300_1mhz,
417
 
                                    rate, APPTIMER_MIN_RANGE);
418
 
        /* 32bit counter, so 32bits delta is max */
419
 
        clockevent_u300_1mhz.max_delta_ns =
420
 
                clockevent_delta2ns(0xffffffff, &clockevent_u300_1mhz);
421
 
        /* This timer is slow enough to set for 1 cycle == 1 MHz */
422
 
        clockevent_u300_1mhz.min_delta_ns =
423
 
                clockevent_delta2ns(1, &clockevent_u300_1mhz);
424
 
        clockevent_u300_1mhz.cpumask = cpumask_of(0);
425
 
        clockevents_register_device(&clockevent_u300_1mhz);
 
413
        /* Configure and register the clockevent */
 
414
        clockevents_config_and_register(&clockevent_u300_1mhz, rate,
 
415
                                        1, 0xffffffff);
 
416
 
426
417
        /*
427
418
         * TODO: init and register the rest of the timers too, they can be
428
419
         * used by hrtimers!