Lines Matching refs:port
157 static int spcp8x5_port_probe(struct usb_serial_port *port) in spcp8x5_port_probe() argument
159 const struct usb_device_id *id = usb_get_serial_data(port->serial); in spcp8x5_port_probe()
169 usb_set_serial_port_data(port, priv); in spcp8x5_port_probe()
171 port->port.drain_delay = 256; in spcp8x5_port_probe()
176 static int spcp8x5_port_remove(struct usb_serial_port *port) in spcp8x5_port_remove() argument
180 priv = usb_get_serial_port_data(port); in spcp8x5_port_remove()
186 static int spcp8x5_set_ctrl_line(struct usb_serial_port *port, u8 mcr) in spcp8x5_set_ctrl_line() argument
188 struct spcp8x5_private *priv = usb_get_serial_port_data(port); in spcp8x5_set_ctrl_line()
189 struct usb_device *dev = port->serial->dev; in spcp8x5_set_ctrl_line()
199 dev_err(&port->dev, "failed to set control lines: %d\n", in spcp8x5_set_ctrl_line()
205 static int spcp8x5_get_msr(struct usb_serial_port *port, u8 *status) in spcp8x5_get_msr() argument
207 struct spcp8x5_private *priv = usb_get_serial_port_data(port); in spcp8x5_get_msr()
208 struct usb_device *dev = port->serial->dev; in spcp8x5_get_msr()
223 dev_err(&port->dev, "failed to get modem status: %d\n", ret); in spcp8x5_get_msr()
225 dev_dbg(&port->dev, "0xc0:0x22:0:6 %d - 0x02%x\n", ret, *buf); in spcp8x5_get_msr()
232 static void spcp8x5_set_work_mode(struct usb_serial_port *port, u16 value, in spcp8x5_set_work_mode() argument
235 struct spcp8x5_private *priv = usb_get_serial_port_data(port); in spcp8x5_set_work_mode()
236 struct usb_device *dev = port->serial->dev; in spcp8x5_set_work_mode()
245 dev_dbg(&port->dev, "value = %#x , index = %#x\n", value, index); in spcp8x5_set_work_mode()
247 dev_err(&port->dev, "failed to set work mode: %d\n", ret); in spcp8x5_set_work_mode()
250 static int spcp8x5_carrier_raised(struct usb_serial_port *port) in spcp8x5_carrier_raised() argument
255 ret = spcp8x5_get_msr(port, &msr); in spcp8x5_carrier_raised()
262 static void spcp8x5_dtr_rts(struct usb_serial_port *port, int on) in spcp8x5_dtr_rts() argument
264 struct spcp8x5_private *priv = usb_get_serial_port_data(port); in spcp8x5_dtr_rts()
277 spcp8x5_set_ctrl_line(port, control); in spcp8x5_dtr_rts()
289 struct usb_serial_port *port, struct ktermios *old_termios) in spcp8x5_set_termios() argument
291 struct usb_serial *serial = port->serial; in spcp8x5_set_termios()
292 struct spcp8x5_private *priv = usb_get_serial_port_data(port); in spcp8x5_set_termios()
316 spcp8x5_set_ctrl_line(port, control); in spcp8x5_set_termios()
345 dev_err(&port->dev, "unsupported baudrate, using 9600\n"); in spcp8x5_set_termios()
382 dev_err(&port->dev, "Set UART format %#x failed (error = %d)\n", in spcp8x5_set_termios()
384 dev_dbg(&port->dev, "0x21:0x40:0:0 %d\n", i); in spcp8x5_set_termios()
388 spcp8x5_set_work_mode(port, 0x000a, SET_WORKING_MODE_U2C); in spcp8x5_set_termios()
392 static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port) in spcp8x5_open() argument
394 struct usb_serial *serial = port->serial; in spcp8x5_open()
395 struct spcp8x5_private *priv = usb_get_serial_port_data(port); in spcp8x5_open()
398 usb_clear_halt(serial->dev, port->write_urb->pipe); in spcp8x5_open()
399 usb_clear_halt(serial->dev, port->read_urb->pipe); in spcp8x5_open()
407 spcp8x5_set_ctrl_line(port, priv->line_control); in spcp8x5_open()
410 spcp8x5_set_termios(tty, port, NULL); in spcp8x5_open()
412 return usb_serial_generic_open(tty, port); in spcp8x5_open()
418 struct usb_serial_port *port = tty->driver_data; in spcp8x5_tiocmset() local
419 struct spcp8x5_private *priv = usb_get_serial_port_data(port); in spcp8x5_tiocmset()
435 return spcp8x5_set_ctrl_line(port, control); in spcp8x5_tiocmset()
440 struct usb_serial_port *port = tty->driver_data; in spcp8x5_tiocmget() local
441 struct spcp8x5_private *priv = usb_get_serial_port_data(port); in spcp8x5_tiocmget()
447 result = spcp8x5_get_msr(port, &status); in spcp8x5_tiocmget()