• Home
  • Raw
  • Download

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>
220 static int pl2303_vendor_read(struct usb_serial *serial, u16 value, in pl2303_vendor_read() argument
223 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_vendor_read()
224 struct device *dev = &serial->interface->dev; in pl2303_vendor_read()
233 res = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), in pl2303_vendor_read()
250 static int pl2303_vendor_write(struct usb_serial *serial, u16 value, u16 index) in pl2303_vendor_write() argument
252 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_vendor_write()
253 struct device *dev = &serial->interface->dev; in pl2303_vendor_write()
264 res = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), in pl2303_vendor_write()
276 static int pl2303_update_reg(struct usb_serial *serial, u8 reg, u8 mask, u8 val) in pl2303_update_reg() argument
278 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_update_reg()
287 ret = pl2303_vendor_read(serial, reg, buf); in pl2303_update_reg()
289 ret = pl2303_vendor_read(serial, reg | 0x80, buf); in pl2303_update_reg()
297 ret = pl2303_vendor_write(serial, reg, *buf); in pl2303_update_reg()
304 static int pl2303_probe(struct usb_serial *serial, in pl2303_probe() argument
307 usb_set_serial_data(serial, (void *)id->driver_info); in pl2303_probe()
317 static int pl2303_endpoint_hack(struct usb_serial *serial, in pl2303_endpoint_hack() argument
320 struct usb_interface *interface = serial->interface; in pl2303_endpoint_hack()
321 struct usb_device *dev = serial->dev; in pl2303_endpoint_hack()
347 static int pl2303_calc_num_ports(struct usb_serial *serial, in pl2303_calc_num_ports() argument
350 unsigned long quirks = (unsigned long)usb_get_serial_data(serial); in pl2303_calc_num_ports()
351 struct device *dev = &serial->interface->dev; in pl2303_calc_num_ports()
355 ret = pl2303_endpoint_hack(serial, epds); in pl2303_calc_num_ports()
368 static int pl2303_startup(struct usb_serial *serial) in pl2303_startup() argument
385 if (serial->dev->descriptor.bDeviceClass == 0x02) in pl2303_startup()
387 else if (serial->dev->descriptor.bMaxPacketSize0 == 0x40) in pl2303_startup()
389 else if (serial->dev->descriptor.bDeviceClass == 0x00) in pl2303_startup()
391 else if (serial->dev->descriptor.bDeviceClass == 0xFF) in pl2303_startup()
393 dev_dbg(&serial->interface->dev, "device type: %d\n", type); in pl2303_startup()
396 res = usb_control_msg(serial->dev, in pl2303_startup()
397 usb_rcvctrlpipe(serial->dev, 0), in pl2303_startup()
405 spriv->quirks = (unsigned long)usb_get_serial_data(serial); in pl2303_startup()
408 usb_set_serial_data(serial, spriv); in pl2303_startup()
411 pl2303_vendor_read(serial, 0x8484, buf); in pl2303_startup()
412 pl2303_vendor_write(serial, 0x0404, 0); in pl2303_startup()
413 pl2303_vendor_read(serial, 0x8484, buf); in pl2303_startup()
414 pl2303_vendor_read(serial, 0x8383, buf); in pl2303_startup()
415 pl2303_vendor_read(serial, 0x8484, buf); in pl2303_startup()
416 pl2303_vendor_write(serial, 0x0404, 1); in pl2303_startup()
417 pl2303_vendor_read(serial, 0x8484, buf); in pl2303_startup()
418 pl2303_vendor_read(serial, 0x8383, buf); in pl2303_startup()
419 pl2303_vendor_write(serial, 0, 1); in pl2303_startup()
420 pl2303_vendor_write(serial, 1, 0); in pl2303_startup()
422 pl2303_vendor_write(serial, 2, 0x24); in pl2303_startup()
424 pl2303_vendor_write(serial, 2, 0x44); in pl2303_startup()
432 static void pl2303_release(struct usb_serial *serial) in pl2303_release() argument
434 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_release()
467 struct usb_device *dev = port->serial->dev; in pl2303_set_control_lines()
565 struct usb_serial *serial = port->serial; in pl2303_encode_baud_rate() local
566 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_encode_baud_rate()
599 struct usb_device *udev = port->serial->dev; in pl2303_get_line_request()
622 struct usb_device *udev = port->serial->dev; in pl2303_set_line_request()
666 struct usb_serial *serial = port->serial; in pl2303_set_termios() local
667 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_set_termios()
755 * Some PL2303 are known to lose bytes if you change serial settings in pl2303_set_termios()
789 pl2303_update_reg(serial, 0, PL2303_FLOWCTRL_MASK, 0x40); in pl2303_set_termios()
791 pl2303_update_reg(serial, PL2303_HXN_FLOWCTRL_REG, in pl2303_set_termios()
795 pl2303_update_reg(serial, 0, PL2303_FLOWCTRL_MASK, 0x60); in pl2303_set_termios()
799 pl2303_update_reg(serial, PL2303_HXN_FLOWCTRL_REG, in pl2303_set_termios()
803 pl2303_update_reg(serial, 0, PL2303_FLOWCTRL_MASK, 0xc0); in pl2303_set_termios()
807 pl2303_update_reg(serial, PL2303_HXN_FLOWCTRL_REG, in pl2303_set_termios()
811 pl2303_update_reg(serial, 0, PL2303_FLOWCTRL_MASK, 0); in pl2303_set_termios()
844 struct usb_serial *serial = port->serial; in pl2303_open() local
845 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_open()
849 usb_clear_halt(serial->dev, port->write_urb->pipe); in pl2303_open()
850 usb_clear_halt(serial->dev, port->read_urb->pipe); in pl2303_open()
854 pl2303_vendor_write(serial, PL2303_HXN_RESET_REG, in pl2303_open()
858 pl2303_vendor_write(serial, 8, 0); in pl2303_open()
859 pl2303_vendor_write(serial, 9, 0); in pl2303_open()
961 struct usb_serial *serial = port->serial; in pl2303_set_break() local
973 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), in pl2303_set_break()
991 struct usb_serial *serial = port->serial; in pl2303_update_line_status() local
992 struct pl2303_serial_private *spriv = usb_get_serial_data(serial); in pl2303_update_line_status()
1164 MODULE_DESCRIPTION("Prolific PL2303 USB to serial adaptor driver");