Commit edf4edac authored by Sudhir Sreedharan's avatar Sudhir Sreedharan Committed by Greg Kroah-Hartman

tty: serial: 8250_core: restore the LCR register in set_sleep

In ST16650V2 based serial uarts, while initalizing the PM state,
LCR registers are being initialized to 0 in serial8250_set_sleep().
If console port is already initialized and being used, this will
throws garbage in the console.
Signed-off-by: default avatarSudhir Sreedharan <ssreedharan@mvista.com>
Reviewed-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Tested-by: default avatarKevin Hilman <khilman@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 513e4385
...@@ -595,6 +595,7 @@ static void serial8250_rpm_put_tx(struct uart_8250_port *p) ...@@ -595,6 +595,7 @@ static void serial8250_rpm_put_tx(struct uart_8250_port *p)
*/ */
static void serial8250_set_sleep(struct uart_8250_port *p, int sleep) static void serial8250_set_sleep(struct uart_8250_port *p, int sleep)
{ {
unsigned char lcr = 0, efr = 0;
/* /*
* Exar UARTs have a SLEEP register that enables or disables * Exar UARTs have a SLEEP register that enables or disables
* each UART to enter sleep mode separately. On the XR17V35x the * each UART to enter sleep mode separately. On the XR17V35x the
...@@ -611,6 +612,8 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep) ...@@ -611,6 +612,8 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep)
if (p->capabilities & UART_CAP_SLEEP) { if (p->capabilities & UART_CAP_SLEEP) {
if (p->capabilities & UART_CAP_EFR) { if (p->capabilities & UART_CAP_EFR) {
lcr = serial_in(p, UART_LCR);
efr = serial_in(p, UART_EFR);
serial_out(p, UART_LCR, UART_LCR_CONF_MODE_B); serial_out(p, UART_LCR, UART_LCR_CONF_MODE_B);
serial_out(p, UART_EFR, UART_EFR_ECB); serial_out(p, UART_EFR, UART_EFR_ECB);
serial_out(p, UART_LCR, 0); serial_out(p, UART_LCR, 0);
...@@ -618,8 +621,8 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep) ...@@ -618,8 +621,8 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep)
serial_out(p, UART_IER, sleep ? UART_IERX_SLEEP : 0); serial_out(p, UART_IER, sleep ? UART_IERX_SLEEP : 0);
if (p->capabilities & UART_CAP_EFR) { if (p->capabilities & UART_CAP_EFR) {
serial_out(p, UART_LCR, UART_LCR_CONF_MODE_B); serial_out(p, UART_LCR, UART_LCR_CONF_MODE_B);
serial_out(p, UART_EFR, 0); serial_out(p, UART_EFR, efr);
serial_out(p, UART_LCR, 0); serial_out(p, UART_LCR, lcr);
} }
} }
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment