From: Adriana Reus Date: Tue, 1 Aug 2017 07:28:46 +0000 (+0300) Subject: MLK-16124 clk: imx: clean-up: Add defines for gate enable bits. X-Git-Tag: C0P2-H0.0--20200415~1930 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=a17b53777cb3e43d12fc08ac431ded0efc3186e0;p=linux.git MLK-16124 clk: imx: clean-up: Add defines for gate enable bits. Use defines for gate enable bits instead of raw values. Signed-off-by: Adriana Reus --- diff --git a/drivers/clk/imx/clk-gate-scu.c b/drivers/clk/imx/clk-gate-scu.c index a38fa4533097..06b1bb73e45a 100644 --- a/drivers/clk/imx/clk-gate-scu.c +++ b/drivers/clk/imx/clk-gate-scu.c @@ -35,6 +35,9 @@ * parent - fixed parent. No clk_set_parent support */ +#define CLK_GATE_SCU_HW_SW_EN (BIT(0) | BIT(1)) +#define CLK_GATE_SCU_SW_EN BIT(1) + struct clk_gate_scu { struct clk_hw hw; void __iomem *reg; @@ -80,9 +83,9 @@ static int clk_gate_scu_enable(struct clk_hw *hw) if (gate->reg) { reg = readl(gate->reg); if (gate->hw_gate) - reg |= (0x3 << gate->bit_idx); + reg |= (CLK_GATE_SCU_HW_SW_EN << gate->bit_idx); else - reg |= (0x2 << gate->bit_idx); + reg |= (CLK_GATE_SCU_SW_EN << gate->bit_idx); writel(reg, gate->reg); } @@ -101,9 +104,9 @@ static void clk_gate_scu_disable(struct clk_hw *hw) if (gate->reg) { reg = readl(gate->reg); if (gate->hw_gate) - reg &= ~(0x3 << gate->bit_idx); + reg &= ~(CLK_GATE_SCU_HW_SW_EN << gate->bit_idx); else - reg &= ~(0x2 << gate->bit_idx); + reg &= ~(CLK_GATE_SCU_SW_EN << gate->bit_idx); writel(reg, gate->reg); } }