clk: imx: gate2: Remove the IMX_CLK_GATE2_SINGLE_BIT special case
This was a hack which would allow multiple HW gates to be controlled by a single bit. The only user of this is the imx_dev_clk_hw_gate_shared which is not used anywhere as of now. Basically, complicates the logic of the driver for no reason. Signed-off-by: Abel Vesa <abel.vesa@nxp.com> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
This commit is contained in:
Родитель
220175cd39
Коммит
12309428c2
|
@ -49,14 +49,10 @@ static int clk_gate2_enable(struct clk_hw *hw)
|
||||||
if (gate->share_count && (*gate->share_count)++ > 0)
|
if (gate->share_count && (*gate->share_count)++ > 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (gate->flags & IMX_CLK_GATE2_SINGLE_BIT) {
|
reg = readl(gate->reg);
|
||||||
ret = clk_gate_ops.enable(hw);
|
reg &= ~(3 << gate->bit_idx);
|
||||||
} else {
|
reg |= gate->cgr_val << gate->bit_idx;
|
||||||
reg = readl(gate->reg);
|
writel(reg, gate->reg);
|
||||||
reg &= ~(3 << gate->bit_idx);
|
|
||||||
reg |= gate->cgr_val << gate->bit_idx;
|
|
||||||
writel(reg, gate->reg);
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
spin_unlock_irqrestore(gate->lock, flags);
|
spin_unlock_irqrestore(gate->lock, flags);
|
||||||
|
@ -79,13 +75,9 @@ static void clk_gate2_disable(struct clk_hw *hw)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gate->flags & IMX_CLK_GATE2_SINGLE_BIT) {
|
reg = readl(gate->reg);
|
||||||
clk_gate_ops.disable(hw);
|
reg &= ~(3 << gate->bit_idx);
|
||||||
} else {
|
writel(reg, gate->reg);
|
||||||
reg = readl(gate->reg);
|
|
||||||
reg &= ~(3 << gate->bit_idx);
|
|
||||||
writel(reg, gate->reg);
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
spin_unlock_irqrestore(gate->lock, flags);
|
spin_unlock_irqrestore(gate->lock, flags);
|
||||||
|
@ -105,9 +97,6 @@ static int clk_gate2_is_enabled(struct clk_hw *hw)
|
||||||
{
|
{
|
||||||
struct clk_gate2 *gate = to_clk_gate2(hw);
|
struct clk_gate2 *gate = to_clk_gate2(hw);
|
||||||
|
|
||||||
if (gate->flags & IMX_CLK_GATE2_SINGLE_BIT)
|
|
||||||
return clk_gate_ops.is_enabled(hw);
|
|
||||||
|
|
||||||
return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx);
|
return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,9 +106,6 @@ static void clk_gate2_disable_unused(struct clk_hw *hw)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u32 reg;
|
u32 reg;
|
||||||
|
|
||||||
if (gate->flags & IMX_CLK_GATE2_SINGLE_BIT)
|
|
||||||
return;
|
|
||||||
|
|
||||||
spin_lock_irqsave(gate->lock, flags);
|
spin_lock_irqsave(gate->lock, flags);
|
||||||
|
|
||||||
if (!gate->share_count || *gate->share_count == 0) {
|
if (!gate->share_count || *gate->share_count == 0) {
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
#include <linux/clk-provider.h>
|
#include <linux/clk-provider.h>
|
||||||
|
|
||||||
#define IMX_CLK_GATE2_SINGLE_BIT 1
|
|
||||||
|
|
||||||
extern spinlock_t imx_ccm_lock;
|
extern spinlock_t imx_ccm_lock;
|
||||||
|
|
||||||
void imx_check_clocks(struct clk *clks[], unsigned int count);
|
void imx_check_clocks(struct clk *clks[], unsigned int count);
|
||||||
|
@ -384,8 +382,7 @@ static inline struct clk_hw *imx_dev_clk_hw_gate_shared(struct device *dev,
|
||||||
unsigned int *share_count)
|
unsigned int *share_count)
|
||||||
{
|
{
|
||||||
return clk_hw_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT |
|
return clk_hw_register_gate2(NULL, name, parent, CLK_SET_RATE_PARENT |
|
||||||
CLK_OPS_PARENT_ENABLE, reg, shift, 0x3,
|
CLK_OPS_PARENT_ENABLE, reg, shift, 0x1, 0,
|
||||||
IMX_CLK_GATE2_SINGLE_BIT,
|
|
||||||
&imx_ccm_lock, share_count);
|
&imx_ccm_lock, share_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче