mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
tty: serial: msm: Add suspend resume support
Add suspend/resume callback support to serial msm driver. Change-Id: I661fca45d2d762a08e331f53d8b3cb7b99117448 Signed-off-by: Pramod Gurav <gpramod@codeaurora.org> Signed-off-by: Runmin Wang <runminw@codeaurora.org> Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
This commit is contained in:
parent
db5f5ed622
commit
4e6b827af1
1 changed files with 27 additions and 13 deletions
|
|
@ -1160,15 +1160,6 @@ static int msm_set_baud_rate(struct uart_port *port, unsigned int baud,
|
|||
return baud;
|
||||
}
|
||||
|
||||
static void msm_init_clock(struct uart_port *port)
|
||||
{
|
||||
struct msm_port *msm_port = UART_TO_MSM(port);
|
||||
|
||||
clk_prepare_enable(msm_port->clk);
|
||||
clk_prepare_enable(msm_port->pclk);
|
||||
msm_serial_set_mnd_regs(port);
|
||||
}
|
||||
|
||||
static int msm_startup(struct uart_port *port)
|
||||
{
|
||||
struct msm_port *msm_port = UART_TO_MSM(port);
|
||||
|
|
@ -1178,7 +1169,19 @@ static int msm_startup(struct uart_port *port)
|
|||
snprintf(msm_port->name, sizeof(msm_port->name),
|
||||
"msm_serial%d", port->line);
|
||||
|
||||
msm_init_clock(port);
|
||||
/*
|
||||
* UART clk must be kept enabled to
|
||||
* avoid losing received character
|
||||
*/
|
||||
ret = clk_prepare_enable(msm_port->clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = clk_prepare_enable(msm_port->pclk);
|
||||
if (ret)
|
||||
goto err_pclk;
|
||||
|
||||
msm_serial_set_mnd_regs(port);
|
||||
|
||||
if (likely(port->fifosize > 12))
|
||||
rfr_level = port->fifosize - 12;
|
||||
|
|
@ -1217,6 +1220,8 @@ err_irq:
|
|||
|
||||
clk_disable_unprepare(msm_port->pclk);
|
||||
clk_disable_unprepare(msm_port->clk);
|
||||
err_pclk:
|
||||
clk_disable_unprepare(msm_port->clk);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1231,6 +1236,7 @@ static void msm_shutdown(struct uart_port *port)
|
|||
if (msm_port->is_uartdm)
|
||||
msm_release_dma(msm_port);
|
||||
|
||||
clk_disable_unprepare(msm_port->pclk);
|
||||
clk_disable_unprepare(msm_port->clk);
|
||||
|
||||
free_irq(port->irq, port);
|
||||
|
|
@ -1397,8 +1403,16 @@ static void msm_power(struct uart_port *port, unsigned int state,
|
|||
|
||||
switch (state) {
|
||||
case 0:
|
||||
clk_prepare_enable(msm_port->clk);
|
||||
clk_prepare_enable(msm_port->pclk);
|
||||
/*
|
||||
* UART clk must be kept enabled to
|
||||
* avoid losing received character
|
||||
*/
|
||||
if (clk_prepare_enable(msm_port->clk))
|
||||
return;
|
||||
if (clk_prepare_enable(msm_port->pclk)) {
|
||||
clk_disable_unprepare(msm_port->clk);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
clk_disable_unprepare(msm_port->clk);
|
||||
|
|
@ -1670,7 +1684,7 @@ static int msm_console_setup(struct console *co, char *options)
|
|||
if (unlikely(!port->membase))
|
||||
return -ENXIO;
|
||||
|
||||
msm_init_clock(port);
|
||||
msm_serial_set_mnd_regs(port);
|
||||
|
||||
if (options)
|
||||
uart_parse_options(options, &baud, &parity, &bits, &flow);
|
||||
|
|
|
|||
Loading…
Reference in a new issue