diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-23 20:43:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-23 20:43:53 -0400 |
commit | a5ebba6b54bc8038a38d3eacac3a79bbeaf3ee24 (patch) | |
tree | d36eb26a7efd4e00381bc9f6474ea3ec31340585 /arch/arm/mach-omap2/prm44xx.c | |
parent | e81218f5f0fd219bd75768d845159ba4810bdd48 (diff) | |
parent | 6b21a9ce0402e0c5fd2adfa3d41328fdd8f55a9a (diff) |
Merge tag 'pm' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull arm-soc power management changes from Arnd Bergmann:
"These are various power management related changes, mainly concerning
cpuidle on i.MX and OMAP, as well as a the move of the omap
smartreflex driver to live in the power subsystem."
Fix up conflicts in arch/arm/mach-{imx/mach-imx6q.c,omap2/prm2xxx_3xxx.h}
* tag 'pm' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (37 commits)
ARM: OMAP2+: PM: fix IRQ_NOAUTOEN removal by mis-merge
ARM: OMAP2+: do not allow SmartReflex to be built as a module
ARM: OMAP2: Use hwmod to initialize mmc for 2420
ARM: OMAP3: PM: cpuidle: optimize the clkdm idle latency in C1 state
ARM: OMAP3: PM: cpuidle: optimize the PER latency in C1 state
ARM: OMAP3: PM: cpuidle: default to C1 in next_valid_state
ARM: OMAP3: PM: cleanup cam_pwrdm leftovers
ARM: OMAP3: PM: call pre/post transition per powerdomain
ARM: OMAP2+: powerdomain: allow pre/post transtion to be per pwrdm
ARM: OMAP3: PM: Remove IO Daisychain control from cpuidle
ARM: OMAP3PLUS: hwmod: reconfigure IO Daisychain during hwmod mux
ARM: OMAP3+: PRM: Enable IO wake up
ARM: OMAP4: PRM: Add IO Daisychain support
ARM: OMAP3: PM: Move IO Daisychain function to omap3 prm file
ARM: OMAP3: PM: correct enable/disable of daisy io chain
ARM: OMAP2+: PRM: fix compile for OMAP4-only build
W1: OMAP HDQ1W: use runtime PM
ARM: OMAP2+: HDQ1W: use omap_device
W1: OMAP HDQ1W: use 32-bit register accesses
W1: OMAP HDQ1W: allow driver to be built on all OMAP2+
...
Diffstat (limited to 'arch/arm/mach-omap2/prm44xx.c')
-rw-r--r-- | arch/arm/mach-omap2/prm44xx.c | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index f106d21ff581..bb727c2d9337 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c | |||
@@ -233,10 +233,71 @@ void omap44xx_prm_restore_irqen(u32 *saved_mask) | |||
233 | OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); | 233 | OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); |
234 | } | 234 | } |
235 | 235 | ||
236 | /** | ||
237 | * omap44xx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain | ||
238 | * | ||
239 | * Clear any previously-latched I/O wakeup events and ensure that the | ||
240 | * I/O wakeup gates are aligned with the current mux settings. Works | ||
241 | * by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then | ||
242 | * deasserting WUCLKIN and waiting for WUCLKOUT to be deasserted. | ||
243 | * No return value. XXX Are the final two steps necessary? | ||
244 | */ | ||
245 | void omap44xx_prm_reconfigure_io_chain(void) | ||
246 | { | ||
247 | int i = 0; | ||
248 | |||
249 | /* Trigger WUCLKIN enable */ | ||
250 | omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, | ||
251 | OMAP4430_WUCLK_CTRL_MASK, | ||
252 | OMAP4430_PRM_DEVICE_INST, | ||
253 | OMAP4_PRM_IO_PMCTRL_OFFSET); | ||
254 | omap_test_timeout( | ||
255 | (((omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, | ||
256 | OMAP4_PRM_IO_PMCTRL_OFFSET) & | ||
257 | OMAP4430_WUCLK_STATUS_MASK) >> | ||
258 | OMAP4430_WUCLK_STATUS_SHIFT) == 1), | ||
259 | MAX_IOPAD_LATCH_TIME, i); | ||
260 | if (i == MAX_IOPAD_LATCH_TIME) | ||
261 | pr_warn("PRM: I/O chain clock line assertion timed out\n"); | ||
262 | |||
263 | /* Trigger WUCLKIN disable */ | ||
264 | omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0, | ||
265 | OMAP4430_PRM_DEVICE_INST, | ||
266 | OMAP4_PRM_IO_PMCTRL_OFFSET); | ||
267 | omap_test_timeout( | ||
268 | (((omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, | ||
269 | OMAP4_PRM_IO_PMCTRL_OFFSET) & | ||
270 | OMAP4430_WUCLK_STATUS_MASK) >> | ||
271 | OMAP4430_WUCLK_STATUS_SHIFT) == 0), | ||
272 | MAX_IOPAD_LATCH_TIME, i); | ||
273 | if (i == MAX_IOPAD_LATCH_TIME) | ||
274 | pr_warn("PRM: I/O chain clock line deassertion timed out\n"); | ||
275 | |||
276 | return; | ||
277 | } | ||
278 | |||
279 | /** | ||
280 | * omap44xx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches | ||
281 | * | ||
282 | * Activates the I/O wakeup event latches and allows events logged by | ||
283 | * those latches to signal a wakeup event to the PRCM. For I/O wakeups | ||
284 | * to occur, WAKEUPENABLE bits must be set in the pad mux registers, and | ||
285 | * omap44xx_prm_reconfigure_io_chain() must be called. No return value. | ||
286 | */ | ||
287 | static void __init omap44xx_prm_enable_io_wakeup(void) | ||
288 | { | ||
289 | omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK, | ||
290 | OMAP4430_GLOBAL_WUEN_MASK, | ||
291 | OMAP4430_PRM_DEVICE_INST, | ||
292 | OMAP4_PRM_IO_PMCTRL_OFFSET); | ||
293 | } | ||
294 | |||
236 | static int __init omap4xxx_prcm_init(void) | 295 | static int __init omap4xxx_prcm_init(void) |
237 | { | 296 | { |
238 | if (cpu_is_omap44xx()) | 297 | if (cpu_is_omap44xx()) { |
298 | omap44xx_prm_enable_io_wakeup(); | ||
239 | return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); | 299 | return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); |
300 | } | ||
240 | return 0; | 301 | return 0; |
241 | } | 302 | } |
242 | subsys_initcall(omap4xxx_prcm_init); | 303 | subsys_initcall(omap4xxx_prcm_init); |