diff options
Diffstat (limited to 'drivers/usb/serial/iuu_phoenix.c')
-rw-r--r-- | drivers/usb/serial/iuu_phoenix.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 96873a7a32b0..6138c1cda35f 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c | |||
@@ -71,7 +71,6 @@ struct iuu_private { | |||
71 | spinlock_t lock; /* store irq state */ | 71 | spinlock_t lock; /* store irq state */ |
72 | wait_queue_head_t delta_msr_wait; | 72 | wait_queue_head_t delta_msr_wait; |
73 | u8 line_status; | 73 | u8 line_status; |
74 | u8 termios_initialized; | ||
75 | int tiostatus; /* store IUART SIGNAL for tiocmget call */ | 74 | int tiostatus; /* store IUART SIGNAL for tiocmget call */ |
76 | u8 reset; /* if 1 reset is needed */ | 75 | u8 reset; /* if 1 reset is needed */ |
77 | int poll; /* number of poll */ | 76 | int poll; /* number of poll */ |
@@ -1018,14 +1017,24 @@ static void iuu_close(struct usb_serial_port *port) | |||
1018 | } | 1017 | } |
1019 | } | 1018 | } |
1020 | 1019 | ||
1021 | static int iuu_open(struct tty_struct *tty, | 1020 | static void iuu_init_termios(struct tty_struct *tty) |
1022 | struct usb_serial_port *port, struct file *filp) | 1021 | { |
1022 | *(tty->termios) = tty_std_termios; | ||
1023 | tty->termios->c_cflag = CLOCAL | CREAD | CS8 | B9600 | ||
1024 | | TIOCM_CTS | CSTOPB | PARENB; | ||
1025 | tty->termios->c_ispeed = 9600; | ||
1026 | tty->termios->c_ospeed = 9600; | ||
1027 | tty->termios->c_lflag = 0; | ||
1028 | tty->termios->c_oflag = 0; | ||
1029 | tty->termios->c_iflag = 0; | ||
1030 | } | ||
1031 | |||
1032 | static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port) | ||
1023 | { | 1033 | { |
1024 | struct usb_serial *serial = port->serial; | 1034 | struct usb_serial *serial = port->serial; |
1025 | u8 *buf; | 1035 | u8 *buf; |
1026 | int result; | 1036 | int result; |
1027 | u32 actual; | 1037 | u32 actual; |
1028 | unsigned long flags; | ||
1029 | struct iuu_private *priv = usb_get_serial_port_data(port); | 1038 | struct iuu_private *priv = usb_get_serial_port_data(port); |
1030 | 1039 | ||
1031 | dbg("%s - port %d", __func__, port->number); | 1040 | dbg("%s - port %d", __func__, port->number); |
@@ -1064,21 +1073,7 @@ static int iuu_open(struct tty_struct *tty, | |||
1064 | port->bulk_in_buffer, 512, | 1073 | port->bulk_in_buffer, 512, |
1065 | NULL, NULL); | 1074 | NULL, NULL); |
1066 | 1075 | ||
1067 | /* set the termios structure */ | 1076 | priv->poll = 0; |
1068 | spin_lock_irqsave(&priv->lock, flags); | ||
1069 | if (tty && !priv->termios_initialized) { | ||
1070 | *(tty->termios) = tty_std_termios; | ||
1071 | tty->termios->c_cflag = CLOCAL | CREAD | CS8 | B9600 | ||
1072 | | TIOCM_CTS | CSTOPB | PARENB; | ||
1073 | tty->termios->c_ispeed = 9600; | ||
1074 | tty->termios->c_ospeed = 9600; | ||
1075 | tty->termios->c_lflag = 0; | ||
1076 | tty->termios->c_oflag = 0; | ||
1077 | tty->termios->c_iflag = 0; | ||
1078 | priv->termios_initialized = 1; | ||
1079 | priv->poll = 0; | ||
1080 | } | ||
1081 | spin_unlock_irqrestore(&priv->lock, flags); | ||
1082 | 1077 | ||
1083 | /* initialize writebuf */ | 1078 | /* initialize writebuf */ |
1084 | #define FISH(a, b, c, d) do { \ | 1079 | #define FISH(a, b, c, d) do { \ |
@@ -1201,6 +1196,7 @@ static struct usb_serial_driver iuu_device = { | |||
1201 | .tiocmget = iuu_tiocmget, | 1196 | .tiocmget = iuu_tiocmget, |
1202 | .tiocmset = iuu_tiocmset, | 1197 | .tiocmset = iuu_tiocmset, |
1203 | .set_termios = iuu_set_termios, | 1198 | .set_termios = iuu_set_termios, |
1199 | .init_termios = iuu_init_termios, | ||
1204 | .attach = iuu_startup, | 1200 | .attach = iuu_startup, |
1205 | .release = iuu_release, | 1201 | .release = iuu_release, |
1206 | }; | 1202 | }; |