diff options
Diffstat (limited to 'arch/arm/mach-omap2/prm2xxx_3xxx.c')
-rw-r--r-- | arch/arm/mach-omap2/prm2xxx_3xxx.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c index 177c3ddba788..58d9ce70e792 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c | |||
@@ -244,3 +244,40 @@ void omap3xxx_prm_ocp_barrier(void) | |||
244 | { | 244 | { |
245 | omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_REVISION_OFFSET); | 245 | omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_REVISION_OFFSET); |
246 | } | 246 | } |
247 | |||
248 | /** | ||
249 | * omap3xxx_prm_save_and_clear_irqen - save/clear PRM_IRQENABLE_MPU reg | ||
250 | * @saved_mask: ptr to a u32 array to save IRQENABLE bits | ||
251 | * | ||
252 | * Save the PRM_IRQENABLE_MPU register to @saved_mask. @saved_mask | ||
253 | * must be allocated by the caller. Intended to be used in the PRM | ||
254 | * interrupt handler suspend callback. The OCP barrier is needed to | ||
255 | * ensure the write to disable PRM interrupts reaches the PRM before | ||
256 | * returning; otherwise, spurious interrupts might occur. No return | ||
257 | * value. | ||
258 | */ | ||
259 | void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask) | ||
260 | { | ||
261 | saved_mask[0] = omap2_prm_read_mod_reg(OCP_MOD, | ||
262 | OMAP3_PRM_IRQENABLE_MPU_OFFSET); | ||
263 | omap2_prm_write_mod_reg(0, OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET); | ||
264 | |||
265 | /* OCP barrier */ | ||
266 | omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_REVISION_OFFSET); | ||
267 | } | ||
268 | |||
269 | /** | ||
270 | * omap3xxx_prm_restore_irqen - set PRM_IRQENABLE_MPU register from args | ||
271 | * @saved_mask: ptr to a u32 array of IRQENABLE bits saved previously | ||
272 | * | ||
273 | * Restore the PRM_IRQENABLE_MPU register from @saved_mask. Intended | ||
274 | * to be used in the PRM interrupt handler resume callback to restore | ||
275 | * values saved by omap3xxx_prm_save_and_clear_irqen(). No OCP | ||
276 | * barrier should be needed here; any pending PRM interrupts will fire | ||
277 | * once the writes reach the PRM. No return value. | ||
278 | */ | ||
279 | void omap3xxx_prm_restore_irqen(u32 *saved_mask) | ||
280 | { | ||
281 | omap2_prm_write_mod_reg(saved_mask[0], OCP_MOD, | ||
282 | OMAP3_PRM_IRQENABLE_MPU_OFFSET); | ||
283 | } | ||