/* Writing any value clears the timer interrupt */
writel(1, tcu->base + EP93XX_TIMER3_CLEAR);
evt->event_handler(evt);
return IRQ_HANDLED;
}
staticint __init ep93xx_timer_of_init(struct device_node *np)
{ int irq; unsignedlong flags = IRQF_TIMER | IRQF_IRQPOLL; struct ep93xx_tcu *tcu; int ret;
tcu = kzalloc(sizeof(*tcu), GFP_KERNEL); if (!tcu) return -ENOMEM;
tcu->base = of_iomap(np, 0); if (!tcu->base) {
pr_err("Can't remap registers\n");
ret = -ENXIO; goto out_free;
}
ep93xx_tcu = tcu;
irq = irq_of_parse_and_map(np, 0); if (!irq) {
ret = -EINVAL;
pr_err("EP93XX Timer Can't parse IRQ %d", irq); goto out_free;
}
/* Enable and register clocksource and sched_clock on timer 4 */
writel(EP93XX_TIMER4_VALUE_HIGH_ENABLE,
tcu->base + EP93XX_TIMER4_VALUE_HIGH);
clocksource_mmio_init(NULL, "timer4",
EP93XX_TIMER4_RATE, 200, 40,
ep93xx_clocksource_read);
sched_clock_register(ep93xx_read_sched_clock, 40,
EP93XX_TIMER4_RATE);
/* Set up clockevent on timer 3 */ if (request_irq(irq, ep93xx_timer_interrupt, flags, "ep93xx timer",
&ep93xx_clockevent))
pr_err("Failed to request irq %d (ep93xx timer)\n", irq);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.