diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-05 19:55:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-05 19:55:56 -0400 |
commit | a22e48cf317d22a4326dc19e906e6b5f4f92e94e (patch) | |
tree | e3573ec1f96c50e52efe8717d9a99f249c4a65cf /drivers/tty/serial/imx.c | |
parent | ec064d3c6b40697fd72f4b1eeabbf293b7947a04 (diff) | |
parent | 4b4ecd9cb853c14913a3726cfcc60ccda1d2924a (diff) |
Merge tag 'tty-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial updates from Greg KH:
"Here is the big tty/serial driver update for 4.18-rc1.
There's nothing major here, just lots of serial driver updates. Full
details are in the shortlog, nothing anything specific to call out
here.
All have been in linux-next for a while with no reported issues"
* tag 'tty-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (55 commits)
vt: Perform safe console erase only once
serial: imx: disable UCR4_OREN on shutdown
serial: imx: drop CTS/RTS handling from shutdown
tty: fix typo in ASYNCB_FOURPORT comment
serial: samsung: check DMA engine capabilities before using DMA mode
tty: Fix data race in tty_insert_flip_string_fixed_flag
tty: serial: msm_geni_serial: Fix TX infinite loop
serial: 8250_dw: Fix runtime PM handling
serial: 8250: omap: Fix idling of clocks for unused uarts
tty: serial: drop ATH79 specific SoC symbols
serial: 8250: Add missing rxtrig_bytes on Altera 16550 UART
serial/aspeed-vuart: fix a couple mod_timer() calls
serial: sh-sci: Use spin_{try}lock_irqsave instead of open coding version
serial: 8250_of: Add IO space support
tty/serial: atmel: use port->name as name in request_irq()
serial: imx: dma_unmap_sg buffers on shutdown
serial: imx: cleanup imx_uart_disable_dma()
tty: serial: qcom_geni_serial: Add early console support
tty: serial: qcom_geni_serial: Return IRQ_NONE for spurious interrupts
tty: serial: qcom_geni_serial: Use iowrite32_rep to write to FIFO
...
Diffstat (limited to 'drivers/tty/serial/imx.c')
-rw-r--r-- | drivers/tty/serial/imx.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index c2fc6bef7a6f..4e853570ea80 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -1291,18 +1291,13 @@ static void imx_uart_enable_dma(struct imx_port *sport) | |||
1291 | 1291 | ||
1292 | static void imx_uart_disable_dma(struct imx_port *sport) | 1292 | static void imx_uart_disable_dma(struct imx_port *sport) |
1293 | { | 1293 | { |
1294 | u32 ucr1, ucr2; | 1294 | u32 ucr1; |
1295 | 1295 | ||
1296 | /* clear UCR1 */ | 1296 | /* clear UCR1 */ |
1297 | ucr1 = imx_uart_readl(sport, UCR1); | 1297 | ucr1 = imx_uart_readl(sport, UCR1); |
1298 | ucr1 &= ~(UCR1_RXDMAEN | UCR1_TXDMAEN | UCR1_ATDMAEN); | 1298 | ucr1 &= ~(UCR1_RXDMAEN | UCR1_TXDMAEN | UCR1_ATDMAEN); |
1299 | imx_uart_writel(sport, ucr1, UCR1); | 1299 | imx_uart_writel(sport, ucr1, UCR1); |
1300 | 1300 | ||
1301 | /* clear UCR2 */ | ||
1302 | ucr2 = imx_uart_readl(sport, UCR2); | ||
1303 | ucr2 &= ~(UCR2_CTSC | UCR2_CTS | UCR2_ATEN); | ||
1304 | imx_uart_writel(sport, ucr2, UCR2); | ||
1305 | |||
1306 | imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT); | 1301 | imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT); |
1307 | 1302 | ||
1308 | sport->dma_is_enabled = 0; | 1303 | sport->dma_is_enabled = 0; |
@@ -1427,13 +1422,21 @@ static void imx_uart_shutdown(struct uart_port *port) | |||
1427 | { | 1422 | { |
1428 | struct imx_port *sport = (struct imx_port *)port; | 1423 | struct imx_port *sport = (struct imx_port *)port; |
1429 | unsigned long flags; | 1424 | unsigned long flags; |
1430 | u32 ucr1, ucr2; | 1425 | u32 ucr1, ucr2, ucr4; |
1431 | 1426 | ||
1432 | if (sport->dma_is_enabled) { | 1427 | if (sport->dma_is_enabled) { |
1433 | sport->dma_is_rxing = 0; | ||
1434 | sport->dma_is_txing = 0; | ||
1435 | dmaengine_terminate_sync(sport->dma_chan_tx); | 1428 | dmaengine_terminate_sync(sport->dma_chan_tx); |
1429 | if (sport->dma_is_txing) { | ||
1430 | dma_unmap_sg(sport->port.dev, &sport->tx_sgl[0], | ||
1431 | sport->dma_tx_nents, DMA_TO_DEVICE); | ||
1432 | sport->dma_is_txing = 0; | ||
1433 | } | ||
1436 | dmaengine_terminate_sync(sport->dma_chan_rx); | 1434 | dmaengine_terminate_sync(sport->dma_chan_rx); |
1435 | if (sport->dma_is_rxing) { | ||
1436 | dma_unmap_sg(sport->port.dev, &sport->rx_sgl, | ||
1437 | 1, DMA_FROM_DEVICE); | ||
1438 | sport->dma_is_rxing = 0; | ||
1439 | } | ||
1437 | 1440 | ||
1438 | spin_lock_irqsave(&sport->port.lock, flags); | 1441 | spin_lock_irqsave(&sport->port.lock, flags); |
1439 | imx_uart_stop_tx(port); | 1442 | imx_uart_stop_tx(port); |
@@ -1449,6 +1452,10 @@ static void imx_uart_shutdown(struct uart_port *port) | |||
1449 | ucr2 = imx_uart_readl(sport, UCR2); | 1452 | ucr2 = imx_uart_readl(sport, UCR2); |
1450 | ucr2 &= ~(UCR2_TXEN | UCR2_ATEN); | 1453 | ucr2 &= ~(UCR2_TXEN | UCR2_ATEN); |
1451 | imx_uart_writel(sport, ucr2, UCR2); | 1454 | imx_uart_writel(sport, ucr2, UCR2); |
1455 | |||
1456 | ucr4 = imx_uart_readl(sport, UCR4); | ||
1457 | ucr4 &= ~UCR4_OREN; | ||
1458 | imx_uart_writel(sport, ucr4, UCR4); | ||
1452 | spin_unlock_irqrestore(&sport->port.lock, flags); | 1459 | spin_unlock_irqrestore(&sport->port.lock, flags); |
1453 | 1460 | ||
1454 | /* | 1461 | /* |
@@ -2425,8 +2432,7 @@ static void imx_uart_enable_wakeup(struct imx_port *sport, bool on) | |||
2425 | 2432 | ||
2426 | static int imx_uart_suspend_noirq(struct device *dev) | 2433 | static int imx_uart_suspend_noirq(struct device *dev) |
2427 | { | 2434 | { |
2428 | struct platform_device *pdev = to_platform_device(dev); | 2435 | struct imx_port *sport = dev_get_drvdata(dev); |
2429 | struct imx_port *sport = platform_get_drvdata(pdev); | ||
2430 | 2436 | ||
2431 | imx_uart_save_context(sport); | 2437 | imx_uart_save_context(sport); |
2432 | 2438 | ||
@@ -2437,8 +2443,7 @@ static int imx_uart_suspend_noirq(struct device *dev) | |||
2437 | 2443 | ||
2438 | static int imx_uart_resume_noirq(struct device *dev) | 2444 | static int imx_uart_resume_noirq(struct device *dev) |
2439 | { | 2445 | { |
2440 | struct platform_device *pdev = to_platform_device(dev); | 2446 | struct imx_port *sport = dev_get_drvdata(dev); |
2441 | struct imx_port *sport = platform_get_drvdata(pdev); | ||
2442 | int ret; | 2447 | int ret; |
2443 | 2448 | ||
2444 | ret = clk_enable(sport->clk_ipg); | 2449 | ret = clk_enable(sport->clk_ipg); |
@@ -2452,8 +2457,7 @@ static int imx_uart_resume_noirq(struct device *dev) | |||
2452 | 2457 | ||
2453 | static int imx_uart_suspend(struct device *dev) | 2458 | static int imx_uart_suspend(struct device *dev) |
2454 | { | 2459 | { |
2455 | struct platform_device *pdev = to_platform_device(dev); | 2460 | struct imx_port *sport = dev_get_drvdata(dev); |
2456 | struct imx_port *sport = platform_get_drvdata(pdev); | ||
2457 | int ret; | 2461 | int ret; |
2458 | 2462 | ||
2459 | uart_suspend_port(&imx_uart_uart_driver, &sport->port); | 2463 | uart_suspend_port(&imx_uart_uart_driver, &sport->port); |
@@ -2471,8 +2475,7 @@ static int imx_uart_suspend(struct device *dev) | |||
2471 | 2475 | ||
2472 | static int imx_uart_resume(struct device *dev) | 2476 | static int imx_uart_resume(struct device *dev) |
2473 | { | 2477 | { |
2474 | struct platform_device *pdev = to_platform_device(dev); | 2478 | struct imx_port *sport = dev_get_drvdata(dev); |
2475 | struct imx_port *sport = platform_get_drvdata(pdev); | ||
2476 | 2479 | ||
2477 | /* disable wakeup from i.MX UART */ | 2480 | /* disable wakeup from i.MX UART */ |
2478 | imx_uart_enable_wakeup(sport, false); | 2481 | imx_uart_enable_wakeup(sport, false); |
@@ -2487,8 +2490,7 @@ static int imx_uart_resume(struct device *dev) | |||
2487 | 2490 | ||
2488 | static int imx_uart_freeze(struct device *dev) | 2491 | static int imx_uart_freeze(struct device *dev) |
2489 | { | 2492 | { |
2490 | struct platform_device *pdev = to_platform_device(dev); | 2493 | struct imx_port *sport = dev_get_drvdata(dev); |
2491 | struct imx_port *sport = platform_get_drvdata(pdev); | ||
2492 | 2494 | ||
2493 | uart_suspend_port(&imx_uart_uart_driver, &sport->port); | 2495 | uart_suspend_port(&imx_uart_uart_driver, &sport->port); |
2494 | 2496 | ||
@@ -2497,8 +2499,7 @@ static int imx_uart_freeze(struct device *dev) | |||
2497 | 2499 | ||
2498 | static int imx_uart_thaw(struct device *dev) | 2500 | static int imx_uart_thaw(struct device *dev) |
2499 | { | 2501 | { |
2500 | struct platform_device *pdev = to_platform_device(dev); | 2502 | struct imx_port *sport = dev_get_drvdata(dev); |
2501 | struct imx_port *sport = platform_get_drvdata(pdev); | ||
2502 | 2503 | ||
2503 | uart_resume_port(&imx_uart_uart_driver, &sport->port); | 2504 | uart_resume_port(&imx_uart_uart_driver, &sport->port); |
2504 | 2505 | ||