mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08: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> [Resolved conflicts in msm-serial.c] Signed-off-by: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
This commit is contained in:
parent
207681796f
commit
9e1fb36e50
@ -1157,15 +1157,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);
|
||||
@ -1175,7 +1166,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;
|
||||
@ -1214,6 +1217,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;
|
||||
}
|
||||
@ -1228,6 +1233,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);
|
||||
@ -1394,8 +1400,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);
|
||||
@ -1658,7 +1672,7 @@ static int __init 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…
x
Reference in New Issue
Block a user