mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-15 09:04:17 +00:00
refactor(st-clock): move stm32mp1_clk_rcc_regs_*lock
Those functions are only used on MP1, they should not be in STM32 clock core. Move them to MP13 driver (they are already in MP15 driver). Redefine new clk_stm32_rcc_regs_*lock() functions in clock core. This change avoid sparse warning: drivers/st/clk/clk-stm32-core.c:46:6: warning: symbol 'stm32mp1_clk_rcc_regs_lock' was not declared. Should it be static? drivers/st/clk/clk-stm32-core.c:51:6: warning: symbol 'stm32mp1_clk_rcc_regs_unlock' was not declared. Should it be static? Change-Id: I9f255acaa843e41fc14267c1a8091f93bd029796 Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
This commit is contained in:
parent
d9a7ddeb25
commit
1be399b813
3 changed files with 23 additions and 10 deletions
|
@ -28,7 +28,7 @@ struct stm32_clk_priv *clk_stm32_get_priv(void)
|
|||
return stm32_clock_data;
|
||||
}
|
||||
|
||||
static void stm32mp1_clk_lock(struct spinlock *lock)
|
||||
static void _clk_lock(struct spinlock *lock)
|
||||
{
|
||||
if (stm32mp_lock_available()) {
|
||||
/* Assume interrupts are masked */
|
||||
|
@ -36,21 +36,21 @@ static void stm32mp1_clk_lock(struct spinlock *lock)
|
|||
}
|
||||
}
|
||||
|
||||
static void stm32mp1_clk_unlock(struct spinlock *lock)
|
||||
static void _clk_unlock(struct spinlock *lock)
|
||||
{
|
||||
if (stm32mp_lock_available()) {
|
||||
spin_unlock(lock);
|
||||
}
|
||||
}
|
||||
|
||||
void stm32mp1_clk_rcc_regs_lock(void)
|
||||
void clk_stm32_rcc_regs_lock(void)
|
||||
{
|
||||
stm32mp1_clk_lock(®_lock);
|
||||
_clk_lock(®_lock);
|
||||
}
|
||||
|
||||
void stm32mp1_clk_rcc_regs_unlock(void)
|
||||
void clk_stm32_rcc_regs_unlock(void)
|
||||
{
|
||||
stm32mp1_clk_unlock(®_lock);
|
||||
_clk_unlock(®_lock);
|
||||
}
|
||||
|
||||
#define TIMEOUT_US_1S U(1000000)
|
||||
|
@ -571,9 +571,9 @@ int _clk_stm32_enable(struct stm32_clk_priv *priv, int id)
|
|||
{
|
||||
int ret;
|
||||
|
||||
stm32mp1_clk_lock(&refcount_lock);
|
||||
_clk_lock(&refcount_lock);
|
||||
ret = _clk_stm32_enable_core(priv, id);
|
||||
stm32mp1_clk_unlock(&refcount_lock);
|
||||
_clk_unlock(&refcount_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -619,11 +619,11 @@ static void _clk_stm32_disable_core(struct stm32_clk_priv *priv, int id)
|
|||
|
||||
void _clk_stm32_disable(struct stm32_clk_priv *priv, int id)
|
||||
{
|
||||
stm32mp1_clk_lock(&refcount_lock);
|
||||
_clk_lock(&refcount_lock);
|
||||
|
||||
_clk_stm32_disable_core(priv, id);
|
||||
|
||||
stm32mp1_clk_unlock(&refcount_lock);
|
||||
_clk_unlock(&refcount_lock);
|
||||
}
|
||||
|
||||
bool _clk_stm32_is_enabled(struct stm32_clk_priv *priv, int id)
|
||||
|
|
|
@ -146,6 +146,9 @@ struct clk_gate_cfg {
|
|||
#define MASK_WIDTH_SHIFT(_width, _shift) \
|
||||
GENMASK(((_width) + (_shift) - 1U), (_shift))
|
||||
|
||||
void clk_stm32_rcc_regs_lock(void);
|
||||
void clk_stm32_rcc_regs_unlock(void);
|
||||
|
||||
int clk_stm32_init(struct stm32_clk_priv *priv, uintptr_t base);
|
||||
void clk_stm32_enable_critical_clocks(void);
|
||||
|
||||
|
|
|
@ -2332,6 +2332,16 @@ static int stm32_clk_parse_fdt(struct stm32_clk_platdata *pdata)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void stm32mp1_clk_rcc_regs_lock(void)
|
||||
{
|
||||
clk_stm32_rcc_regs_lock();
|
||||
}
|
||||
|
||||
void stm32mp1_clk_rcc_regs_unlock(void)
|
||||
{
|
||||
clk_stm32_rcc_regs_unlock();
|
||||
}
|
||||
|
||||
int stm32mp1_clk_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
|
Loading…
Add table
Reference in a new issue