]> git.karo-electronics.de Git - linux-beck.git/commitdiff
clk: hisi: add hisi_clk_register_gate
authorZhangfei Gao <zhangfei.gao@linaro.org>
Tue, 22 Apr 2014 07:42:47 +0000 (15:42 +0800)
committerHaojian Zhuang <haojian.zhuang@linaro.org>
Mon, 12 May 2014 03:30:18 +0000 (11:30 +0800)
Add hisi_clk_register_gate register clk gate table

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
drivers/clk/hisilicon/clk.c
drivers/clk/hisilicon/clk.h

index 269938852f4f5ea8d4818ab6107180371e7a631a..a078e84f7b05629a4d27bb3a6cc5a945a1beac8e 100644 (file)
@@ -177,6 +177,34 @@ void __init hisi_clk_register_divider(struct hisi_divider_clock *clks,
        }
 }
 
+void __init hisi_clk_register_gate(struct hisi_gate_clock *clks,
+                                      int nums, struct hisi_clock_data *data)
+{
+       struct clk *clk;
+       void __iomem *base = data->base;
+       int i;
+
+       for (i = 0; i < nums; i++) {
+               clk = clk_register_gate(NULL, clks[i].name,
+                                               clks[i].parent_name,
+                                               clks[i].flags,
+                                               base + clks[i].offset,
+                                               clks[i].bit_idx,
+                                               clks[i].gate_flags,
+                                               &hisi_clk_lock);
+               if (IS_ERR(clk)) {
+                       pr_err("%s: failed to register clock %s\n",
+                              __func__, clks[i].name);
+                       continue;
+               }
+
+               if (clks[i].alias)
+                       clk_register_clkdev(clk, clks[i].alias, NULL);
+
+               data->clk_data.clks[clks[i].id] = clk;
+       }
+}
+
 void __init hisi_clk_register_gate_sep(struct hisi_gate_clock *clks,
                                       int nums, struct hisi_clock_data *data)
 {
index bc39a6aa475eccdd72d2367e3e64047511d46cfc..31083ffc0650b326f2232dead75672b2df6400e8 100644 (file)
@@ -104,6 +104,8 @@ void __init hisi_clk_register_mux(struct hisi_mux_clock *, int,
                                struct hisi_clock_data *);
 void __init hisi_clk_register_divider(struct hisi_divider_clock *,
                                int, struct hisi_clock_data *);
+void __init hisi_clk_register_gate(struct hisi_gate_clock *,
+                                       int, struct hisi_clock_data *);
 void __init hisi_clk_register_gate_sep(struct hisi_gate_clock *,
                                        int, struct hisi_clock_data *);
 #endif /* __HISI_CLK_H */