Lines Matching full:serial

3  * Prolific PL2303 USB to serial adaptor driver
10 * See Documentation/usb/usb-serial.rst for more information on using this
20 #include <linux/serial.h>
26 #include <linux/usb/serial.h>
215 static int pl2303_vendor_read(struct usb_serial *serial, u16 value, in pl2303_vendor_read() argument
218 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_vendor_read()
219 struct device *dev = &serial->interface->dev; in pl2303_vendor_read()
228 res = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), in pl2303_vendor_read()
245 static int pl2303_vendor_write(struct usb_serial *serial, u16 value, u16 index) in pl2303_vendor_write() argument
247 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_vendor_write()
248 struct device *dev = &serial->interface->dev; in pl2303_vendor_write()
259 res = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), in pl2303_vendor_write()
271 static int pl2303_update_reg(struct usb_serial *serial, u8 reg, u8 mask, u8 val) in pl2303_update_reg() argument
273 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_update_reg()
282 ret = pl2303_vendor_read(serial, reg, buf); in pl2303_update_reg()
284 ret = pl2303_vendor_read(serial, reg | 0x80, buf); in pl2303_update_reg()
292 ret = pl2303_vendor_write(serial, reg, *buf); in pl2303_update_reg()
299 static int pl2303_probe(struct usb_serial *serial, in pl2303_probe() argument
302 usb_set_serial_data(serial, (void *)id->driver_info); in pl2303_probe()
312 static int pl2303_endpoint_hack(struct usb_serial *serial, in pl2303_endpoint_hack() argument
315 struct usb_interface *interface = serial->interface; in pl2303_endpoint_hack()
316 struct usb_device *dev = serial->dev; in pl2303_endpoint_hack()
342 static int pl2303_calc_num_ports(struct usb_serial *serial, in pl2303_calc_num_ports() argument
345 unsigned long quirks = (unsigned long)usb_get_serial_data(serial); in pl2303_calc_num_ports()
346 struct device *dev = &serial->interface->dev; in pl2303_calc_num_ports()
350 ret = pl2303_endpoint_hack(serial, epds); in pl2303_calc_num_ports()
363 static int pl2303_startup(struct usb_serial *serial) in pl2303_startup() argument
380 if (serial->dev->descriptor.bDeviceClass == 0x02) in pl2303_startup()
382 else if (serial->dev->descriptor.bMaxPacketSize0 == 0x40) in pl2303_startup()
384 else if (serial->dev->descriptor.bDeviceClass == 0x00) in pl2303_startup()
386 else if (serial->dev->descriptor.bDeviceClass == 0xFF) in pl2303_startup()
388 dev_dbg(&serial->interface->dev, "device type: %d\n", type); in pl2303_startup()
391 res = usb_control_msg(serial->dev, in pl2303_startup()
392 usb_rcvctrlpipe(serial->dev, 0), in pl2303_startup()
400 spriv->quirks = (unsigned long)usb_get_serial_data(serial); in pl2303_startup()
403 usb_set_serial_data(serial, spriv); in pl2303_startup()
406 pl2303_vendor_read(serial, 0x8484, buf); in pl2303_startup()
407 pl2303_vendor_write(serial, 0x0404, 0); in pl2303_startup()
408 pl2303_vendor_read(serial, 0x8484, buf); in pl2303_startup()
409 pl2303_vendor_read(serial, 0x8383, buf); in pl2303_startup()
410 pl2303_vendor_read(serial, 0x8484, buf); in pl2303_startup()
411 pl2303_vendor_write(serial, 0x0404, 1); in pl2303_startup()
412 pl2303_vendor_read(serial, 0x8484, buf); in pl2303_startup()
413 pl2303_vendor_read(serial, 0x8383, buf); in pl2303_startup()
414 pl2303_vendor_write(serial, 0, 1); in pl2303_startup()
415 pl2303_vendor_write(serial, 1, 0); in pl2303_startup()
417 pl2303_vendor_write(serial, 2, 0x24); in pl2303_startup()
419 pl2303_vendor_write(serial, 2, 0x44); in pl2303_startup()
427 static void pl2303_release(struct usb_serial *serial) in pl2303_release() argument
429 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_release()
462 struct usb_device *dev = port->serial->dev; in pl2303_set_control_lines()
560 struct usb_serial *serial = port->serial; in pl2303_encode_baud_rate() local
561 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_encode_baud_rate()
590 struct usb_device *udev = port->serial->dev; in pl2303_get_line_request()
613 struct usb_device *udev = port->serial->dev; in pl2303_set_line_request()
657 struct usb_serial *serial = port->serial; in pl2303_set_termios() local
658 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_set_termios()
746 * Some PL2303 are known to lose bytes if you change serial settings in pl2303_set_termios()
780 pl2303_update_reg(serial, 0, PL2303_FLOWCTRL_MASK, 0x40); in pl2303_set_termios()
782 pl2303_update_reg(serial, PL2303_HXN_FLOWCTRL_REG, in pl2303_set_termios()
786 pl2303_update_reg(serial, 0, PL2303_FLOWCTRL_MASK, 0x60); in pl2303_set_termios()
790 pl2303_update_reg(serial, PL2303_HXN_FLOWCTRL_REG, in pl2303_set_termios()
794 pl2303_update_reg(serial, 0, PL2303_FLOWCTRL_MASK, 0xc0); in pl2303_set_termios()
798 pl2303_update_reg(serial, PL2303_HXN_FLOWCTRL_REG, in pl2303_set_termios()
802 pl2303_update_reg(serial, 0, PL2303_FLOWCTRL_MASK, 0); in pl2303_set_termios()
835 struct usb_serial *serial = port->serial; in pl2303_open() local
836 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_open()
840 usb_clear_halt(serial->dev, port->write_urb->pipe); in pl2303_open()
841 usb_clear_halt(serial->dev, port->read_urb->pipe); in pl2303_open()
845 pl2303_vendor_write(serial, PL2303_HXN_RESET_REG, in pl2303_open()
849 pl2303_vendor_write(serial, 8, 0); in pl2303_open()
850 pl2303_vendor_write(serial, 9, 0); in pl2303_open()
952 struct usb_serial *serial = port->serial; in pl2303_set_break() local
964 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), in pl2303_set_break()
982 struct usb_serial *serial = port->serial; in pl2303_update_line_status() local
983 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_update_line_status()
1155 MODULE_DESCRIPTION("Prolific PL2303 USB to serial adaptor driver");