base-files: define yes/no as valid boolean options
[openwrt/staging/lynxis/omap.git] / target / linux / mvebu / patches-3.10 / 0170-clocksource-armada-370-xp-Get-reference-fixed-clock-.patch
1 From 7d7214129f7bde5bb55c0691968407b48f08efb5 Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Tue, 20 Aug 2013 12:45:53 -0300
4 Subject: [PATCH 170/203] clocksource: armada-370-xp: Get reference fixed-clock
5 by name
6
7 The Armada XP timer has two mandatory clock inputs: nbclk and refclk,
8 as specified by the device-tree binding.
9
10 This commit fixes the clock selection. Instead of hard-coding the clock
11 rate for the 25 MHz reference fixed-clock, obtain the clock by its name.
12
13 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
14 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
15 Acked-by: Jason Cooper <jason@lakedaemon.net>
16 Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
17 ---
18 drivers/clocksource/time-armada-370-xp.c | 7 +++++--
19 1 file changed, 5 insertions(+), 2 deletions(-)
20
21 --- a/drivers/clocksource/time-armada-370-xp.c
22 +++ b/drivers/clocksource/time-armada-370-xp.c
23 @@ -294,8 +294,11 @@ static void __init armada_370_xp_timer_c
24
25 static void __init armada_xp_timer_init(struct device_node *np)
26 {
27 - /* The fixed 25MHz timer is required, timer25Mhz is true by default */
28 - timer_clk = 25000000;
29 + struct clk *clk = of_clk_get_by_name(np, "fixed");
30 +
31 + /* The 25Mhz fixed clock is mandatory, and must always be available */
32 + BUG_ON(IS_ERR(clk));
33 + timer_clk = clk_get_rate(clk);
34
35 armada_370_xp_timer_common_init(np);
36 }