Paul Walmsley | 4981539 | 2012-10-21 01:01:10 -0600 | [diff] [blame] | 1 | /* |
| 2 | * OMAP2xxx PRM module functions |
| 3 | * |
| 4 | * Copyright (C) 2010-2012 Texas Instruments, Inc. |
| 5 | * Copyright (C) 2010 Nokia Corporation |
| 6 | * BenoƮt Cousson |
| 7 | * 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/kernel.h> |
| 16 | #include <linux/errno.h> |
| 17 | #include <linux/err.h> |
| 18 | #include <linux/io.h> |
| 19 | #include <linux/irq.h> |
| 20 | |
| 21 | #include "common.h" |
| 22 | #include <plat/cpu.h> |
| 23 | #include <plat/prcm.h> |
| 24 | |
| 25 | #include "vp.h" |
| 26 | #include "powerdomain.h" |
Paul Walmsley | 4bd5259 | 2012-10-21 01:01:11 -0600 | [diff] [blame^] | 27 | #include "clockdomain.h" |
Paul Walmsley | 4981539 | 2012-10-21 01:01:10 -0600 | [diff] [blame] | 28 | #include "prm2xxx.h" |
| 29 | #include "cm2xxx_3xxx.h" |
| 30 | #include "prm-regbits-24xx.h" |
| 31 | |
Paul Walmsley | 4bd5259 | 2012-10-21 01:01:11 -0600 | [diff] [blame^] | 32 | int omap2xxx_clkdm_sleep(struct clockdomain *clkdm) |
| 33 | { |
| 34 | omap2_prm_set_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, |
| 35 | clkdm->pwrdm.ptr->prcm_offs, |
| 36 | OMAP2_PM_PWSTCTRL); |
| 37 | return 0; |
| 38 | } |
| 39 | |
| 40 | int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm) |
| 41 | { |
| 42 | omap2_prm_clear_mod_reg_bits(OMAP24XX_FORCESTATE_MASK, |
| 43 | clkdm->pwrdm.ptr->prcm_offs, |
| 44 | OMAP2_PM_PWSTCTRL); |
| 45 | return 0; |
| 46 | } |
| 47 | |
Paul Walmsley | 4981539 | 2012-10-21 01:01:10 -0600 | [diff] [blame] | 48 | struct pwrdm_ops omap2_pwrdm_operations = { |
| 49 | .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst, |
| 50 | .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst, |
| 51 | .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst, |
| 52 | .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst, |
| 53 | .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst, |
| 54 | .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst, |
| 55 | .pwrdm_read_mem_pwrst = omap2_pwrdm_read_mem_pwrst, |
| 56 | .pwrdm_read_mem_retst = omap2_pwrdm_read_mem_retst, |
| 57 | .pwrdm_wait_transition = omap2_pwrdm_wait_transition, |
| 58 | }; |