aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2011-02-25 18:06:47 -0500
committerPaul Walmsley <paul@pwsan.com>2011-02-25 18:06:47 -0500
commit68b921ad7f35e0323ce0d9fe94e5701a112f257c (patch)
treeec9af432b9a366604ce43370dfccc779ae2bc5f9 /arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
parent4aef7a2a5aad52b60ac1a2f3cee055b8271b70d5 (diff)
OMAP: clockdomain: Arch specific funcs for sleep/wakeup of clkdm
Define the following architecture specific funtions for omap2/3/4 .clkdm_sleep .clkdm_wakeup Convert the platform-independent framework to call these functions. Also rename the api's by removing the omap2_ preamble. Hence call omap2_clkdm_wakeup as clkdm_wakeup and omap2_clkdm_sleep as clkdm_sleep. Signed-off-by: Rajendra Nayak <rnayak@ti.com> [paul@pwsan.com: fixed omap3_clkdm_clear_all_sleepdeps() and omap2_clkdm_clear_all_wkdeps() to test against the correct loop termination condition; thanks to Kevin Hilman for finding and helping fix] Cc: Kevin Hilman <khilman@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/clockdomain2xxx_3xxx.c')
-rw-r--r--arch/arm/mach-omap2/clockdomain2xxx_3xxx.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
index a1fd6fd5a466..08c87fe3da12 100644
--- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
@@ -20,6 +20,7 @@
20#include "cm2xxx_3xxx.h" 20#include "cm2xxx_3xxx.h"
21#include "cm-regbits-24xx.h" 21#include "cm-regbits-24xx.h"
22#include "cm-regbits-34xx.h" 22#include "cm-regbits-34xx.h"
23#include "prm-regbits-24xx.h"
23#include "clockdomain.h" 24#include "clockdomain.h"
24 25
25static int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1, 26static int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1,
@@ -111,11 +112,43 @@ static int omap3_clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
111 return 0; 112 return 0;
112} 113}
113 114
115static int omap2_clkdm_sleep(struct clockdomain *clkdm)
116{
117 omap2_cm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
118 clkdm->pwrdm.ptr->prcm_offs,
119 OMAP2_PM_PWSTCTRL);
120 return 0;
121}
122
123static int omap2_clkdm_wakeup(struct clockdomain *clkdm)
124{
125 omap2_cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK,
126 clkdm->pwrdm.ptr->prcm_offs,
127 OMAP2_PM_PWSTCTRL);
128 return 0;
129}
130
131static int omap3_clkdm_sleep(struct clockdomain *clkdm)
132{
133 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
134 clkdm->clktrctrl_mask);
135 return 0;
136}
137
138static int omap3_clkdm_wakeup(struct clockdomain *clkdm)
139{
140 omap3xxx_cm_clkdm_force_wakeup(clkdm->pwrdm.ptr->prcm_offs,
141 clkdm->clktrctrl_mask);
142 return 0;
143}
144
114struct clkdm_ops omap2_clkdm_operations = { 145struct clkdm_ops omap2_clkdm_operations = {
115 .clkdm_add_wkdep = omap2_clkdm_add_wkdep, 146 .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
116 .clkdm_del_wkdep = omap2_clkdm_del_wkdep, 147 .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
117 .clkdm_read_wkdep = omap2_clkdm_read_wkdep, 148 .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
118 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps, 149 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
150 .clkdm_sleep = omap2_clkdm_sleep,
151 .clkdm_wakeup = omap2_clkdm_wakeup,
119}; 152};
120 153
121struct clkdm_ops omap3_clkdm_operations = { 154struct clkdm_ops omap3_clkdm_operations = {
@@ -127,4 +160,6 @@ struct clkdm_ops omap3_clkdm_operations = {
127 .clkdm_del_sleepdep = omap3_clkdm_del_sleepdep, 160 .clkdm_del_sleepdep = omap3_clkdm_del_sleepdep,
128 .clkdm_read_sleepdep = omap3_clkdm_read_sleepdep, 161 .clkdm_read_sleepdep = omap3_clkdm_read_sleepdep,
129 .clkdm_clear_all_sleepdeps = omap3_clkdm_clear_all_sleepdeps, 162 .clkdm_clear_all_sleepdeps = omap3_clkdm_clear_all_sleepdeps,
163 .clkdm_sleep = omap3_clkdm_sleep,
164 .clkdm_wakeup = omap3_clkdm_wakeup,
130}; 165};