[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130618171409.0286fa2c@skate>
Date: Tue, 18 Jun 2013 17:14:09 +0200
From: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
To: Jonas Jensen <jonas.jensen@...il.com>
Cc: linux-arm-kernel@...ts.infradead.org, tglx@...utronix.de,
arm@...nel.org, john.stultz@...aro.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ARM: clocksource: add support for MOXA ART SoCs
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists