Merge branch 'android-4.4' of https://android.googlesource.com/kernel/common
[firefly-linux-kernel-4.4.55.git] / drivers / clk / rk / clk-pd.h
1 #ifndef __RK_CLK_PD_H
2 #define __RK_CLK_PD_H
3
4 #include <linux/clk-provider.h>
5 #include <linux/rockchip/pmu.h>
6
7
8
9 #define to_clk_pd(_hw) container_of(_hw, struct clk_pd, hw)
10
11 struct clk_pd {
12         struct clk_hw   hw;
13         u32             id;
14         spinlock_t      *lock;
15 };
16
17 struct clk *rk_clk_register_pd(struct device *dev, const char *name,
18                 const char *parent_name, unsigned long flags, 
19                 u32 pd_id, spinlock_t *lock);
20
21
22 #define RK_CLK_PD_PRE_ENABLE                    BIT(0)
23 #define RK_CLK_PD_POST_ENABLE                   BIT(1)
24 #define RK_CLK_PD_PRE_DISABLE                   BIT(2)
25 #define RK_CLK_PD_POST_DISABLE                  BIT(3)
26 #define RK_CLK_PD_PREPARE                       BIT(4)
27 #define RK_CLK_PD_UNPREPARE                     BIT(5)
28
29
30 struct clk_pd_notifier {
31         struct clk                      *clk;
32         struct srcu_notifier_head       notifier_head;
33         struct list_head                node;
34 };
35
36 int rk_clk_pd_notifier_register(struct clk *clk, struct notifier_block *nb);
37
38 int rk_clk_pd_notifier_unregister(struct clk *clk, struct notifier_block *nb);
39
40 #endif /* __RK_CLK_PD_H */