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:48 -0500
committerPaul Walmsley <paul@pwsan.com>2011-02-25 18:06:48 -0500
commit5cd1937b6d5990fe5d5287d925f05afd38e9fb02 (patch)
treebef088bf947646413c74f6d3d6ba28aa3921813e /arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
parent68b921ad7f35e0323ce0d9fe94e5701a112f257c (diff)
OMAP: clockdomain: Arch specific funcs for hwsup control of clkdm
Define the following architecture specific funtions for omap2/3/4 .clkdm_allow_idle .clkdm_deny_idle Convert the platform-independent framework to call these functions. Also rename the api's by removing the omap2_ preamble. Hence call omap2_clkdm_allow_idle as clkdm_allow_idle and omap2_clkdm_deny_idle as clkdm_deny_idle. Make the _clkdm_add_autodeps and _clkdm_del_autodeps as non-static so they can be accessed from OMAP2/3 platform specific code. Signed-off-by: Rajendra Nayak <rnayak@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.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
index 08c87fe3da12..25c27a5c722f 100644
--- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
@@ -128,6 +128,24 @@ static int omap2_clkdm_wakeup(struct clockdomain *clkdm)
128 return 0; 128 return 0;
129} 129}
130 130
131static void omap2_clkdm_allow_idle(struct clockdomain *clkdm)
132{
133 if (atomic_read(&clkdm->usecount) > 0)
134 _clkdm_add_autodeps(clkdm);
135
136 omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
137 clkdm->clktrctrl_mask);
138}
139
140static void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
141{
142 omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
143 clkdm->clktrctrl_mask);
144
145 if (atomic_read(&clkdm->usecount) > 0)
146 _clkdm_del_autodeps(clkdm);
147}
148
131static int omap3_clkdm_sleep(struct clockdomain *clkdm) 149static int omap3_clkdm_sleep(struct clockdomain *clkdm)
132{ 150{
133 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs, 151 omap3xxx_cm_clkdm_force_sleep(clkdm->pwrdm.ptr->prcm_offs,
@@ -142,6 +160,24 @@ static int omap3_clkdm_wakeup(struct clockdomain *clkdm)
142 return 0; 160 return 0;
143} 161}
144 162
163static void omap3_clkdm_allow_idle(struct clockdomain *clkdm)
164{
165 if (atomic_read(&clkdm->usecount) > 0)
166 _clkdm_add_autodeps(clkdm);
167
168 omap3xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
169 clkdm->clktrctrl_mask);
170}
171
172static void omap3_clkdm_deny_idle(struct clockdomain *clkdm)
173{
174 omap3xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
175 clkdm->clktrctrl_mask);
176
177 if (atomic_read(&clkdm->usecount) > 0)
178 _clkdm_del_autodeps(clkdm);
179}
180
145struct clkdm_ops omap2_clkdm_operations = { 181struct clkdm_ops omap2_clkdm_operations = {
146 .clkdm_add_wkdep = omap2_clkdm_add_wkdep, 182 .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
147 .clkdm_del_wkdep = omap2_clkdm_del_wkdep, 183 .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
@@ -149,6 +185,8 @@ struct clkdm_ops omap2_clkdm_operations = {
149 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps, 185 .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
150 .clkdm_sleep = omap2_clkdm_sleep, 186 .clkdm_sleep = omap2_clkdm_sleep,
151 .clkdm_wakeup = omap2_clkdm_wakeup, 187 .clkdm_wakeup = omap2_clkdm_wakeup,
188 .clkdm_allow_idle = omap2_clkdm_allow_idle,
189 .clkdm_deny_idle = omap2_clkdm_deny_idle,
152}; 190};
153 191
154struct clkdm_ops omap3_clkdm_operations = { 192struct clkdm_ops omap3_clkdm_operations = {
@@ -162,4 +200,6 @@ struct clkdm_ops omap3_clkdm_operations = {
162 .clkdm_clear_all_sleepdeps = omap3_clkdm_clear_all_sleepdeps, 200 .clkdm_clear_all_sleepdeps = omap3_clkdm_clear_all_sleepdeps,
163 .clkdm_sleep = omap3_clkdm_sleep, 201 .clkdm_sleep = omap3_clkdm_sleep,
164 .clkdm_wakeup = omap3_clkdm_wakeup, 202 .clkdm_wakeup = omap3_clkdm_wakeup,
203 .clkdm_allow_idle = omap3_clkdm_allow_idle,
204 .clkdm_deny_idle = omap3_clkdm_deny_idle,
165}; 205};