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

« back to all changes in this revision

Viewing changes to arch/arm/mach-mxs/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:
101
101
                        & 0xffff0000) >> 16);
102
102
}
103
103
 
104
 
static cycle_t timrotv2_get_cycles(struct clocksource *cs)
105
 
{
106
 
        return ~__raw_readl(mxs_timrot_base + HW_TIMROT_RUNNING_COUNTn(1));
107
 
}
108
 
 
109
104
static int timrotv1_set_next_event(unsigned long evt,
110
105
                                        struct clock_event_device *dev)
111
106
{
230
225
static struct clocksource clocksource_mxs = {
231
226
        .name           = "mxs_timer",
232
227
        .rating         = 200,
233
 
        .read           = timrotv2_get_cycles,
234
 
        .mask           = CLOCKSOURCE_MASK(32),
 
228
        .read           = timrotv1_get_cycles,
 
229
        .mask           = CLOCKSOURCE_MASK(16),
235
230
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
236
231
};
237
232
 
239
234
{
240
235
        unsigned int c = clk_get_rate(timer_clk);
241
236
 
242
 
        if (timrot_is_v1()) {
243
 
                clocksource_mxs.read = timrotv1_get_cycles;
244
 
                clocksource_mxs.mask = CLOCKSOURCE_MASK(16);
245
 
        }
246
 
 
247
 
        clocksource_register_hz(&clocksource_mxs, c);
 
237
        if (timrot_is_v1())
 
238
                clocksource_register_hz(&clocksource_mxs, c);
 
239
        else
 
240
                clocksource_mmio_init(mxs_timrot_base + HW_TIMROT_RUNNING_COUNTn(1),
 
241
                        "mxs_timer", c, 200, 32, clocksource_mmio_readl_down);
248
242
 
249
243
        return 0;
250
244
}