]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00286960-2 arm: imx: improve status check of clock gate
authorAnson Huang <b20788@freescale.com>
Fri, 8 Nov 2013 19:59:05 +0000 (14:59 -0500)
committerAnson Huang <b20788@freescale.com>
Mon, 11 Nov 2013 14:35:13 +0000 (09:35 -0500)
For ccm clock gate, both 2b'11 and 2b'01 should be treated
as clock enabled, see below description in CCM:

2b'00: clock is off during all modes;
2b'01: clock is on in run mode, but off in wait and stop mode;
2b'10: Not applicable;
2b'11: clock is on during all modes, except stop mode.

Signed-off-by: Anson Huang <b20788@freescale.com>
arch/arm/mach-imx/clk-gate2.c

index a63e415609a88a637490c7aaf7c27160572c71c0..dcdc1a1d8a1b37fec469a3532188b4d9a6d49599 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2010-2011 Canonical Ltd <jeremy.kerr@canonical.com>
  * Copyright (C) 2011-2012 Mike Turquette, Linaro Ltd <mturquette@linaro.org>
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -72,7 +73,7 @@ static int clk_gate2_is_enabled(struct clk_hw *hw)
 
        reg = readl(gate->reg);
 
-       if (((reg >> gate->bit_idx) & 3) == 3)
+       if (((reg >> gate->bit_idx) & 1) == 1)
                return 1;
 
        return 0;