diff options
author | Eddie James <eajames@linux.vnet.ibm.com> | 2018-03-08 23:57:19 +0300 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2018-03-13 08:45:18 +0300 |
commit | 10b851282c682c9bf4865bf44b3fb7ab265032b5 (patch) | |
tree | 8e82943d6312b8a6e25073c9b7cd32703052697d | |
parent | 30e055280e3a27faa6af752fe8a6083bfcc906e3 (diff) | |
download | linux-10b851282c682c9bf4865bf44b3fb7ab265032b5.tar.xz |
clk: aspeed: Fix is_enabled for certain clocks
Some of the Aspeed clocks are disabled by setting the relevant bit in
the "clock stop control" register to one, while others are disabled by
setting their bit to zero. The driver already uses a flag per gate to
identify this behavior, but doesn't apply it in the clock is_enabled
function.
Use the existing gate flag to correctly return whether or not a clock
is enabled in the aspeed_clk_is_enabled function.
OpenBMC-Staging-Count: 1
Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com>
-rw-r--r-- | drivers/clk/clk-aspeed.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/clk/clk-aspeed.c b/drivers/clk/clk-aspeed.c index e11784dae51b..5af80b4e673e 100644 --- a/drivers/clk/clk-aspeed.c +++ b/drivers/clk/clk-aspeed.c @@ -279,11 +279,12 @@ static int aspeed_clk_is_enabled(struct clk_hw *hw) { struct aspeed_clk_gate *gate = to_aspeed_clk_gate(hw); u32 clk = BIT(gate->clock_idx); + u32 enval = (gate->flags & CLK_GATE_SET_TO_DISABLE) ? 0 : clk; u32 reg; regmap_read(gate->map, ASPEED_CLK_STOP_CTRL, ®); - return (reg & clk) ? 0 : 1; + return ((reg & clk) == enval) ? 1 : 0; } static const struct clk_ops aspeed_clk_gate_ops = { |