sunxi: driver refresh for 3.13
[openwrt.git] / target / linux / sunxi / patches-3.13 / 250-clk-sunxi-get-divs-parent-clkname.patch
1 From 97e36b3ce3106988b82e1ca53b1d1c872bde855a Mon Sep 17 00:00:00 2001
2 From: Chen-Yu Tsai <wens@csie.org>
3 Date: Mon, 3 Feb 2014 09:51:40 +0800
4 Subject: [PATCH] clk: sunxi: get divs parent clock name from parent factor
5  clock
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Divs clocks consist of a parent factor clock with multiple outputs,
11 and seperate clocks for each output. Get the name of the parent
12 clock from the parent factor clock, instead of the DT node name.
13
14 Signed-off-by: Chen-Yu Tsai <wens@csie.org>
15 Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
16 Acked-by: Mike Turquette <mturquette@linaro.org>
17 Signed-off-by: Emilio López <emilio@elopez.com.ar>
18 ---
19  drivers/clk/sunxi/clk-sunxi.c | 3 ++-
20  1 file changed, 2 insertions(+), 1 deletion(-)
21
22 diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
23 index 7a2ed98..736fb60 100644
24 --- a/drivers/clk/sunxi/clk-sunxi.c
25 +++ b/drivers/clk/sunxi/clk-sunxi.c
26 @@ -869,7 +869,7 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
27                                         struct divs_data *data)
28  {
29         struct clk_onecell_data *clk_data;
30 -       const char *parent  = node->name;
31 +       const char *parent;
32         const char *clk_name;
33         struct clk **clks, *pclk;
34         struct clk_hw *gate_hw, *rate_hw;
35 @@ -883,6 +883,7 @@ static void __init sunxi_divs_clk_setup(struct device_node *node,
36  
37         /* Set up factor clock that we will be dividing */
38         pclk = sunxi_factors_clk_setup(node, data->factors);
39 +       parent = __clk_get_name(pclk);
40  
41         reg = of_iomap(node, 0);
42  
43 -- 
44 1.8.5.5
45