summaryrefslogtreecommitdiffstats
path: root/drivers/clk/hisilicon
diff options
context:
space:
mode:
authorJiancheng Xue <xuejiancheng@hisilicon.com>2016-06-15 14:26:37 +0800
committerStephen Boyd <sboyd@codeaurora.org>2016-06-30 12:35:18 -0700
commitfbf0410ed5f96ae63fcb221ab785e746871a4e62 (patch)
tree0c566383b4e07bc78280fe52e00e2ceec61d795b /drivers/clk/hisilicon
parent5497f668c8ca42717529a340abb1674df60bbe1c (diff)
downloadlinux-fbf0410ed5f96ae63fcb221ab785e746871a4e62.tar.gz
linux-fbf0410ed5f96ae63fcb221ab785e746871a4e62.tar.bz2
linux-fbf0410ed5f96ae63fcb221ab785e746871a4e62.zip
clk: hisilicon: add hisi_clk_unregister_* functions
Add hisi_clk_unregister_* functions. Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/hisilicon')
-rw-r--r--drivers/clk/hisilicon/clk.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/clk/hisilicon/clk.h b/drivers/clk/hisilicon/clk.h
index 257532945c58..4e1d1affc6f5 100644
--- a/drivers/clk/hisilicon/clk.h
+++ b/drivers/clk/hisilicon/clk.h
@@ -128,4 +128,25 @@ void hisi_clk_register_gate_sep(const struct hisi_gate_clock *,
int, struct hisi_clock_data *);
void hi6220_clk_register_divider(const struct hi6220_divider_clock *,
int, struct hisi_clock_data *);
+
+#define hisi_clk_unregister(type) \
+static inline \
+void hisi_clk_unregister_##type(const struct hisi_##type##_clock *clks, \
+ int nums, struct hisi_clock_data *data) \
+{ \
+ struct clk **clocks = data->clk_data.clks; \
+ int i; \
+ for (i = 0; i < nums; i++) { \
+ int id = clks[i].id; \
+ if (clocks[id]) \
+ clk_unregister_##type(clocks[id]); \
+ } \
+}
+
+hisi_clk_unregister(fixed_rate)
+hisi_clk_unregister(fixed_factor)
+hisi_clk_unregister(mux)
+hisi_clk_unregister(divider)
+hisi_clk_unregister(gate)
+
#endif /* __HISI_CLK_H */