diff options
Diffstat (limited to 'drivers/serial/imx.c')
-rw-r--r-- | drivers/serial/imx.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c index c3b7a6673e9c..d202eb4f3848 100644 --- a/drivers/serial/imx.c +++ b/drivers/serial/imx.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <asm/io.h> | 45 | #include <asm/io.h> |
46 | #include <asm/irq.h> | 46 | #include <asm/irq.h> |
47 | #include <asm/hardware.h> | 47 | #include <asm/hardware.h> |
48 | #include <asm/arch/imx-uart.h> | ||
48 | 49 | ||
49 | /* We've been assigned a range on the "Low-density serial ports" major */ | 50 | /* We've been assigned a range on the "Low-density serial ports" major */ |
50 | #define SERIAL_IMX_MAJOR 204 | 51 | #define SERIAL_IMX_MAJOR 204 |
@@ -73,7 +74,8 @@ struct imx_port { | |||
73 | struct uart_port port; | 74 | struct uart_port port; |
74 | struct timer_list timer; | 75 | struct timer_list timer; |
75 | unsigned int old_status; | 76 | unsigned int old_status; |
76 | int txirq,rxirq,rtsirq; | 77 | int txirq,rxirq,rtsirq; |
78 | int have_rtscts:1; | ||
77 | }; | 79 | }; |
78 | 80 | ||
79 | /* | 81 | /* |
@@ -491,8 +493,12 @@ imx_set_termios(struct uart_port *port, struct termios *termios, | |||
491 | ucr2 = UCR2_SRST | UCR2_IRTS; | 493 | ucr2 = UCR2_SRST | UCR2_IRTS; |
492 | 494 | ||
493 | if (termios->c_cflag & CRTSCTS) { | 495 | if (termios->c_cflag & CRTSCTS) { |
494 | ucr2 &= ~UCR2_IRTS; | 496 | if( sport->have_rtscts ) { |
495 | ucr2 |= UCR2_CTSC; | 497 | ucr2 &= ~UCR2_IRTS; |
498 | ucr2 |= UCR2_CTSC; | ||
499 | } else { | ||
500 | termios->c_cflag &= ~CRTSCTS; | ||
501 | } | ||
496 | } | 502 | } |
497 | 503 | ||
498 | if (termios->c_cflag & CSTOPB) | 504 | if (termios->c_cflag & CSTOPB) |
@@ -719,27 +725,6 @@ static void __init imx_init_ports(void) | |||
719 | imx_ports[i].timer.function = imx_timeout; | 725 | imx_ports[i].timer.function = imx_timeout; |
720 | imx_ports[i].timer.data = (unsigned long)&imx_ports[i]; | 726 | imx_ports[i].timer.data = (unsigned long)&imx_ports[i]; |
721 | } | 727 | } |
722 | |||
723 | imx_gpio_mode(PC9_PF_UART1_CTS); | ||
724 | imx_gpio_mode(PC10_PF_UART1_RTS); | ||
725 | imx_gpio_mode(PC11_PF_UART1_TXD); | ||
726 | imx_gpio_mode(PC12_PF_UART1_RXD); | ||
727 | imx_gpio_mode(PB28_PF_UART2_CTS); | ||
728 | imx_gpio_mode(PB29_PF_UART2_RTS); | ||
729 | |||
730 | imx_gpio_mode(PB30_PF_UART2_TXD); | ||
731 | imx_gpio_mode(PB31_PF_UART2_RXD); | ||
732 | |||
733 | #if 0 /* We don't need these, on the mx1 the _modem_ side of the uart | ||
734 | * is implemented. | ||
735 | */ | ||
736 | imx_gpio_mode(PD7_AF_UART2_DTR); | ||
737 | imx_gpio_mode(PD8_AF_UART2_DCD); | ||
738 | imx_gpio_mode(PD9_AF_UART2_RI); | ||
739 | imx_gpio_mode(PD10_AF_UART2_DSR); | ||
740 | #endif | ||
741 | |||
742 | |||
743 | } | 728 | } |
744 | 729 | ||
745 | #ifdef CONFIG_SERIAL_IMX_CONSOLE | 730 | #ifdef CONFIG_SERIAL_IMX_CONSOLE |
@@ -932,7 +917,14 @@ static int serial_imx_resume(struct platform_device *dev) | |||
932 | 917 | ||
933 | static int serial_imx_probe(struct platform_device *dev) | 918 | static int serial_imx_probe(struct platform_device *dev) |
934 | { | 919 | { |
920 | struct imxuart_platform_data *pdata; | ||
921 | |||
935 | imx_ports[dev->id].port.dev = &dev->dev; | 922 | imx_ports[dev->id].port.dev = &dev->dev; |
923 | |||
924 | pdata = (struct imxuart_platform_data *)dev->dev.platform_data; | ||
925 | if(pdata && (pdata->flags & IMXUART_HAVE_RTSCTS)) | ||
926 | imx_ports[dev->id].have_rtscts = 1; | ||
927 | |||
936 | uart_add_one_port(&imx_reg, &imx_ports[dev->id].port); | 928 | uart_add_one_port(&imx_reg, &imx_ports[dev->id].port); |
937 | platform_set_drvdata(dev, &imx_ports[dev->id]); | 929 | platform_set_drvdata(dev, &imx_ports[dev->id]); |
938 | return 0; | 930 | return 0; |