Skip to content

Commit d90c76b

Browse files
Eddie Jamesbebarino
authored andcommitted
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. Signed-off-by: Eddie James <[email protected]> Fixes: 6671507 ("clk: aspeed: Handle inverse polarity of USB port 1 clock gate") Reviewed-by: Joel Stanley <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 55c19ee commit d90c76b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/clk/clk-aspeed.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,12 @@ static int aspeed_clk_is_enabled(struct clk_hw *hw)
259259
{
260260
struct aspeed_clk_gate *gate = to_aspeed_clk_gate(hw);
261261
u32 clk = BIT(gate->clock_idx);
262+
u32 enval = (gate->flags & CLK_GATE_SET_TO_DISABLE) ? 0 : clk;
262263
u32 reg;
263264

264265
regmap_read(gate->map, ASPEED_CLK_STOP_CTRL, &reg);
265266

266-
return (reg & clk) ? 0 : 1;
267+
return ((reg & clk) == enval) ? 1 : 0;
267268
}
268269

269270
static const struct clk_ops aspeed_clk_gate_ops = {

0 commit comments

Comments
 (0)