clk: pd: rockchip: add notify when clk_pd_prepare/unprepare
authordkl <dkl@rock-chips.com>
Wed, 14 May 2014 05:59:16 +0000 (13:59 +0800)
committerdkl <dkl@rock-chips.com>
Wed, 14 May 2014 06:00:47 +0000 (14:00 +0800)
drivers/clk/rockchip/clk-pd.c
drivers/clk/rockchip/clk-pd.h

index 6a2a79da50b4b560cd0d6e37ebd330043c534243..cf95ade9c6eb0d044a0ec35ff9a13d8410831c18 100644 (file)
@@ -142,7 +142,21 @@ static int clk_pd_is_enabled(struct clk_hw *hw)
        return rockchip_pmu_ops.power_domain_is_on(pd->id);
 }
 
+static int clk_pd_prepare(struct clk_hw *hw)
+{
+       __clk_pd_notify(hw->clk, RK_CLK_PD_PREPARE);
+
+       return 0;
+}
+
+static void clk_pd_unprepare(struct clk_hw *hw)
+{
+       __clk_pd_notify(hw->clk, RK_CLK_PD_UNPREPARE);
+}
+
 const struct clk_ops clk_pd_ops = {
+       .prepare = clk_pd_prepare,
+       .unprepare = clk_pd_unprepare,
        .enable = clk_pd_enable,
        .disable = clk_pd_disable,
        .is_enabled = clk_pd_is_enabled,
@@ -165,6 +179,8 @@ static void clk_pd_virt_disable(struct clk_hw *hw)
 }
 
 const struct clk_ops clk_pd_virt_ops = {
+       .prepare = clk_pd_prepare,
+       .unprepare = clk_pd_unprepare,
        .enable = clk_pd_virt_enable,
        .disable = clk_pd_virt_disable,
 };
index 650fc04e747202036736e585c5ef08f8a04808cf..9983bdd0ea4dcb07e202145816b1a44ef1be19e2 100644 (file)
@@ -23,6 +23,9 @@ struct clk *rk_clk_register_pd(struct device *dev, const char *name,
 #define RK_CLK_PD_POST_ENABLE                  BIT(1)
 #define RK_CLK_PD_PRE_DISABLE                  BIT(2)
 #define RK_CLK_PD_POST_DISABLE                 BIT(3)
+#define RK_CLK_PD_PREPARE                      BIT(4)
+#define RK_CLK_PD_UNPREPARE                    BIT(5)
+
 
 struct clk_pd_notifier {
        struct clk                      *clk;