cp210x.c (ed921771ffb65ce1f65d746fe8f88c0e0a829d76) | cp210x.c (daa919196be49815e342eb79fab81852102703c2) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver 4 * 5 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk) 6 * 7 * Support to set flow control line levels using TIOCMGET and TIOCMSET 8 * thanks to Karl Hiramoto karl@hiramoto.org. RTSCTS hardware flow --- 32 unchanged lines hidden (view full) --- 41static int cp210x_tiocmset_port(struct usb_serial_port *port, 42 unsigned int, unsigned int); 43static void cp210x_break_ctl(struct tty_struct *, int); 44static int cp210x_attach(struct usb_serial *); 45static void cp210x_disconnect(struct usb_serial *); 46static void cp210x_release(struct usb_serial *); 47static int cp210x_port_probe(struct usb_serial_port *); 48static int cp210x_port_remove(struct usb_serial_port *); | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver 4 * 5 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk) 6 * 7 * Support to set flow control line levels using TIOCMGET and TIOCMSET 8 * thanks to Karl Hiramoto karl@hiramoto.org. RTSCTS hardware flow --- 32 unchanged lines hidden (view full) --- 41static int cp210x_tiocmset_port(struct usb_serial_port *port, 42 unsigned int, unsigned int); 43static void cp210x_break_ctl(struct tty_struct *, int); 44static int cp210x_attach(struct usb_serial *); 45static void cp210x_disconnect(struct usb_serial *); 46static void cp210x_release(struct usb_serial *); 47static int cp210x_port_probe(struct usb_serial_port *); 48static int cp210x_port_remove(struct usb_serial_port *); |
49static void cp210x_dtr_rts(struct usb_serial_port *p, int on); | 49static void cp210x_dtr_rts(struct usb_serial_port *port, int on); |
50static void cp210x_process_read_urb(struct urb *urb); 51static void cp210x_enable_event_mode(struct usb_serial_port *port); 52static void cp210x_disable_event_mode(struct usb_serial_port *port); 53 54static const struct usb_device_id id_table[] = { 55 { USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */ 56 { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ 57 { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ --- 1171 unchanged lines hidden (view full) --- 1229 control |= CONTROL_WRITE_DTR; 1230 } 1231 1232 dev_dbg(&port->dev, "%s - control = 0x%.4x\n", __func__, control); 1233 1234 return cp210x_write_u16_reg(port, CP210X_SET_MHS, control); 1235} 1236 | 50static void cp210x_process_read_urb(struct urb *urb); 51static void cp210x_enable_event_mode(struct usb_serial_port *port); 52static void cp210x_disable_event_mode(struct usb_serial_port *port); 53 54static const struct usb_device_id id_table[] = { 55 { USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */ 56 { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ 57 { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ --- 1171 unchanged lines hidden (view full) --- 1229 control |= CONTROL_WRITE_DTR; 1230 } 1231 1232 dev_dbg(&port->dev, "%s - control = 0x%.4x\n", __func__, control); 1233 1234 return cp210x_write_u16_reg(port, CP210X_SET_MHS, control); 1235} 1236 |
1237static void cp210x_dtr_rts(struct usb_serial_port *p, int on) | 1237static void cp210x_dtr_rts(struct usb_serial_port *port, int on) |
1238{ 1239 if (on) | 1238{ 1239 if (on) |
1240 cp210x_tiocmset_port(p, TIOCM_DTR|TIOCM_RTS, 0); | 1240 cp210x_tiocmset_port(port, TIOCM_DTR | TIOCM_RTS, 0); |
1241 else | 1241 else |
1242 cp210x_tiocmset_port(p, 0, TIOCM_DTR|TIOCM_RTS); | 1242 cp210x_tiocmset_port(port, 0, TIOCM_DTR | TIOCM_RTS); |
1243} 1244 1245static int cp210x_tiocmget(struct tty_struct *tty) 1246{ 1247 struct usb_serial_port *port = tty->driver_data; 1248 u8 control; 1249 int result; 1250 --- 572 unchanged lines hidden --- | 1243} 1244 1245static int cp210x_tiocmget(struct tty_struct *tty) 1246{ 1247 struct usb_serial_port *port = tty->driver_data; 1248 u8 control; 1249 int result; 1250 --- 572 unchanged lines hidden --- |