]> git.baikalelectronics.ru Git - kernel.git/commitdiff
clk: ast2600: Fix enabling of clocks
authorJoel Stanley <joel@jms.id.au>
Wed, 16 Oct 2019 13:13:19 +0000 (23:43 +1030)
committerStephen Boyd <sboyd@kernel.org>
Mon, 28 Oct 2019 23:40:21 +0000 (16:40 -0700)
The struct clk_ops enable callback for the aspeed gates mixes up the set
to clear and write to set registers.

Fixes: 9ea7cc96411f ("clk: Add support for AST2600 SoC")
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Link: https://lkml.kernel.org/r/20191016131319.31318-1-joel@jms.id.au
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-ast2600.c

index 1c1bb39bb04e672ccb73bd66f78ba61f6fbac787..b1318e6b655bcc615cef2354d96278ea71f836ea 100644 (file)
@@ -266,10 +266,11 @@ static int aspeed_g6_clk_enable(struct clk_hw *hw)
 
        /* Enable clock */
        if (gate->flags & CLK_GATE_SET_TO_DISABLE) {
-               regmap_write(gate->map, get_clock_reg(gate), clk);
-       } else {
-               /* Use set to clear register */
+               /* Clock is clear to enable, so use set to clear register */
                regmap_write(gate->map, get_clock_reg(gate) + 0x04, clk);
+       } else {
+               /* Clock is set to enable, so use write to set register */
+               regmap_write(gate->map, get_clock_reg(gate), clk);
        }
 
        if (gate->reset_idx >= 0) {