Thread (43 messages) 43 messages, 12 authors, 2013-06-06

Re: [PATCH 10/10] arm: add basic support for Rockchip RK3066a boards

From: Arnd Bergmann <arnd@arndb.de>
Date: 2013-06-03 10:26:39
Also in: linux-arm-kernel, linux-mmc, lkml

On Monday 03 June 2013 11:46:57 Heiko Stübner wrote:
The timers are of the same type and the clocksource driver just grabs the 
first of them as clockevent and the second as clocksource, so I think two 
CLOCKSOURCE_OF_DECLARE lines won't do.
Ok, got it. I was confused by the fact that the existing two sets of
"compatible" strings have separate sets of strings:

static const struct of_device_id sptimer_ids[] __initconst = {
        { .compatible = "picochip,pc3x2-rtc" },
        { .compatible = "snps,dw-apb-timer-sp" },
        { /* Sentinel */ },
};

static const struct of_device_id osctimer_ids[] __initconst = {
        { .compatible = "picochip,pc3x2-timer" },
        { .compatible = "snps,dw-apb-timer-osc" },
        {},
};

and thought they were for clocksource and clockevent respectively,
which is wrong.
But I just looked at clocksource_of_init a bit more closely, which does a 
for_each_matching_node_and_match over the nodes. So the init_func could grab 
the device for the clockevent on the first call and the clocksource when it 
gets called for the second matching node.
Yes, I think that should work. You just have to be careful about calling
init_sched_clock() only once.

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help