From a489f45b89bbdb88faabcc1fab480ed9e6da8bf0 Mon Sep 17 00:00:00 2001 From: Girish S Ghongdemath Date: Wed, 5 Feb 2014 15:04:04 -0800 Subject: tty: serial: msm_serial_hs: Enable/Disable uart irq over clk on/off Keeping UART IRQ enabled all the time will gate XO shutdown in idle power collapse. Instead, handle enable/disable of irq within clk on/off functions. Also, making sure that wakeup irq is enabled before uart irq is disabled. CRs-Fixed: 606758 Change-Id: I5726fe6811e735ff3dac8d88ea86fd50fda0a61e Signed-off-by: Girish S Ghongdemath --- drivers/tty/serial/msm_serial_hs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/msm_serial_hs.c b/drivers/tty/serial/msm_serial_hs.c index 2ad8d40b3293..8f66cd34c97e 100644 --- a/drivers/tty/serial/msm_serial_hs.c +++ b/drivers/tty/serial/msm_serial_hs.c @@ -2204,6 +2204,12 @@ static int msm_hs_check_clock_off(struct uart_port *uport) if (use_low_power_wakeup(msm_uport)) { msm_uport->wakeup.ignore = 1; enable_irq(msm_uport->wakeup.irq); + /* + * keeping uport-irq enabled all the time + * gates XO shutdown in idle power collapse. Disable + * this only when wakeup irq is set. + */ + disable_irq(uport->irq); } wake_unlock(&msm_uport->dma_wake_lock); @@ -2412,8 +2418,11 @@ void msm_hs_request_clock_on(struct uart_port *uport) switch (msm_uport->clk_state) { case MSM_HS_CLK_OFF: wake_lock(&msm_uport->dma_wake_lock); - if (use_low_power_wakeup(msm_uport)) + if (use_low_power_wakeup(msm_uport)) { disable_irq_nosync(msm_uport->wakeup.irq); + /* uport-irq was disabled when clocked off */ + enable_irq(uport->irq); + } spin_unlock_irqrestore(&uport->lock, flags); ret = msm_hs_clock_vote(msm_uport); -- cgit v1.2.3