Re: [PATCH] ARM: clocksource: add support for MOXA ART SoCs

From: Thomas Petazzoni
Date: Tue Jun 18 2013 - 11:14:21 EST


Dear Jonas Jensen,

On Tue, 18 Jun 2013 12:00:04 +0200, Jonas Jensen wrote:

> +static void __init moxart_timer_init(struct device_node *node)
> +{
> + int ret, irq;
> +
> + timer_base = of_iomap(node, 0);
> + if (!timer_base)
> + panic("%s: failed to map base\n", node->full_name);
> +
> + irq = irq_of_parse_and_map(node, 0);
> + if (irq <= 0)
> + panic("%s: can't parse IRQ\n", node->full_name);
> +
> + ret = setup_irq(irq, &moxart_timer_irq);
> + if (ret)
> + pr_warn("%s: failed to setup IRQ %d\n", node->full_name, irq);
> +
> +
> + writel(APB_CLK / HZ, TIMER_1_COUNT(timer_base));
> + writel(APB_CLK / HZ, TIMER_1_LOAD(timer_base));
> +
> + writel(1, TIMER_1_CR_ENABLE(timer_base));
> + writel(0, TIMER_1_CR_EXTCLK(timer_base));
> + writel(1, TIMER_1_CR_FLOWIN(timer_base));
> +
> + pr_info("%s: count/load (APB_CLK=%d/HZ=%d) IRQ=%d\n",
> + node->full_name, APB_CLK, HZ, irq);
> +}
> +CLOCKSOURCE_OF_DECLARE(moxart, "moxa,moxart-timer", moxart_timer_init);

Any reason to not use the clocksource and clockevents infrastructures?

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/