From: dkl Date: Wed, 14 May 2014 05:59:16 +0000 (+0800) Subject: clk: pd: rockchip: add notify when clk_pd_prepare/unprepare X-Git-Tag: firefly_0821_release~5284 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b4cae747329416761a02ff484708b0060f418e38;p=firefly-linux-kernel-4.4.55.git clk: pd: rockchip: add notify when clk_pd_prepare/unprepare --- 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;