ARM: OMAP2+: UART: Add runtime pm support for omap-serial driver
authorGovindraj.R <govindraj.raja@ti.com>
Mon, 28 Feb 2011 12:42:23 +0000 (18:12 +0530)
committerKevin Hilman <khilman@ti.com>
Thu, 15 Dec 2011 00:05:20 +0000 (16:05 -0800)
commitfcdca75728ac376f3de74376c791e1078ee83820
tree505fdb659fc4c54887128ca7c49d7eeba6cf3ab2
parentedd70ad757e9b336116433e6e62de79ae1dfef54
ARM: OMAP2+: UART: Add runtime pm support for omap-serial driver

Adapts omap-serial driver to use pm_runtime API's.
Use runtime runtime API's to handle uart clocks and obtain
device_usage statics. Set runtime API's usage to irq_safe so that
we can use get_sync from irq context. Auto-suspend for port specific
activities and put for reg access. Moving suspend/resume hooks
to dev_pm_ops structure and bind with config_suspend to avoid any
compilation warning if config_suspend is disabled.

By default uart autosuspend delay is set to -1 to avoid character loss
if uart's are autoidled and woken up on rx pin.

After boot up UART's can be autoidled by setting autosuspend delay from sysfs.

echo 3000 > /sys/devices/platform/omap/omap_uart.X/power/autosuspend_delay_ms
X=0,1,2,3 for UART1/2/3/4. Number of uarts available may vary across omap_soc.

Also if uart is not wakeup capable we can prevent runtime autosuspend by
forbiding runtime.

Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Acked-by: Alan Cox <alan@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kevin Hilman <khilman@ti.com>
drivers/tty/serial/omap-serial.c