aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2011-08-11 23:15:51 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-23 13:48:31 -0400
commit47918f055851d3faae2a62d406b5d065b579a1a3 (patch)
tree934cd159a89fb3040525c2ce978f1a3b4bbaa392 /drivers/tty
parent502fcb796c4e9f9966f34cb253b881d00bf90eae (diff)
serial:bfin_uart: Put TX IRQ in individual platform resource.
Serial TX IRQ is not RX IRQ plus 1 in some blackfin chips. Give individual platform resources to both TX and RX irqs. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/bfin_uart.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index e08bc046c1bd..c7e592df42c0 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -667,17 +667,17 @@ static int bfin_serial_startup(struct uart_port *port)
667 kgdboc_break_enabled = 0; 667 kgdboc_break_enabled = 0;
668 else { 668 else {
669# endif 669# endif
670 if (request_irq(uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED, 670 if (request_irq(uart->rx_irq, bfin_serial_rx_int, IRQF_DISABLED,
671 "BFIN_UART_RX", uart)) { 671 "BFIN_UART_RX", uart)) {
672 printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n"); 672 printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n");
673 return -EBUSY; 673 return -EBUSY;
674 } 674 }
675 675
676 if (request_irq 676 if (request_irq
677 (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED, 677 (uart->tx_irq, bfin_serial_tx_int, IRQF_DISABLED,
678 "BFIN_UART_TX", uart)) { 678 "BFIN_UART_TX", uart)) {
679 printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n"); 679 printk(KERN_NOTICE "Unable to attach BlackFin UART TX interrupt\n");
680 free_irq(uart->port.irq, uart); 680 free_irq(uart->rx_irq, uart);
681 return -EBUSY; 681 return -EBUSY;
682 } 682 }
683 683
@@ -692,7 +692,7 @@ static int bfin_serial_startup(struct uart_port *port)
692 */ 692 */
693 unsigned uart_dma_ch_rx, uart_dma_ch_tx; 693 unsigned uart_dma_ch_rx, uart_dma_ch_tx;
694 694
695 switch (uart->port.irq) { 695 switch (uart->rx_irq) {
696 case IRQ_UART3_RX: 696 case IRQ_UART3_RX:
697 uart_dma_ch_rx = CH_UART3_RX; 697 uart_dma_ch_rx = CH_UART3_RX;
698 uart_dma_ch_tx = CH_UART3_TX; 698 uart_dma_ch_tx = CH_UART3_TX;
@@ -709,16 +709,16 @@ static int bfin_serial_startup(struct uart_port *port)
709 if (uart_dma_ch_rx && 709 if (uart_dma_ch_rx &&
710 request_dma(uart_dma_ch_rx, "BFIN_UART_RX") < 0) { 710 request_dma(uart_dma_ch_rx, "BFIN_UART_RX") < 0) {
711 printk(KERN_NOTICE"Fail to attach UART interrupt\n"); 711 printk(KERN_NOTICE"Fail to attach UART interrupt\n");
712 free_irq(uart->port.irq, uart); 712 free_irq(uart->rx_irq, uart);
713 free_irq(uart->port.irq + 1, uart); 713 free_irq(uart->tx_irq, uart);
714 return -EBUSY; 714 return -EBUSY;
715 } 715 }
716 if (uart_dma_ch_tx && 716 if (uart_dma_ch_tx &&
717 request_dma(uart_dma_ch_tx, "BFIN_UART_TX") < 0) { 717 request_dma(uart_dma_ch_tx, "BFIN_UART_TX") < 0) {
718 printk(KERN_NOTICE "Fail to attach UART interrupt\n"); 718 printk(KERN_NOTICE "Fail to attach UART interrupt\n");
719 free_dma(uart_dma_ch_rx); 719 free_dma(uart_dma_ch_rx);
720 free_irq(uart->port.irq, uart); 720 free_irq(uart->rx_irq, uart);
721 free_irq(uart->port.irq + 1, uart); 721 free_irq(uart->tx_irq, uart);
722 return -EBUSY; 722 return -EBUSY;
723 } 723 }
724 } 724 }
@@ -785,8 +785,8 @@ static void bfin_serial_shutdown(struct uart_port *port)
785 break; 785 break;
786 }; 786 };
787#endif 787#endif
788 free_irq(uart->port.irq, uart); 788 free_irq(uart->rx_irq, uart);
789 free_irq(uart->port.irq+1, uart); 789 free_irq(uart->tx_irq, uart);
790#endif 790#endif
791 791
792#ifdef CONFIG_SERIAL_BFIN_CTSRTS 792#ifdef CONFIG_SERIAL_BFIN_CTSRTS
@@ -1319,14 +1319,22 @@ static int bfin_serial_probe(struct platform_device *pdev)
1319 } 1319 }
1320 uart->port.mapbase = res->start; 1320 uart->port.mapbase = res->start;
1321 1321
1322 uart->port.irq = platform_get_irq(pdev, 0); 1322 uart->tx_irq = platform_get_irq(pdev, 0);
1323 if (uart->port.irq < 0) { 1323 if (uart->tx_irq < 0) {
1324 dev_err(&pdev->dev, "No uart RX/TX IRQ specified\n"); 1324 dev_err(&pdev->dev, "No uart TX IRQ specified\n");
1325 ret = -ENOENT; 1325 ret = -ENOENT;
1326 goto out_error_unmap; 1326 goto out_error_unmap;
1327 } 1327 }
1328 1328
1329 uart->status_irq = platform_get_irq(pdev, 1); 1329 uart->rx_irq = platform_get_irq(pdev, 1);
1330 if (uart->rx_irq < 0) {
1331 dev_err(&pdev->dev, "No uart RX IRQ specified\n");
1332 ret = -ENOENT;
1333 goto out_error_unmap;
1334 }
1335 uart->port.irq = uart->rx_irq;
1336
1337 uart->status_irq = platform_get_irq(pdev, 2);
1330 if (uart->status_irq < 0) { 1338 if (uart->status_irq < 0) {
1331 dev_err(&pdev->dev, "No uart status IRQ specified\n"); 1339 dev_err(&pdev->dev, "No uart status IRQ specified\n");
1332 ret = -ENOENT; 1340 ret = -ENOENT;