|
|
|
@ -24,7 +24,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> |
|
|
|
|
struct lpuart_port {
|
|
|
|
|
struct uart_port port;
|
|
|
|
|
struct clk *clk;
|
|
|
|
|
@@ -1348,6 +1350,18 @@ lpuart_set_termios(struct uart_port *por
|
|
|
|
|
@@ -1349,6 +1351,18 @@ lpuart_set_termios(struct uart_port *por
|
|
|
|
|
/* ask the core to calculate the divisor */
|
|
|
|
|
baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16);
|
|
|
|
|
|
|
|
|
@ -43,7 +43,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> |
|
|
|
|
spin_lock_irqsave(&sport->port.lock, flags);
|
|
|
|
|
|
|
|
|
|
sport->port.read_status_mask = 0;
|
|
|
|
|
@@ -1397,22 +1411,11 @@ lpuart_set_termios(struct uart_port *por
|
|
|
|
|
@@ -1398,22 +1412,11 @@ lpuart_set_termios(struct uart_port *por
|
|
|
|
|
/* restore control register */
|
|
|
|
|
writeb(old_cr2, sport->port.membase + UARTCR2);
|
|
|
|
|
|
|
|
|
@ -69,7 +69,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> |
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
spin_unlock_irqrestore(&sport->port.lock, flags);
|
|
|
|
|
@@ -1640,6 +1643,13 @@ lpuart_console_write(struct console *co,
|
|
|
|
|
@@ -1641,6 +1644,13 @@ lpuart_console_write(struct console *co,
|
|
|
|
|
{
|
|
|
|
|
struct lpuart_port *sport = lpuart_ports[co->index];
|
|
|
|
|
unsigned char old_cr2, cr2;
|
|
|
|
@ -83,7 +83,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> |
|
|
|
|
|
|
|
|
|
/* first save CR2 and then disable interrupts */
|
|
|
|
|
cr2 = old_cr2 = readb(sport->port.membase + UARTCR2);
|
|
|
|
|
@@ -1654,6 +1664,9 @@ lpuart_console_write(struct console *co,
|
|
|
|
|
@@ -1655,6 +1665,9 @@ lpuart_console_write(struct console *co,
|
|
|
|
|
barrier();
|
|
|
|
|
|
|
|
|
|
writeb(old_cr2, sport->port.membase + UARTCR2);
|
|
|
|
@ -93,7 +93,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> |
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
@@ -1661,6 +1674,13 @@ lpuart32_console_write(struct console *c
|
|
|
|
|
@@ -1662,6 +1675,13 @@ lpuart32_console_write(struct console *c
|
|
|
|
|
{
|
|
|
|
|
struct lpuart_port *sport = lpuart_ports[co->index];
|
|
|
|
|
unsigned long old_cr, cr;
|
|
|
|
@ -107,7 +107,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> |
|
|
|
|
|
|
|
|
|
/* first save CR2 and then disable interrupts */
|
|
|
|
|
cr = old_cr = lpuart32_read(sport->port.membase + UARTCTRL);
|
|
|
|
|
@@ -1675,6 +1695,9 @@ lpuart32_console_write(struct console *c
|
|
|
|
|
@@ -1676,6 +1696,9 @@ lpuart32_console_write(struct console *c
|
|
|
|
|
barrier();
|
|
|
|
|
|
|
|
|
|
lpuart32_write(old_cr, sport->port.membase + UARTCTRL);
|
|
|
|
@ -117,7 +117,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> |
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@@ -1899,13 +1922,13 @@ static int lpuart_probe(struct platform_
|
|
|
|
|
@@ -1900,13 +1923,13 @@ static int lpuart_probe(struct platform_
|
|
|
|
|
|
|
|
|
|
ret = of_alias_get_id(np, "serial");
|
|
|
|
|
if (ret < 0) {
|
|
|
|
@ -137,7 +137,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> |
|
|
|
|
sport->port.line = ret;
|
|
|
|
|
sport->lpuart32 = of_device_is_compatible(np, "fsl,ls1021a-lpuart");
|
|
|
|
|
|
|
|
|
|
@@ -1987,6 +2010,7 @@ static int lpuart_remove(struct platform
|
|
|
|
|
@@ -1988,6 +2011,7 @@ static int lpuart_remove(struct platform
|
|
|
|
|
struct lpuart_port *sport = platform_get_drvdata(pdev);
|
|
|
|
|
|
|
|
|
|
uart_remove_one_port(&lpuart_reg, &sport->port);
|
|
|
|
@ -145,7 +145,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> |
|
|
|
|
|
|
|
|
|
clk_disable_unprepare(sport->clk);
|
|
|
|
|
|
|
|
|
|
@@ -2071,12 +2095,10 @@ static int lpuart_resume(struct device *
|
|
|
|
|
@@ -2072,12 +2096,10 @@ static int lpuart_resume(struct device *
|
|
|
|
|
|
|
|
|
|
if (sport->lpuart_dma_rx_use) {
|
|
|
|
|
if (sport->port.irq_wake) {
|
|
|
|
|