msm: clock: Rewrite clock handoff support

The previous handoff implementation had two limitations:

 1) Handed-off clocks are left in the prepared state forever since
    only the enable count is handed-off during clk_enable().

 2) The clock will turn off when the first driver that uses it
    calls clk_disable(). This is a problem if two drivers share
    a clock and both depend on it being enabled they have
    initialized and asserted their own votes for it.

Resolve both of these with a new handoff implementation that
leaves all clocks that were handed off (ex. handoff functions
returned HANDOFF_ENABLED_CLK) both prepared and enabled until
lateinit. As a consequence, handed-off clocks cannot be disabled
until then.

To avoid causing problems for the GFX2D cores, CLKFLAG_SKIP_HANDOFF
is introduced to prevent handoff of GFX2D clocks. This is required
because the footswitch-8x60 driver requires these clocks be off at
some points during boot while it asserts asynchronous resets to
the cores. If handoff was allowed to hold these clocks on, these
resets would fail.

Change-Id: I1ca7af6bed58e595cdad77923ea0614f456617ab
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/clock.h b/arch/arm/mach-msm/clock.h
index 1be05ad..03d5790 100644
--- a/arch/arm/mach-msm/clock.h
+++ b/arch/arm/mach-msm/clock.h
@@ -29,10 +29,10 @@
 #define CLKFLAG_NOINVERT		0x00000002
 #define CLKFLAG_NONEST			0x00000004
 #define CLKFLAG_NORESET			0x00000008
-#define CLKFLAG_HANDOFF_RATE		0x00000010
 #define CLKFLAG_HWCG			0x00000020
 #define CLKFLAG_RETAIN			0x00000040
 #define CLKFLAG_NORETAIN		0x00000080
+#define CLKFLAG_SKIP_HANDOFF		0x00000100
 #define CLKFLAG_SKIP_AUTO_OFF		0x00000200
 #define CLKFLAG_MIN			0x00000400
 #define CLKFLAG_MAX			0x00000800