summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/serial.c')
-rw-r--r--arch/arm/mach-omap2/serial.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index f6601563aa6..b1f3fb1d396 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -22,6 +22,7 @@
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/delay.h>
+#include <linux/spinlock.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
@@ -81,7 +82,7 @@ static struct omap_uart_port_info omap_serial_default_info[] __initdata = {
};
#ifdef CONFIG_PM
-static void omap_uart_enable_wakeup(struct device *dev, bool enable)
+void omap_uart_enable_wakeup(struct device *dev, bool enable)
{
struct platform_device *pdev = to_platform_device(dev);
struct omap_device *od = to_omap_device(pdev);
@@ -94,10 +95,35 @@ static void omap_uart_enable_wakeup(struct device *dev, bool enable)
else
omap_hwmod_disable_wakeup(od->hwmods[0]);
}
+void omap_uart_remove_wakeup(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct omap_device *od = to_omap_device(pdev);
+ struct omap_hwmod *oh = od->hwmods[0];
+ u16 offs;
+ unsigned long flags;
+
+ spin_lock_irqsave(&oh->_lock, flags);
+ omap_hwmod_disable_wakeup(oh);
+ if (oh->class->sysc)
+ oh->class->sysc->sysc_flags &= ~SYSC_HAS_ENAWAKEUP;
+ offs = (oh->prcm.omap2.prcm_reg_id == 3) ?
+ OMAP3430ES2_PM_WKEN3 : PM_WKEN1;
+ omap2_prm_clear_mod_reg_bits((1<<oh->prcm.omap2.module_bit),
+ oh->prcm.omap2.module_offs, offs);
+ offs = (oh->prcm.omap2.prcm_reg_id == 3) ?
+ OMAP3430ES2_PM_WKST3 : PM_WKST1;
+ omap2_prm_set_mod_reg_bits((1<<oh->prcm.omap2.module_bit),
+ oh->prcm.omap2.module_offs, offs);
+ spin_unlock_irqrestore(&oh->_lock, flags);
+}
#else
-static void omap_uart_enable_wakeup(struct device *dev, bool enable)
+void omap_uart_enable_wakeup(struct device *dev, bool enable)
{}
+void omap_uart_remove_wakeup(struct device *dev)
+{
+}
#endif /* CONFIG_PM */
#ifdef CONFIG_OMAP_MUX
@@ -275,6 +301,7 @@ void __init omap_serial_init_port(struct omap_board_data *bdata,
omap_up.dma_rx_timeout = info->dma_rx_timeout;
omap_up.dma_rx_poll_rate = info->dma_rx_poll_rate;
omap_up.autosuspend_timeout = info->autosuspend_timeout;
+ omap_up.wake_peer = info->wake_peer;
omap_up.DTR_gpio = info->DTR_gpio;
omap_up.DTR_inverted = info->DTR_inverted;
omap_up.DTR_present = info->DTR_present;