Skip to content

Commit

Permalink
clk: ast2600: Fix enabling of clocks
Browse files Browse the repository at this point in the history
The struct clk_ops enable callback for the aspeed gates mixes up the set
to clear and write to set registers.

Fixes: d3d04f6 ("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>
  • Loading branch information
Joel Stanley authored and Stephen Boyd committed Oct 28, 2019
1 parent 658fd65 commit 427400f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/clk/clk-ast2600.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 427400f

Please sign in to comment.