From b4cae747329416761a02ff484708b0060f418e38 Mon Sep 17 00:00:00 2001 From: dkl Date: Wed, 14 May 2014 13:59:16 +0800 Subject: [PATCH] clk: pd: rockchip: add notify when clk_pd_prepare/unprepare --- drivers/clk/rockchip/clk-pd.c | 16 ++++++++++++++++ drivers/clk/rockchip/clk-pd.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/drivers/clk/rockchip/clk-pd.c b/drivers/clk/rockchip/clk-pd.c index 6a2a79da50b4..cf95ade9c6eb 100644 --- a/drivers/clk/rockchip/clk-pd.c +++ b/drivers/clk/rockchip/clk-pd.c @@ -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, }; diff --git a/drivers/clk/rockchip/clk-pd.h b/drivers/clk/rockchip/clk-pd.h index 650fc04e7472..9983bdd0ea4d 100644 --- a/drivers/clk/rockchip/clk-pd.h +++ b/drivers/clk/rockchip/clk-pd.h @@ -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; -- 2.34.1