diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/tty/rocket.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'drivers/tty/rocket.c')
-rw-r--r-- | drivers/tty/rocket.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c index e42009a0052..6a1241c7f84 100644 --- a/drivers/tty/rocket.c +++ b/drivers/tty/rocket.c | |||
@@ -118,7 +118,7 @@ static unsigned long board2; | |||
118 | static unsigned long board3; | 118 | static unsigned long board3; |
119 | static unsigned long board4; | 119 | static unsigned long board4; |
120 | static unsigned long controller; | 120 | static unsigned long controller; |
121 | static bool support_low_speed; | 121 | static int support_low_speed; |
122 | static unsigned long modem1; | 122 | static unsigned long modem1; |
123 | static unsigned long modem2; | 123 | static unsigned long modem2; |
124 | static unsigned long modem3; | 124 | static unsigned long modem3; |
@@ -673,7 +673,6 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev) | |||
673 | if (sInitChan(ctlp, &info->channel, aiop, chan) == 0) { | 673 | if (sInitChan(ctlp, &info->channel, aiop, chan) == 0) { |
674 | printk(KERN_ERR "RocketPort sInitChan(%d, %d, %d) failed!\n", | 674 | printk(KERN_ERR "RocketPort sInitChan(%d, %d, %d) failed!\n", |
675 | board, aiop, chan); | 675 | board, aiop, chan); |
676 | tty_port_destroy(&info->port); | ||
677 | kfree(info); | 676 | kfree(info); |
678 | return; | 677 | return; |
679 | } | 678 | } |
@@ -705,8 +704,8 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev) | |||
705 | spin_lock_init(&info->slock); | 704 | spin_lock_init(&info->slock); |
706 | mutex_init(&info->write_mtx); | 705 | mutex_init(&info->write_mtx); |
707 | rp_table[line] = info; | 706 | rp_table[line] = info; |
708 | tty_port_register_device(&info->port, rocket_driver, line, | 707 | tty_register_device(rocket_driver, line, pci_dev ? &pci_dev->dev : |
709 | pci_dev ? &pci_dev->dev : NULL); | 708 | NULL); |
710 | } | 709 | } |
711 | 710 | ||
712 | /* | 711 | /* |
@@ -721,7 +720,7 @@ static void configure_r_port(struct tty_struct *tty, struct r_port *info, | |||
721 | unsigned rocketMode; | 720 | unsigned rocketMode; |
722 | int bits, baud, divisor; | 721 | int bits, baud, divisor; |
723 | CHANNEL_t *cp; | 722 | CHANNEL_t *cp; |
724 | struct ktermios *t = &tty->termios; | 723 | struct ktermios *t = tty->termios; |
725 | 724 | ||
726 | cp = &info->channel; | 725 | cp = &info->channel; |
727 | cflag = t->c_cflag; | 726 | cflag = t->c_cflag; |
@@ -893,12 +892,12 @@ static int rp_open(struct tty_struct *tty, struct file *filp) | |||
893 | { | 892 | { |
894 | struct r_port *info; | 893 | struct r_port *info; |
895 | struct tty_port *port; | 894 | struct tty_port *port; |
896 | int retval; | 895 | int line = 0, retval; |
897 | CHANNEL_t *cp; | 896 | CHANNEL_t *cp; |
898 | unsigned long page; | 897 | unsigned long page; |
899 | 898 | ||
900 | info = rp_table[tty->index]; | 899 | line = tty->index; |
901 | if (info == NULL) | 900 | if (line < 0 || line >= MAX_RP_PORTS || ((info = rp_table[line]) == NULL)) |
902 | return -ENXIO; | 901 | return -ENXIO; |
903 | port = &info->port; | 902 | port = &info->port; |
904 | 903 | ||
@@ -979,7 +978,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp) | |||
979 | tty->alt_speed = 460800; | 978 | tty->alt_speed = 460800; |
980 | 979 | ||
981 | configure_r_port(tty, info, NULL); | 980 | configure_r_port(tty, info, NULL); |
982 | if (tty->termios.c_cflag & CBAUD) { | 981 | if (tty->termios->c_cflag & CBAUD) { |
983 | sSetDTR(cp); | 982 | sSetDTR(cp); |
984 | sSetRTS(cp); | 983 | sSetRTS(cp); |
985 | } | 984 | } |
@@ -1090,35 +1089,35 @@ static void rp_set_termios(struct tty_struct *tty, | |||
1090 | if (rocket_paranoia_check(info, "rp_set_termios")) | 1089 | if (rocket_paranoia_check(info, "rp_set_termios")) |
1091 | return; | 1090 | return; |
1092 | 1091 | ||
1093 | cflag = tty->termios.c_cflag; | 1092 | cflag = tty->termios->c_cflag; |
1094 | 1093 | ||
1095 | /* | 1094 | /* |
1096 | * This driver doesn't support CS5 or CS6 | 1095 | * This driver doesn't support CS5 or CS6 |
1097 | */ | 1096 | */ |
1098 | if (((cflag & CSIZE) == CS5) || ((cflag & CSIZE) == CS6)) | 1097 | if (((cflag & CSIZE) == CS5) || ((cflag & CSIZE) == CS6)) |
1099 | tty->termios.c_cflag = | 1098 | tty->termios->c_cflag = |
1100 | ((cflag & ~CSIZE) | (old_termios->c_cflag & CSIZE)); | 1099 | ((cflag & ~CSIZE) | (old_termios->c_cflag & CSIZE)); |
1101 | /* Or CMSPAR */ | 1100 | /* Or CMSPAR */ |
1102 | tty->termios.c_cflag &= ~CMSPAR; | 1101 | tty->termios->c_cflag &= ~CMSPAR; |
1103 | 1102 | ||
1104 | configure_r_port(tty, info, old_termios); | 1103 | configure_r_port(tty, info, old_termios); |
1105 | 1104 | ||
1106 | cp = &info->channel; | 1105 | cp = &info->channel; |
1107 | 1106 | ||
1108 | /* Handle transition to B0 status */ | 1107 | /* Handle transition to B0 status */ |
1109 | if ((old_termios->c_cflag & CBAUD) && !(tty->termios.c_cflag & CBAUD)) { | 1108 | if ((old_termios->c_cflag & CBAUD) && !(tty->termios->c_cflag & CBAUD)) { |
1110 | sClrDTR(cp); | 1109 | sClrDTR(cp); |
1111 | sClrRTS(cp); | 1110 | sClrRTS(cp); |
1112 | } | 1111 | } |
1113 | 1112 | ||
1114 | /* Handle transition away from B0 status */ | 1113 | /* Handle transition away from B0 status */ |
1115 | if (!(old_termios->c_cflag & CBAUD) && (tty->termios.c_cflag & CBAUD)) { | 1114 | if (!(old_termios->c_cflag & CBAUD) && (tty->termios->c_cflag & CBAUD)) { |
1116 | if (!tty->hw_stopped || !(tty->termios.c_cflag & CRTSCTS)) | 1115 | if (!tty->hw_stopped || !(tty->termios->c_cflag & CRTSCTS)) |
1117 | sSetRTS(cp); | 1116 | sSetRTS(cp); |
1118 | sSetDTR(cp); | 1117 | sSetDTR(cp); |
1119 | } | 1118 | } |
1120 | 1119 | ||
1121 | if ((old_termios->c_cflag & CRTSCTS) && !(tty->termios.c_cflag & CRTSCTS)) { | 1120 | if ((old_termios->c_cflag & CRTSCTS) && !(tty->termios->c_cflag & CRTSCTS)) { |
1122 | tty->hw_stopped = 0; | 1121 | tty->hw_stopped = 0; |
1123 | rp_start(tty); | 1122 | rp_start(tty); |
1124 | } | 1123 | } |
@@ -1758,7 +1757,7 @@ static void rp_flush_buffer(struct tty_struct *tty) | |||
1758 | 1757 | ||
1759 | #ifdef CONFIG_PCI | 1758 | #ifdef CONFIG_PCI |
1760 | 1759 | ||
1761 | static struct pci_device_id __used rocket_pci_ids[] = { | 1760 | static struct pci_device_id __devinitdata __used rocket_pci_ids[] = { |
1762 | { PCI_DEVICE(PCI_VENDOR_ID_RP, PCI_ANY_ID) }, | 1761 | { PCI_DEVICE(PCI_VENDOR_ID_RP, PCI_ANY_ID) }, |
1763 | { } | 1762 | { } |
1764 | }; | 1763 | }; |
@@ -2278,6 +2277,7 @@ static int __init rp_init(void) | |||
2278 | * driver with the tty layer. | 2277 | * driver with the tty layer. |
2279 | */ | 2278 | */ |
2280 | 2279 | ||
2280 | rocket_driver->owner = THIS_MODULE; | ||
2281 | rocket_driver->flags = TTY_DRIVER_DYNAMIC_DEV; | 2281 | rocket_driver->flags = TTY_DRIVER_DYNAMIC_DEV; |
2282 | rocket_driver->name = "ttyR"; | 2282 | rocket_driver->name = "ttyR"; |
2283 | rocket_driver->driver_name = "Comtrol RocketPort"; | 2283 | rocket_driver->driver_name = "Comtrol RocketPort"; |
@@ -2358,7 +2358,6 @@ static void rp_cleanup_module(void) | |||
2358 | for (i = 0; i < MAX_RP_PORTS; i++) | 2358 | for (i = 0; i < MAX_RP_PORTS; i++) |
2359 | if (rp_table[i]) { | 2359 | if (rp_table[i]) { |
2360 | tty_unregister_device(rocket_driver, i); | 2360 | tty_unregister_device(rocket_driver, i); |
2361 | tty_port_destroy(&rp_table[i]->port); | ||
2362 | kfree(rp_table[i]); | 2361 | kfree(rp_table[i]); |
2363 | } | 2362 | } |
2364 | 2363 | ||