msm: clock-8960: Set memory retention modes with clk_set_flags()
Some branch clocks have a configuration bit associated with them
that determines whether or not SRAM memories in their clock domain
will lose or retain state when the clock is halted.
By default (out of reset) these bits are set so that, even when the
clocks are halted, memory state is retained. This is useful for
drivers that wish to take advantage of temporary clock gating as an
inexpensive way to save power, without needing to re-initialize the
hardware they control again after a clock is re-enabled.
On the other hand, some additional power can be saved by clearing
these bits and allowing the core's memory to collapse. To take
advantage of this, a means of setting this bit is supported through
the clk_set_flags() API.
Change-Id: I80bf17b721b36861e1de3a0267be1788982c57e7
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/clock-local.h b/arch/arm/mach-msm/clock-local.h
index 9292e5d..8ea344b 100644
--- a/arch/arm/mach-msm/clock-local.h
+++ b/arch/arm/mach-msm/clock-local.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -164,12 +164,16 @@
void __iomem *const reset_reg;
const u32 reset_mask;
+
+ void __iomem *const retain_reg;
+ const u32 retain_mask;
};
int branch_reset(struct branch *b, enum clk_reset_action action);
void __branch_clk_enable_reg(const struct branch *clk, const char *name);
u32 __branch_clk_disable_reg(const struct branch *clk, const char *name);
int branch_clk_handoff(struct clk *c);
+int branch_clk_set_flags(struct clk *clk, unsigned flags);
/*
* Generic clock-definition struct and macros
@@ -213,6 +217,7 @@
void rcg_clk_enable_hwcg(struct clk *clk);
void rcg_clk_disable_hwcg(struct clk *clk);
int rcg_clk_in_hwcg_mode(struct clk *c);
+int rcg_clk_set_flags(struct clk *clk, unsigned flags);
/**
* struct cdiv_clk - integer divider clock with external source selection