Lines Matching +full:use +full:- +full:prox
1 // SPDX-License-Identifier: GPL-2.0
9 * control thanks to Munir Nassar nassarmu@real-time.com
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 */
58 { USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
61 { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
65 { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */
70 { USB_DEVICE(0x0FDE, 0xCA05) }, /* OWL Wireless Electricity Monitor CM-160 */
71 { USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */
73 { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */
77 { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */
78 { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */
80 { USB_DEVICE(0x10C4, 0x804E) }, /* Software Bisque Paramount ME build-in converter */
84 { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */
98 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
109 { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
110 { USB_DEVICE(0x10C4, 0x81D7) }, /* IAI Corp. RCB-CV-USB USB to RS485 Adaptor */
111 { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
115 { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */
128 { USB_DEVICE(0x10C4, 0x83AA) }, /* Mark-10 Digital Force Gauge */
131 { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */
139 { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */
140 { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */
142 { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
143 { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
144 { USB_DEVICE(0x10C4, 0x8856) }, /* CEL EM357 ZigBee USB Stick - LR */
156 { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */
161 { USB_DEVICE(0x10C4, 0xEA63) }, /* Silicon Labs Windows Update (CP2101-4/CP2102N) */
163 { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */
175 { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */
177 { USB_DEVICE(0x166A, 0x0201) }, /* Clipsal 5500PACA C-Bus Pascal Automation Controller */
178 { USB_DEVICE(0x166A, 0x0301) }, /* Clipsal 5800PC C-Bus Wireless PC Interface */
179 { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
180 { USB_DEVICE(0x166A, 0x0304) }, /* Clipsal 5000CT2 C-Bus Black and White Touchscreen */
181 { USB_DEVICE(0x166A, 0x0305) }, /* Clipsal C-5000CT2 C-Bus Spectrum Colour Touchscreen */
182 { USB_DEVICE(0x166A, 0x0401) }, /* Clipsal L51xx C-Bus Architectural Dimmer */
183 { USB_DEVICE(0x166A, 0x0101) }, /* Clipsal 5560884 C-Bus Multi-room Audio Matrix Switcher */
187 { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */
188 …{ USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Powe…
189 { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */
190 …{ USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Lo…
191 { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */
192 { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */
195 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
208 { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
210 { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */
232 { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */
233 { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */
234 { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */
398 * CP210X_PURGE - 16 bits passed in wValue of USB request.
496 cur_altsetting = serial->interface->cur_altsetting; in cp210x_interface_num()
498 return cur_altsetting->desc.bInterfaceNumber; in cp210x_interface_num()
502 * Reads a variable-sized block of CP210X_ registers, identified by req.
508 struct usb_serial *serial = port->serial; in cp210x_read_reg_block()
520 return -ENOMEM; in cp210x_read_reg_block()
523 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), in cp210x_read_reg_block()
525 port_priv->bInterfaceNumber, dmabuf, bufsize, in cp210x_read_reg_block()
531 dev_err(&port->dev, "failed get req 0x%x size %d status: %d\n", in cp210x_read_reg_block()
534 result = -EIO; in cp210x_read_reg_block()
549 * Reads any 32-bit CP210X_ register identified by req.
572 * Reads any 16-bit CP210X_ register identified by req.
589 * Reads any 8-bit CP210X_ register identified by req.
597 * Reads a variable-sized vendor block of CP210X_ registers, identified by val.
608 return -ENOMEM; in cp210x_read_vendor_block()
610 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), in cp210x_read_vendor_block()
618 dev_err(&serial->interface->dev, in cp210x_read_vendor_block()
622 result = -EIO; in cp210x_read_vendor_block()
631 * Writes any 16-bit CP210X_ register (req) whose value is passed
636 struct usb_serial *serial = port->serial; in cp210x_write_u16_reg()
640 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), in cp210x_write_u16_reg()
642 port_priv->bInterfaceNumber, NULL, 0, in cp210x_write_u16_reg()
645 dev_err(&port->dev, "failed set request 0x%x status: %d\n", in cp210x_write_u16_reg()
653 * Writes a variable-sized block of CP210X_ registers, identified by req.
659 struct usb_serial *serial = port->serial; in cp210x_write_reg_block()
666 return -ENOMEM; in cp210x_write_reg_block()
668 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), in cp210x_write_reg_block()
670 port_priv->bInterfaceNumber, dmabuf, bufsize, in cp210x_write_reg_block()
678 dev_err(&port->dev, "failed set req 0x%x size %d status: %d\n", in cp210x_write_reg_block()
681 result = -EIO; in cp210x_write_reg_block()
688 * Writes any 32-bit CP210X_ register identified by req.
701 * Writes a variable-sized vendor block of CP210X_ registers, identified by val.
712 return -ENOMEM; in cp210x_write_vendor_block()
714 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), in cp210x_write_vendor_block()
724 dev_err(&serial->interface->dev, in cp210x_write_vendor_block()
728 result = -EIO; in cp210x_write_vendor_block()
761 port_priv->has_swapped_line_ctl = true; in cp210x_detect_swapped_line_ctl()
781 /* Workaround swapped bytes in 16-bit value from CP210X_GET_LINE_CTL */ in cp210x_get_line_ctl()
782 if (port_priv->has_swapped_line_ctl) in cp210x_get_line_ctl()
794 dev_err(&port->dev, "%s - Unable to enable UART\n", __func__); in cp210x_open()
824 struct usb_serial *serial = port->serial; in cp210x_get_tx_queue_byte_count()
831 return -ENOMEM; in cp210x_get_tx_queue_byte_count()
833 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), in cp210x_get_tx_queue_byte_count()
835 0, port_priv->bInterfaceNumber, sts, sizeof(*sts), in cp210x_get_tx_queue_byte_count()
838 *count = le32_to_cpu(sts->ulAmountInOutQueue); in cp210x_get_tx_queue_byte_count()
841 dev_err(&port->dev, "failed to get comm status: %d\n", result); in cp210x_get_tx_queue_byte_count()
843 result = -EIO; in cp210x_get_tx_queue_byte_count()
875 cp210x_get_termios_port(tty->driver_data, in cp210x_get_termios()
876 &tty->termios.c_cflag, &baud); in cp210x_get_termios()
892 struct device *dev = &port->dev; in cp210x_get_termios_port()
902 dev_dbg(dev, "%s - baud rate = %d\n", __func__, baud); in cp210x_get_termios_port()
911 dev_dbg(dev, "%s - data bits = 5\n", __func__); in cp210x_get_termios_port()
915 dev_dbg(dev, "%s - data bits = 6\n", __func__); in cp210x_get_termios_port()
919 dev_dbg(dev, "%s - data bits = 7\n", __func__); in cp210x_get_termios_port()
923 dev_dbg(dev, "%s - data bits = 8\n", __func__); in cp210x_get_termios_port()
927 dev_dbg(dev, "%s - data bits = 9 (not supported, using 8 data bits)\n", __func__); in cp210x_get_termios_port()
934 dev_dbg(dev, "%s - Unknown number of data bits, using 8\n", __func__); in cp210x_get_termios_port()
944 dev_dbg(dev, "%s - parity = NONE\n", __func__); in cp210x_get_termios_port()
948 dev_dbg(dev, "%s - parity = ODD\n", __func__); in cp210x_get_termios_port()
952 dev_dbg(dev, "%s - parity = EVEN\n", __func__); in cp210x_get_termios_port()
957 dev_dbg(dev, "%s - parity = MARK\n", __func__); in cp210x_get_termios_port()
961 dev_dbg(dev, "%s - parity = SPACE\n", __func__); in cp210x_get_termios_port()
966 dev_dbg(dev, "%s - Unknown parity mode, disabling parity\n", __func__); in cp210x_get_termios_port()
976 dev_dbg(dev, "%s - stop bits = 1\n", __func__); in cp210x_get_termios_port()
979 dev_dbg(dev, "%s - stop bits = 1.5 (not supported, using 1 stop bit)\n", __func__); in cp210x_get_termios_port()
984 dev_dbg(dev, "%s - stop bits = 2\n", __func__); in cp210x_get_termios_port()
988 dev_dbg(dev, "%s - Unknown number of stop bits, using 1 stop bit\n", __func__); in cp210x_get_termios_port()
998 dev_dbg(dev, "%s - flow control = CRTSCTS\n", __func__); in cp210x_get_termios_port()
1001 * auto-RTS and RTS is deasserted but it leaves auto-CTS when in cp210x_get_termios_port()
1002 * in hardware flow control mode. When re-opening the port, if in cp210x_get_termios_port()
1003 * auto-CTS is enabled on the cp210x, then auto-RTS must be in cp210x_get_termios_port()
1004 * re-enabled in the driver. in cp210x_get_termios_port()
1017 dev_dbg(dev, "%s - flow control = NONE\n", __func__); in cp210x_get_termios_port()
1082 baud = clamp(baud, 300u, priv->max_speed); in cp210x_get_actual_rate()
1122 struct usb_serial *serial = port->serial; in cp210x_change_speed()
1126 baud = tty->termios.c_ospeed; in cp210x_change_speed()
1134 if (priv->use_actual_rate) in cp210x_change_speed()
1138 else if (baud > priv->max_speed) in cp210x_change_speed()
1139 baud = priv->max_speed; in cp210x_change_speed()
1141 dev_dbg(&port->dev, "%s - setting baud rate to %u\n", __func__, baud); in cp210x_change_speed()
1143 dev_warn(&port->dev, "failed to set baud rate to %u\n", baud); in cp210x_change_speed()
1145 baud = old_termios->c_ospeed; in cp210x_change_speed()
1156 struct device *dev = &port->dev; in cp210x_set_termios()
1160 cflag = tty->termios.c_cflag; in cp210x_set_termios()
1161 old_cflag = old_termios->c_cflag; in cp210x_set_termios()
1163 if (tty->termios.c_ospeed != old_termios->c_ospeed) in cp210x_set_termios()
1173 dev_dbg(dev, "%s - data bits = 5\n", __func__); in cp210x_set_termios()
1177 dev_dbg(dev, "%s - data bits = 6\n", __func__); in cp210x_set_termios()
1181 dev_dbg(dev, "%s - data bits = 7\n", __func__); in cp210x_set_termios()
1186 dev_dbg(dev, "%s - data bits = 8\n", __func__); in cp210x_set_termios()
1201 dev_dbg(dev, "%s - parity = MARK\n", __func__); in cp210x_set_termios()
1204 dev_dbg(dev, "%s - parity = SPACE\n", __func__); in cp210x_set_termios()
1209 dev_dbg(dev, "%s - parity = ODD\n", __func__); in cp210x_set_termios()
1212 dev_dbg(dev, "%s - parity = EVEN\n", __func__); in cp210x_set_termios()
1225 dev_dbg(dev, "%s - stop bits = 2\n", __func__); in cp210x_set_termios()
1228 dev_dbg(dev, "%s - stop bits = 1\n", __func__); in cp210x_set_termios()
1243 dev_dbg(dev, "%s - read ulControlHandshake=0x%08x, ulFlowReplace=0x%08x\n", in cp210x_set_termios()
1257 dev_dbg(dev, "%s - flow control = CRTSCTS\n", __func__); in cp210x_set_termios()
1264 dev_dbg(dev, "%s - flow control = NONE\n", __func__); in cp210x_set_termios()
1267 dev_dbg(dev, "%s - write ulControlHandshake=0x%08x, ulFlowReplace=0x%08x\n", in cp210x_set_termios()
1280 struct usb_serial_port *port = tty->driver_data; in cp210x_tiocmset()
1306 dev_dbg(&port->dev, "%s - control = 0x%.4x\n", __func__, control); in cp210x_tiocmset_port()
1321 struct usb_serial_port *port = tty->driver_data; in cp210x_tiocmget()
1336 dev_dbg(&port->dev, "%s - control = 0x%.2x\n", __func__, control); in cp210x_tiocmget()
1343 struct usb_serial_port *port = tty->driver_data; in cp210x_break_ctl()
1350 dev_dbg(&port->dev, "%s - turning break %s\n", __func__, in cp210x_break_ctl()
1361 if (priv->gpio_altfunc & BIT(offset)) in cp210x_gpio_request()
1362 return -ENODEV; in cp210x_gpio_request()
1375 if (priv->partnum == CP210X_PARTNUM_CP2105) in cp210x_gpio_get()
1378 result = usb_autopm_get_interface(serial->interface); in cp210x_gpio_get()
1384 usb_autopm_put_interface(serial->interface); in cp210x_gpio_get()
1405 result = usb_autopm_get_interface(serial->interface); in cp210x_gpio_set()
1409 if (priv->partnum == CP210X_PARTNUM_CP2105) { in cp210x_gpio_set()
1417 result = usb_control_msg(serial->dev, in cp210x_gpio_set()
1418 usb_sndctrlpipe(serial->dev, 0), in cp210x_gpio_set()
1426 usb_autopm_put_interface(serial->interface); in cp210x_gpio_set()
1429 dev_err(&serial->interface->dev, "failed to set GPIO value: %d\n", in cp210x_gpio_set()
1439 return priv->gpio_input & BIT(gpio); in cp210x_gpio_direction_get()
1447 if (priv->partnum == CP210X_PARTNUM_CP2105) { in cp210x_gpio_direction_input()
1449 return -ENOTSUPP; in cp210x_gpio_direction_input()
1452 /* push-pull pins cannot be changed to be inputs */ in cp210x_gpio_direction_input()
1453 if (priv->gpio_pushpull & BIT(gpio)) in cp210x_gpio_direction_input()
1454 return -EINVAL; in cp210x_gpio_direction_input()
1459 priv->gpio_input |= BIT(gpio); in cp210x_gpio_direction_input()
1470 priv->gpio_input &= ~BIT(gpio); in cp210x_gpio_direction_output()
1485 (priv->gpio_pushpull & BIT(gpio))) in cp210x_gpio_set_config()
1489 !(priv->gpio_pushpull & BIT(gpio))) in cp210x_gpio_set_config()
1492 return -ENOTSUPP; in cp210x_gpio_set_config()
1497 * are made unavailable by configuring the use of GPIO. This is believed to be
1523 /* 2 banks of GPIO - One for the pins taken from each serial port */ in cp2105_gpioconf_init()
1527 priv->gpio_altfunc = 0xff; in cp2105_gpioconf_init()
1532 priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) & in cp2105_gpioconf_init()
1535 priv->gc.ngpio = 2; in cp2105_gpioconf_init()
1539 priv->gpio_altfunc = 0xff; in cp2105_gpioconf_init()
1544 priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) & in cp2105_gpioconf_init()
1547 priv->gc.ngpio = 3; in cp2105_gpioconf_init()
1549 return -ENODEV; in cp2105_gpioconf_init()
1554 priv->gpio_altfunc |= BIT(0); in cp2105_gpioconf_init()
1557 priv->gpio_altfunc |= BIT(1); in cp2105_gpioconf_init()
1560 priv->gpio_input = 0; in cp2105_gpioconf_init()
1583 … https://www.silabs.com/community/interface/knowledge-base.entry.html/2017/03/31/cp2102n_setconfig… in cp2102n_gpioconf_init()
1587 return -ENOMEM; in cp2102n_gpioconf_init()
1608 return -ENOTSUPP; in cp2102n_gpioconf_init()
1612 * config locations of GPIOs 4-6 determined using reverse in cp2102n_gpioconf_init()
1616 priv->gc.ngpio = 4; in cp2102n_gpioconf_init()
1620 * the direction of an open-drain pin. in cp2102n_gpioconf_init()
1624 /* 0 indicates open-drain mode, 1 is push-pull */ in cp2102n_gpioconf_init()
1625 priv->gpio_pushpull = (gpio_pushpull >> 3) & 0x0f; in cp2102n_gpioconf_init()
1628 priv->gpio_altfunc = (gpio_ctrl >> 2) & 0x0f; in cp2102n_gpioconf_init()
1632 * it only knows open-drain and push-pull modes which is set at in cp2102n_gpioconf_init()
1633 * factory. An open-drain pin can function both as an in cp2102n_gpioconf_init()
1634 * input or an output. We emulate input mode for open-drain pins in cp2102n_gpioconf_init()
1636 * push-pull pins to be set as an input. in cp2102n_gpioconf_init()
1638 for (i = 0; i < priv->gc.ngpio; ++i) { in cp2102n_gpioconf_init()
1640 * Set direction to "input" iff pin is open-drain and reset in cp2102n_gpioconf_init()
1643 if (!(priv->gpio_pushpull & BIT(i)) && (gpio_latch & BIT(i))) in cp2102n_gpioconf_init()
1644 priv->gpio_input |= BIT(i); in cp2102n_gpioconf_init()
1655 switch (priv->partnum) { in cp210x_gpio_init()
1671 priv->gc.label = "cp210x"; in cp210x_gpio_init()
1672 priv->gc.request = cp210x_gpio_request; in cp210x_gpio_init()
1673 priv->gc.get_direction = cp210x_gpio_direction_get; in cp210x_gpio_init()
1674 priv->gc.direction_input = cp210x_gpio_direction_input; in cp210x_gpio_init()
1675 priv->gc.direction_output = cp210x_gpio_direction_output; in cp210x_gpio_init()
1676 priv->gc.get = cp210x_gpio_get; in cp210x_gpio_init()
1677 priv->gc.set = cp210x_gpio_set; in cp210x_gpio_init()
1678 priv->gc.set_config = cp210x_gpio_set_config; in cp210x_gpio_init()
1679 priv->gc.owner = THIS_MODULE; in cp210x_gpio_init()
1680 priv->gc.parent = &serial->interface->dev; in cp210x_gpio_init()
1681 priv->gc.base = -1; in cp210x_gpio_init()
1682 priv->gc.can_sleep = true; in cp210x_gpio_init()
1684 result = gpiochip_add_data(&priv->gc, serial); in cp210x_gpio_init()
1686 priv->gpio_registered = true; in cp210x_gpio_init()
1695 if (priv->gpio_registered) { in cp210x_gpio_remove()
1696 gpiochip_remove(&priv->gc); in cp210x_gpio_remove()
1697 priv->gpio_registered = false; in cp210x_gpio_remove()
1717 struct usb_serial *serial = port->serial; in cp210x_port_probe()
1723 return -ENOMEM; in cp210x_port_probe()
1725 port_priv->bInterfaceNumber = cp210x_interface_num(serial); in cp210x_port_probe()
1754 switch (priv->partnum) { in cp210x_init_max_speed()
1788 priv->max_speed = max; in cp210x_init_max_speed()
1789 priv->use_actual_rate = use_actual_rate; in cp210x_init_max_speed()
1799 return -ENOMEM; in cp210x_attach()
1802 CP210X_GET_PARTNUM, &priv->partnum, in cp210x_attach()
1803 sizeof(priv->partnum)); in cp210x_attach()
1805 dev_warn(&serial->interface->dev, in cp210x_attach()
1807 priv->partnum = CP210X_PARTNUM_UNKNOWN; in cp210x_attach()
1816 dev_err(&serial->interface->dev, "GPIO initialisation failed: %d\n", in cp210x_attach()