summaryrefslogtreecommitdiff
path: root/drivers/clk/clk-ast2600.c
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2019-10-16 16:13:19 +0300
committerStephen Boyd <sboyd@kernel.org>2019-10-29 02:40:21 +0300
commit427400fc5c1988245827bacb0dfba0214f153a2f (patch)
treee4db44911c9ef07aa7e65aa47fd297c084a2269f /drivers/clk/clk-ast2600.c
parent658fd65cf0b0d511de1718e48d9a28844c385ae0 (diff)
downloadlinux-427400fc5c1988245827bacb0dfba0214f153a2f.tar.xz
clk: ast2600: Fix enabling of clocks
The struct clk_ops enable callback for the aspeed gates mixes up the set to clear and write to set registers. Fixes: d3d04f6c330a ("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>
Diffstat (limited to 'drivers/clk/clk-ast2600.c')
-rw-r--r--drivers/clk/clk-ast2600.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/clk/clk-ast2600.c b/drivers/clk/clk-ast2600.c
index 1c1bb39bb04e..b1318e6b655b 100644
--- a/drivers/clk/clk-ast2600.c
+++ b/drivers/clk/clk-ast2600.c
@@ -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) {