From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH 10/10] arm: add basic support for Rockchip RK3066a boards Date: Mon, 03 Jun 2013 12:26:49 +0200 Message-ID: <1822564.TIKVDZSzqK@wuerfel> References: <201306030055.15413.heiko@sntech.de> <9452845.qTGjLPCfXq@wuerfel> <201306031146.57611.heiko@sntech.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <201306031146.57611.heiko@sntech.de> Sender: linux-mmc-owner@vger.kernel.org To: Heiko =?ISO-8859-1?Q?St=FCbner?= Cc: "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , John Stultz , Thomas Gleixner , Mike Turquette , Seungwon Jeon , Jaehoon Chung , Chris Ball , linux-mmc@vger.kernel.org, Grant Likely , Rob Herring , Linus Walleij , devicetree-discuss@lists.ozlabs.org, Russell King , Olof Johansson List-Id: devicetree@vger.kernel.org On Monday 03 June 2013 11:46:57 Heiko St=FCbner wrote: >=20 > The timers are of the same type and the clocksource driver just grabs= the=20 > first of them as clockevent and the second as clocksource, so I think= two=20 > 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 =3D { { .compatible =3D "picochip,pc3x2-rtc" }, { .compatible =3D "snps,dw-apb-timer-sp" }, { /* Sentinel */ }, }; static const struct of_device_id osctimer_ids[] __initconst =3D { { .compatible =3D "picochip,pc3x2-timer" }, { .compatible =3D "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 do= es a=20 > for_each_matching_node_and_match over the nodes. So the init_func cou= ld grab=20 > the device for the clockevent on the first call and the clocksource w= hen it=20 > gets called for the second matching node. Yes, I think that should work. You just have to be careful about callin= g init_sched_clock() only once. Arnd