ARM: omap: clk: add clk_prepare and clk_unprepare
As part of Common Clk Framework (CCF) the clk_enable() operation was split into a clk_prepare() which could sleep, and a clk_enable() which should never sleep. Similarly the clk_disable() was split into clk_disable() and clk_unprepare(). This was needed to handle complex cases where in a clk gate/ungate would require a slow and a fast part to be implemented. None of the clocks below seem to be in the 'complex' clocks category and are just simple clocks which are enabled/disabled through simple register writes. Most of the instances also seem to be called in non-atomic context which means its safe to move all of those from using a clk_enable() to clk_prepare_enable() and clk_disable() to clk_disable_unprepare(). For some others, mainly the ones handled through the hwmod framework there is a possibility that they get called in either an atomic or a non-atomic context. The way these get handled below work only as long as clk_prepare is implemented as a no-op (which is the case today) since this gets called very early at boot while most subsystems are unavailable. Hence these are marked with a *HACK* comment, which says we need to re-visit these once we start doing something meaningful with clk_prepare/clk_unprepare like doing voltage scaling or something that involves i2c. This is in preparation of OMAP moving to CCF. Based on initial changes from Mike Turquette. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
This commit is contained in:
committed by
Paul Walmsley
parent
a04bcc231c
commit
4d7cb45ee8
@@ -265,9 +265,9 @@ static inline void __init h4_init_debug(void)
|
||||
return;
|
||||
}
|
||||
|
||||
clk_enable(gpmc_fck);
|
||||
clk_prepare_enable(gpmc_fck);
|
||||
rate = clk_get_rate(gpmc_fck);
|
||||
clk_disable(gpmc_fck);
|
||||
clk_disable_unprepare(gpmc_fck);
|
||||
clk_put(gpmc_fck);
|
||||
|
||||
if (is_gpmc_muxed())
|
||||
@@ -311,7 +311,7 @@ static inline void __init h4_init_debug(void)
|
||||
gpmc_cs_free(eth_cs);
|
||||
|
||||
out:
|
||||
clk_disable(gpmc_fck);
|
||||
clk_disable_unprepare(gpmc_fck);
|
||||
clk_put(gpmc_fck);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user