]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clocksource:sirf: remove the hardcode for the clk of timers
authorZhiwu Song <Zhiwu.Song@csr.com>
Mon, 5 May 2014 11:30:04 +0000 (19:30 +0800)
committerBarry Song <Baohua.Song@csr.com>
Mon, 12 May 2014 13:43:49 +0000 (21:43 +0800)
Nobody want to know the connection between io clk and timer clk,
so exposing this information to timer module is not reasonable.
this patch moves to define the timers' clk in dt.

Signed-off-by: Zhiwu Song <Zhiwu.Song@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
arch/arm/boot/dts/atlas6.dtsi
arch/arm/boot/dts/prima2.dtsi
drivers/clocksource/timer-marco.c
drivers/clocksource/timer-prima2.c

index 9d72674049d6ba7decd0678cd09380fa89634c08..317bc590a4d09bf0130430708a2a487726b9d529 100644 (file)
@@ -195,6 +195,7 @@ timer@b0020000 {
                                compatible = "sirf,prima2-tick";
                                reg = <0xb0020000 0x1000>;
                                interrupts = <0>;
+                               clocks = <&clks 11>;
                        };
 
                        nand@b0030000 {
index 1e82571d6823ef55169af9827efab952189e952c..7e7d8843abaf3121ce83cf86775d5e25acc82fc8 100644 (file)
@@ -201,6 +201,7 @@ timer@b0020000 {
                                compatible = "sirf,prima2-tick";
                                reg = <0xb0020000 0x1000>;
                                interrupts = <0>;
+                               clocks = <&clks 11>;
                        };
 
                        nand@b0030000 {
index b52e1c078b9955330dda32f803a26e8fa1527ab7..571d10974139ef310e5ed2b3b5db18b474f9978b 100644 (file)
@@ -252,15 +252,13 @@ static void __init sirfsoc_clockevent_init(void)
 }
 
 /* initialize the kernel jiffy timer source */
-static void __init sirfsoc_marco_timer_init(void)
+static void __init sirfsoc_marco_timer_init(struct device_node *np)
 {
        unsigned long rate;
        u32 timer_div;
        struct clk *clk;
 
-       /* timer's input clock is io clock */
-       clk = clk_get_sys("io", NULL);
-
+       clk = of_clk_get(np, 0);
        BUG_ON(IS_ERR(clk));
        rate = clk_get_rate(clk);
 
@@ -303,6 +301,6 @@ static void __init sirfsoc_of_timer_init(struct device_node *np)
        if (!sirfsoc_timer1_irq.irq)
                panic("No irq passed for timer1 via DT\n");
 
-       sirfsoc_marco_timer_init();
+       sirfsoc_marco_timer_init(np);
 }
 CLOCKSOURCE_OF_DECLARE(sirfsoc_marco_timer, "sirf,marco-tick", sirfsoc_of_timer_init );
index 84fdb15eae79489f69977e70fa4b9ddac7cdc6b8..a722aac7ac021baedf3db3db8e629de6d99a0b14 100644 (file)
@@ -198,11 +198,8 @@ static void __init sirfsoc_prima2_timer_init(struct device_node *np)
        unsigned long rate;
        struct clk *clk;
 
-       /* timer's input clock is io clock */
-       clk = clk_get_sys("io", NULL);
-
+       clk = of_clk_get(np, 0);
        BUG_ON(IS_ERR(clk));
-
        rate = clk_get_rate(clk);
 
        BUG_ON(rate < PRIMA2_CLOCK_FREQ);