]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
OMAP3: PM: UART: disable clocks when idle
authorKevin Hilman <khilman@deeprootsystems.com>
Mon, 8 Dec 2008 17:38:14 +0000 (09:38 -0800)
committerKevin Hilman <khilman@deeprootsystems.com>
Wed, 7 Jan 2009 22:03:20 +0000 (14:03 -0800)
commit77d8bc05d620bf469a5cf6ef1621ff7235d78080
tree1b208a0cd1f0c5e634e344bf07d85aec483a8de1
parent6bcb6267a4ad617dee92d04947ef7f9cc78266bb
OMAP3: PM: UART: disable clocks when idle

This patch allows the UART clocks to be disabled when the OMAP UARTs
are inactive, thus permitting the chip to hit retention in idle.
After the timeout of an activity timer, each UART is allowed to
disable its clocks so the system can enter retention.  The activity
timer is (re)activated on any UART interrupt, UART wake event or any
IO pad wakeup.  The actual disable of the UART clocks is done in the
'prepare_idle' hook called from the OMAP idle loop.

While the activity timer is active, the smart-idle mode of the UART is
also disabled.  This is due to a "feature" of the UART module that
after a UART wakeup, the smart-idle mode may be entered before the
UART has communicated the interrupt, or upon TX, an idle mode may be
entered before the TX FIFOs are emptied.

Upon suspend, the 'prepare_suspend' hook cancels any pending activity
timers and allows the clocks to be disabled.

To enable the clock-disabling feature of this patch, do

  # echo 1 > /sys/power/clocks_off_while_idle

Special thanks to Tero Kristo for the initial ideas and first versions
of UART idle support, and to Jouni Hogander for extra testing and
bugfixes.

Tested on OMAP3 (Beagle, custom HW) and OMAP2 (n810)

Cc: Tero Kristo <tero.kristo@nokia.com>
Cc: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
arch/arm/mach-omap2/pm-debug.c
arch/arm/mach-omap2/pm.h
arch/arm/mach-omap2/pm24xx.c
arch/arm/mach-omap2/pm34xx.c
arch/arm/mach-omap2/serial.c
arch/arm/plat-omap/include/mach/common.h
arch/arm/plat-omap/include/mach/serial.h