diff options
author | Rajendra Nayak <rnayak@ti.com> | 2010-12-21 22:01:18 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-12-21 22:01:18 -0500 |
commit | f327e07b0ef9c60a6018799c9f04de10101d8e5a (patch) | |
tree | 4f21b95c3a8f5badb3a1cf69ab75b8edfd1624a6 /arch/arm/mach-omap2/powerdomain44xx.c | |
parent | 3b1e8b21fcbd686445f0bb42f84701b4621cdec6 (diff) |
OMAP: powerdomain: Arch specific funcs for state control
Define the following architecture specific funtions for omap2/3/4
.pwrdm_set_next_pwrst
.pwrdm_read_next_pwrst
.pwrdm_read_pwrst
.pwrdm_read_prev_pwrst
Convert the platform-independent framework to call these functions.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[paul@pwsan.com: remove remaining static allocations in powerdomains.h file;
remove path in file header comments, rearranged Makefile changes]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com>
Tested-by: Kevin Hilman <khilman@deeprootsystems.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Rajendra Nayak <rnayak@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/powerdomain44xx.c')
-rw-r--r-- | arch/arm/mach-omap2/powerdomain44xx.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/powerdomain44xx.c b/arch/arm/mach-omap2/powerdomain44xx.c new file mode 100644 index 000000000000..5dc337c0e5d5 --- /dev/null +++ b/arch/arm/mach-omap2/powerdomain44xx.c | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * OMAP4 powerdomain control | ||
3 | * | ||
4 | * Copyright (C) 2009-2010 Texas Instruments, Inc. | ||
5 | * Copyright (C) 2007-2009 Nokia Corporation | ||
6 | * | ||
7 | * Derived from mach-omap2/powerdomain.c written by Paul Walmsley | ||
8 | * Rajendra Nayak <rnayak@ti.com> | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <linux/io.h> | ||
16 | #include <linux/errno.h> | ||
17 | #include <linux/delay.h> | ||
18 | #include <plat/powerdomain.h> | ||
19 | #include <plat/prcm.h> | ||
20 | #include "prm.h" | ||
21 | #include "prm-regbits-44xx.h" | ||
22 | #include "powerdomains.h" | ||
23 | |||
24 | static int omap4_pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst) | ||
25 | { | ||
26 | prm_rmw_mod_reg_bits(OMAP_POWERSTATE_MASK, | ||
27 | (pwrst << OMAP_POWERSTATE_SHIFT), | ||
28 | pwrdm->prcm_offs, OMAP4_PM_PWSTCTRL); | ||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | static int omap4_pwrdm_read_next_pwrst(struct powerdomain *pwrdm) | ||
33 | { | ||
34 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, | ||
35 | OMAP4_PM_PWSTCTRL, OMAP_POWERSTATE_MASK); | ||
36 | } | ||
37 | |||
38 | static int omap4_pwrdm_read_pwrst(struct powerdomain *pwrdm) | ||
39 | { | ||
40 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, | ||
41 | OMAP4_PM_PWSTST, OMAP_POWERSTATEST_MASK); | ||
42 | } | ||
43 | |||
44 | static int omap4_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm) | ||
45 | { | ||
46 | return prm_read_mod_bits_shift(pwrdm->prcm_offs, OMAP4_PM_PWSTST, | ||
47 | OMAP4430_LASTPOWERSTATEENTERED_MASK); | ||
48 | } | ||
49 | |||
50 | struct pwrdm_ops omap4_pwrdm_operations = { | ||
51 | .pwrdm_set_next_pwrst = omap4_pwrdm_set_next_pwrst, | ||
52 | .pwrdm_read_next_pwrst = omap4_pwrdm_read_next_pwrst, | ||
53 | .pwrdm_read_pwrst = omap4_pwrdm_read_pwrst, | ||
54 | .pwrdm_read_prev_pwrst = omap4_pwrdm_read_prev_pwrst, | ||
55 | }; | ||