diff options
author | Tero Kristo <t-kristo@ti.com> | 2017-07-26 16:47:28 +0300 |
---|---|---|
committer | Tero Kristo <t-kristo@ti.com> | 2018-03-08 11:42:04 +0200 |
commit | e31922eda18c950d6b51450711ae459b97eae097 (patch) | |
tree | accb2d8fc22285386e3d1228e1262840725ea3f3 /drivers/clk/ti/clk.c | |
parent | 4902c2025b8ade9c230d4bca25ec5f691e91cb1f (diff) | |
download | blackbird-op-linux-e31922eda18c950d6b51450711ae459b97eae097.tar.gz blackbird-op-linux-e31922eda18c950d6b51450711ae459b97eae097.zip |
clk: ti: add generic support for clock latching
Certain clocks require latching to be done, so that the actual
settings get updated on the HW that generates the clock signal.
One example of such a clock is the dra76x GMAC DPLL H14 output,
which requires its divider settings to be latched when updated.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Diffstat (limited to 'drivers/clk/ti/clk.c')
-rw-r--r-- | drivers/clk/ti/clk.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c index 4efa2c9ea908..7d22e1af2247 100644 --- a/drivers/clk/ti/clk.c +++ b/drivers/clk/ti/clk.c @@ -275,6 +275,20 @@ int ti_clk_get_reg_addr(struct device_node *node, int index, return 0; } +void ti_clk_latch(struct clk_omap_reg *reg, s8 shift) +{ + u32 latch; + + if (shift < 0) + return; + + latch = 1 << shift; + + ti_clk_ll_ops->clk_rmw(latch, latch, reg); + ti_clk_ll_ops->clk_rmw(0, latch, reg); + ti_clk_ll_ops->clk_readl(reg); /* OCP barrier */ +} + /** * omap2_clk_provider_init - init master clock provider * @parent: master node |