aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/hwblk.h
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-07-17 14:24:55 +0000
committerPaul Mundt <lethal@linux-sh.org>2009-07-20 04:23:39 +0900
commit0f8ee1874fa80899debc0a0670e2bed0a28d2548 (patch)
treef9d58ced4b3b8e6ac50371fdb009e3446bce40c8 /arch/sh/include/asm/hwblk.h
parentsh: hwblk for sh7722 (diff)
downloadlinux-dev-0f8ee1874fa80899debc0a0670e2bed0a28d2548.tar.xz
linux-dev-0f8ee1874fa80899debc0a0670e2bed0a28d2548.zip
sh: Add support for multiple hwblk counters
Extend the SuperH hwblk code to support more than one counter. Contains ground work for the future Runtime PM implementation. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/hwblk.h')
-rw-r--r--arch/sh/include/asm/hwblk.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/sh/include/asm/hwblk.h b/arch/sh/include/asm/hwblk.h
index 51a46f496639..c01d72cb6757 100644
--- a/arch/sh/include/asm/hwblk.h
+++ b/arch/sh/include/asm/hwblk.h
@@ -4,6 +4,9 @@
#include <asm/clock.h>
#include <asm/io.h>
+#define HWBLK_CNT_USAGE 0
+#define HWBLK_CNT_NR 1
+
#define HWBLK_AREA_FLAG_PARENT (1 << 0) /* valid parent */
#define HWBLK_AREA(_flags, _parent) \
@@ -13,7 +16,7 @@
}
struct hwblk_area {
- unsigned long cnt;
+ int cnt[HWBLK_CNT_NR];
unsigned char parent;
unsigned char flags;
};
@@ -29,7 +32,7 @@ struct hwblk {
void __iomem *mstp;
unsigned char bit;
unsigned char area;
- unsigned long cnt;
+ int cnt[HWBLK_CNT_NR];
};
struct hwblk_info {
@@ -46,6 +49,12 @@ int arch_hwblk_sleep_mode(void);
int hwblk_register(struct hwblk_info *info);
int hwblk_init(void);
+void hwblk_enable(struct hwblk_info *info, int hwblk);
+void hwblk_disable(struct hwblk_info *info, int hwblk);
+
+void hwblk_cnt_inc(struct hwblk_info *info, int hwblk, int cnt);
+void hwblk_cnt_dec(struct hwblk_info *info, int hwblk, int cnt);
+
/* allow clocks to enable and disable hardware blocks */
#define SH_HWBLK_CLK(_name, _id, _parent, _hwblk, _flags) \
{ \