Lines Matching +full:hall +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0
9 * control thanks to Munir Nassar nassarmu@real-time.com
58 { USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */
59 { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */
60 { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
61 { USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
64 { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
68 { USB_DEVICE(0x0BED, 0x1100) }, /* MEI (TM) Cashflow-SC Bill/Voucher Acceptor */
73 { USB_DEVICE(0x0FDE, 0xCA05) }, /* OWL Wireless Electricity Monitor CM-160 */
74 { USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */
76 { USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */
80 { USB_DEVICE(0x10C4, 0x800A) }, /* SPORTident BSM7-D-USB main station */
81 { USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */
83 { USB_DEVICE(0x10C4, 0x804E) }, /* Software Bisque Paramount ME build-in converter */
87 { USB_DEVICE(0x10C4, 0x8066) }, /* Argussoft In-System Programmer */
101 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
112 { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */
113 { USB_DEVICE(0x10C4, 0x81D7) }, /* IAI Corp. RCB-CV-USB USB to RS485 Adaptor */
114 { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */
118 { USB_DEVICE(0x10C4, 0x8218) }, /* Lipowsky Industrie Elektronik GmbH, HARP-1 */
131 { USB_DEVICE(0x10C4, 0x83AA) }, /* Mark-10 Digital Force Gauge */
134 { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */
142 { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */
143 { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */
145 { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
146 { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
147 { USB_DEVICE(0x10C4, 0x8856) }, /* CEL EM357 ZigBee USB Stick - LR */
159 { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */
164 { USB_DEVICE(0x10C4, 0xEA63) }, /* Silicon Labs Windows Update (CP2101-4/CP2102N) */
166 { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */
178 { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */
180 { USB_DEVICE(0x166A, 0x0201) }, /* Clipsal 5500PACA C-Bus Pascal Automation Controller */
181 { USB_DEVICE(0x166A, 0x0301) }, /* Clipsal 5800PC C-Bus Wireless PC Interface */
182 { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
183 { USB_DEVICE(0x166A, 0x0304) }, /* Clipsal 5000CT2 C-Bus Black and White Touchscreen */
184 { USB_DEVICE(0x166A, 0x0305) }, /* Clipsal C-5000CT2 C-Bus Spectrum Colour Touchscreen */
185 { USB_DEVICE(0x166A, 0x0401) }, /* Clipsal L51xx C-Bus Architectural Dimmer */
186 { USB_DEVICE(0x166A, 0x0101) }, /* Clipsal 5560884 C-Bus Multi-room Audio Matrix Switcher */
190 { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */
191 …{ USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Powe…
192 { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */
193 …{ USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Lo…
194 { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */
195 { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */
198 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
211 { USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
213 { USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */
233 { USB_DEVICE(0x1FB9, 0x0701) }, /* Lake Shore Model 776 Hall Matrix */
235 { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */
236 { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */
237 { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */
416 * CP210X_PURGE - 16 bits passed in wValue of USB request.
544 cur_altsetting = serial->interface->cur_altsetting; in cp210x_interface_num()
546 return cur_altsetting->desc.bInterfaceNumber; in cp210x_interface_num()
550 * Reads a variable-sized block of CP210X_ registers, identified by req.
556 struct usb_serial *serial = port->serial; in cp210x_read_reg_block()
568 return -ENOMEM; in cp210x_read_reg_block()
571 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), in cp210x_read_reg_block()
573 port_priv->bInterfaceNumber, dmabuf, bufsize, in cp210x_read_reg_block()
579 dev_err(&port->dev, "failed get req 0x%x size %d status: %d\n", in cp210x_read_reg_block()
582 result = -EIO; in cp210x_read_reg_block()
597 * Reads any 32-bit CP210X_ register identified by req.
620 * Reads any 16-bit CP210X_ register identified by req.
637 * Reads any 8-bit CP210X_ register identified by req.
645 * Reads a variable-sized vendor block of CP210X_ registers, identified by val.
656 return -ENOMEM; in cp210x_read_vendor_block()
658 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), in cp210x_read_vendor_block()
666 dev_err(&serial->interface->dev, in cp210x_read_vendor_block()
670 result = -EIO; in cp210x_read_vendor_block()
679 * Writes any 16-bit CP210X_ register (req) whose value is passed
684 struct usb_serial *serial = port->serial; in cp210x_write_u16_reg()
688 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), in cp210x_write_u16_reg()
690 port_priv->bInterfaceNumber, NULL, 0, in cp210x_write_u16_reg()
693 dev_err(&port->dev, "failed set request 0x%x status: %d\n", in cp210x_write_u16_reg()
701 * Writes a variable-sized block of CP210X_ registers, identified by req.
707 struct usb_serial *serial = port->serial; in cp210x_write_reg_block()
714 return -ENOMEM; in cp210x_write_reg_block()
716 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), in cp210x_write_reg_block()
718 port_priv->bInterfaceNumber, dmabuf, bufsize, in cp210x_write_reg_block()
726 dev_err(&port->dev, "failed set req 0x%x size %d status: %d\n", in cp210x_write_reg_block()
729 result = -EIO; in cp210x_write_reg_block()
736 * Writes any 32-bit CP210X_ register identified by req.
749 * Writes a variable-sized vendor block of CP210X_ registers, identified by val.
760 return -ENOMEM; in cp210x_write_vendor_block()
762 result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), in cp210x_write_vendor_block()
772 dev_err(&serial->interface->dev, in cp210x_write_vendor_block()
776 result = -EIO; in cp210x_write_vendor_block()
809 port_priv->has_swapped_line_ctl = true; in cp210x_detect_swapped_line_ctl()
829 /* Workaround swapped bytes in 16-bit value from CP210X_GET_LINE_CTL */ in cp210x_get_line_ctl()
830 if (port_priv->has_swapped_line_ctl) in cp210x_get_line_ctl()
843 dev_err(&port->dev, "%s - Unable to enable UART\n", __func__); in cp210x_open()
866 port_priv->event_mode = false; in cp210x_open()
882 /* Disabling the interface disables event-insertion mode. */ in cp210x_close()
883 port_priv->event_mode = false; in cp210x_close()
889 port->icount.brk++; in cp210x_process_lsr()
892 port->icount.parity++; in cp210x_process_lsr()
895 port->icount.frame++; in cp210x_process_lsr()
900 port->icount.overrun++; in cp210x_process_lsr()
901 tty_insert_flip_char(&port->port, 0, TTY_OVERRUN); in cp210x_process_lsr()
909 switch (port_priv->event_state) { in cp210x_process_char()
912 port_priv->event_state = ES_ESCAPE; in cp210x_process_char()
919 dev_dbg(&port->dev, "%s - escape char\n", __func__); in cp210x_process_char()
921 port_priv->event_state = ES_DATA; in cp210x_process_char()
924 port_priv->event_state = ES_LSR_DATA_0; in cp210x_process_char()
927 port_priv->event_state = ES_LSR; in cp210x_process_char()
930 port_priv->event_state = ES_MSR; in cp210x_process_char()
933 dev_err(&port->dev, "malformed event 0x%02x\n", *ch); in cp210x_process_char()
934 port_priv->event_state = ES_DATA; in cp210x_process_char()
939 port_priv->lsr = *ch; in cp210x_process_char()
940 port_priv->event_state = ES_LSR_DATA_1; in cp210x_process_char()
943 dev_dbg(&port->dev, "%s - lsr = 0x%02x, data = 0x%02x\n", in cp210x_process_char()
944 __func__, port_priv->lsr, *ch); in cp210x_process_char()
945 cp210x_process_lsr(port, port_priv->lsr, flag); in cp210x_process_char()
946 port_priv->event_state = ES_DATA; in cp210x_process_char()
949 dev_dbg(&port->dev, "%s - lsr = 0x%02x\n", __func__, *ch); in cp210x_process_char()
950 port_priv->lsr = *ch; in cp210x_process_char()
951 cp210x_process_lsr(port, port_priv->lsr, flag); in cp210x_process_char()
952 port_priv->event_state = ES_DATA; in cp210x_process_char()
955 dev_dbg(&port->dev, "%s - msr = 0x%02x\n", __func__, *ch); in cp210x_process_char()
957 port_priv->event_state = ES_DATA; in cp210x_process_char()
966 struct usb_serial_port *port = urb->context; in cp210x_process_read_urb()
968 unsigned char *ch = urb->transfer_buffer; in cp210x_process_read_urb()
972 if (!urb->actual_length) in cp210x_process_read_urb()
975 if (port_priv->event_mode) { in cp210x_process_read_urb()
976 for (i = 0; i < urb->actual_length; i++, ch++) { in cp210x_process_read_urb()
982 tty_insert_flip_char(&port->port, *ch, flag); in cp210x_process_read_urb()
985 tty_insert_flip_string(&port->port, ch, urb->actual_length); in cp210x_process_read_urb()
987 tty_flip_buffer_push(&port->port); in cp210x_process_read_urb()
996 struct usb_serial *serial = port->serial; in cp210x_get_tx_queue_byte_count()
1003 return -ENOMEM; in cp210x_get_tx_queue_byte_count()
1005 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), in cp210x_get_tx_queue_byte_count()
1007 0, port_priv->bInterfaceNumber, sts, sizeof(*sts), in cp210x_get_tx_queue_byte_count()
1010 *count = le32_to_cpu(sts->ulAmountInOutQueue); in cp210x_get_tx_queue_byte_count()
1013 dev_err(&port->dev, "failed to get comm status: %d\n", result); in cp210x_get_tx_queue_byte_count()
1015 result = -EIO; in cp210x_get_tx_queue_byte_count()
1047 cp210x_get_termios_port(tty->driver_data, in cp210x_get_termios()
1048 &tty->termios.c_cflag, &baud); in cp210x_get_termios()
1064 struct device *dev = &port->dev; in cp210x_get_termios_port()
1074 dev_dbg(dev, "%s - baud rate = %d\n", __func__, baud); in cp210x_get_termios_port()
1083 dev_dbg(dev, "%s - data bits = 5\n", __func__); in cp210x_get_termios_port()
1087 dev_dbg(dev, "%s - data bits = 6\n", __func__); in cp210x_get_termios_port()
1091 dev_dbg(dev, "%s - data bits = 7\n", __func__); in cp210x_get_termios_port()
1095 dev_dbg(dev, "%s - data bits = 8\n", __func__); in cp210x_get_termios_port()
1099 dev_dbg(dev, "%s - data bits = 9 (not supported, using 8 data bits)\n", __func__); in cp210x_get_termios_port()
1106 dev_dbg(dev, "%s - Unknown number of data bits, using 8\n", __func__); in cp210x_get_termios_port()
1116 dev_dbg(dev, "%s - parity = NONE\n", __func__); in cp210x_get_termios_port()
1120 dev_dbg(dev, "%s - parity = ODD\n", __func__); in cp210x_get_termios_port()
1124 dev_dbg(dev, "%s - parity = EVEN\n", __func__); in cp210x_get_termios_port()
1129 dev_dbg(dev, "%s - parity = MARK\n", __func__); in cp210x_get_termios_port()
1133 dev_dbg(dev, "%s - parity = SPACE\n", __func__); in cp210x_get_termios_port()
1138 dev_dbg(dev, "%s - Unknown parity mode, disabling parity\n", __func__); in cp210x_get_termios_port()
1148 dev_dbg(dev, "%s - stop bits = 1\n", __func__); in cp210x_get_termios_port()
1151 dev_dbg(dev, "%s - stop bits = 1.5 (not supported, using 1 stop bit)\n", __func__); in cp210x_get_termios_port()
1156 dev_dbg(dev, "%s - stop bits = 2\n", __func__); in cp210x_get_termios_port()
1160 dev_dbg(dev, "%s - Unknown number of stop bits, using 1 stop bit\n", __func__); in cp210x_get_termios_port()
1170 dev_dbg(dev, "%s - flow control = CRTSCTS\n", __func__); in cp210x_get_termios_port()
1173 * auto-RTS and RTS is deasserted but it leaves auto-CTS when in cp210x_get_termios_port()
1174 * in hardware flow control mode. When re-opening the port, if in cp210x_get_termios_port()
1175 * auto-CTS is enabled on the cp210x, then auto-RTS must be in cp210x_get_termios_port()
1176 * re-enabled in the driver. in cp210x_get_termios_port()
1189 dev_dbg(dev, "%s - flow control = NONE\n", __func__); in cp210x_get_termios_port()
1291 struct usb_serial *serial = port->serial; in cp210x_change_speed()
1301 baud = clamp(tty->termios.c_ospeed, priv->min_speed, priv->max_speed); in cp210x_change_speed()
1303 if (priv->use_actual_rate) in cp210x_change_speed()
1308 dev_dbg(&port->dev, "%s - setting baud rate to %u\n", __func__, baud); in cp210x_change_speed()
1310 dev_warn(&port->dev, "failed to set baud rate to %u\n", baud); in cp210x_change_speed()
1312 baud = old_termios->c_ospeed; in cp210x_change_speed()
1325 if (port_priv->event_mode) in cp210x_enable_event_mode()
1328 port_priv->event_state = ES_DATA; in cp210x_enable_event_mode()
1329 port_priv->event_mode = true; in cp210x_enable_event_mode()
1333 dev_err(&port->dev, "failed to enable events: %d\n", ret); in cp210x_enable_event_mode()
1334 port_priv->event_mode = false; in cp210x_enable_event_mode()
1343 if (!port_priv->event_mode) in cp210x_disable_event_mode()
1348 dev_err(&port->dev, "failed to disable events: %d\n", ret); in cp210x_disable_event_mode()
1352 port_priv->event_mode = false; in cp210x_disable_event_mode()
1358 struct device *dev = &port->dev; in cp210x_set_termios()
1362 cflag = tty->termios.c_cflag; in cp210x_set_termios()
1363 old_cflag = old_termios->c_cflag; in cp210x_set_termios()
1365 if (tty->termios.c_ospeed != old_termios->c_ospeed) in cp210x_set_termios()
1375 dev_dbg(dev, "%s - data bits = 5\n", __func__); in cp210x_set_termios()
1379 dev_dbg(dev, "%s - data bits = 6\n", __func__); in cp210x_set_termios()
1383 dev_dbg(dev, "%s - data bits = 7\n", __func__); in cp210x_set_termios()
1388 dev_dbg(dev, "%s - data bits = 8\n", __func__); in cp210x_set_termios()
1403 dev_dbg(dev, "%s - parity = MARK\n", __func__); in cp210x_set_termios()
1406 dev_dbg(dev, "%s - parity = SPACE\n", __func__); in cp210x_set_termios()
1411 dev_dbg(dev, "%s - parity = ODD\n", __func__); in cp210x_set_termios()
1414 dev_dbg(dev, "%s - parity = EVEN\n", __func__); in cp210x_set_termios()
1427 dev_dbg(dev, "%s - stop bits = 2\n", __func__); in cp210x_set_termios()
1430 dev_dbg(dev, "%s - stop bits = 1\n", __func__); in cp210x_set_termios()
1445 dev_dbg(dev, "%s - read ulControlHandshake=0x%08x, ulFlowReplace=0x%08x\n", in cp210x_set_termios()
1459 dev_dbg(dev, "%s - flow control = CRTSCTS\n", __func__); in cp210x_set_termios()
1466 dev_dbg(dev, "%s - flow control = NONE\n", __func__); in cp210x_set_termios()
1469 dev_dbg(dev, "%s - write ulControlHandshake=0x%08x, ulFlowReplace=0x%08x\n", in cp210x_set_termios()
1478 * Enable event-insertion mode only if input parity checking is in cp210x_set_termios()
1490 struct usb_serial_port *port = tty->driver_data; in cp210x_tiocmset()
1516 dev_dbg(&port->dev, "%s - control = 0x%.4x\n", __func__, control); in cp210x_tiocmset_port()
1531 struct usb_serial_port *port = tty->driver_data; in cp210x_tiocmget()
1546 dev_dbg(&port->dev, "%s - control = 0x%.2x\n", __func__, control); in cp210x_tiocmget()
1553 struct usb_serial_port *port = tty->driver_data; in cp210x_break_ctl()
1560 dev_dbg(&port->dev, "%s - turning break %s\n", __func__, in cp210x_break_ctl()
1571 if (priv->gpio_altfunc & BIT(offset)) in cp210x_gpio_request()
1572 return -ENODEV; in cp210x_gpio_request()
1585 if (priv->partnum == CP210X_PARTNUM_CP2105) in cp210x_gpio_get()
1588 result = usb_autopm_get_interface(serial->interface); in cp210x_gpio_get()
1594 usb_autopm_put_interface(serial->interface); in cp210x_gpio_get()
1615 result = usb_autopm_get_interface(serial->interface); in cp210x_gpio_set()
1619 if (priv->partnum == CP210X_PARTNUM_CP2105) { in cp210x_gpio_set()
1627 result = usb_control_msg(serial->dev, in cp210x_gpio_set()
1628 usb_sndctrlpipe(serial->dev, 0), in cp210x_gpio_set()
1636 usb_autopm_put_interface(serial->interface); in cp210x_gpio_set()
1639 dev_err(&serial->interface->dev, "failed to set GPIO value: %d\n", in cp210x_gpio_set()
1649 return priv->gpio_input & BIT(gpio); in cp210x_gpio_direction_get()
1657 if (priv->partnum == CP210X_PARTNUM_CP2105) { in cp210x_gpio_direction_input()
1659 return -ENOTSUPP; in cp210x_gpio_direction_input()
1662 /* push-pull pins cannot be changed to be inputs */ in cp210x_gpio_direction_input()
1663 if (priv->gpio_pushpull & BIT(gpio)) in cp210x_gpio_direction_input()
1664 return -EINVAL; in cp210x_gpio_direction_input()
1669 priv->gpio_input |= BIT(gpio); in cp210x_gpio_direction_input()
1680 priv->gpio_input &= ~BIT(gpio); in cp210x_gpio_direction_output()
1695 (priv->gpio_pushpull & BIT(gpio))) in cp210x_gpio_set_config()
1699 !(priv->gpio_pushpull & BIT(gpio))) in cp210x_gpio_set_config()
1702 return -ENOTSUPP; in cp210x_gpio_set_config()
1733 /* 2 banks of GPIO - One for the pins taken from each serial port */ in cp2105_gpioconf_init()
1737 priv->gpio_altfunc = 0xff; in cp2105_gpioconf_init()
1742 priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) & in cp2105_gpioconf_init()
1745 priv->gc.ngpio = 2; in cp2105_gpioconf_init()
1749 priv->gpio_altfunc = 0xff; in cp2105_gpioconf_init()
1754 priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) & in cp2105_gpioconf_init()
1757 priv->gc.ngpio = 3; in cp2105_gpioconf_init()
1759 return -ENODEV; in cp2105_gpioconf_init()
1764 priv->gpio_altfunc |= BIT(0); in cp2105_gpioconf_init()
1767 priv->gpio_altfunc |= BIT(1); in cp2105_gpioconf_init()
1770 priv->gpio_input = 0; in cp2105_gpioconf_init()
1790 priv->gc.ngpio = 4; in cp2104_gpioconf_init()
1793 priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) & in cp2104_gpioconf_init()
1802 priv->gpio_altfunc |= BIT(0); in cp2104_gpioconf_init()
1804 priv->gpio_altfunc |= BIT(1); in cp2104_gpioconf_init()
1806 priv->gpio_altfunc |= BIT(2); in cp2104_gpioconf_init()
1813 for (i = 0; i < priv->gc.ngpio; ++i) { in cp2104_gpioconf_init()
1815 * Set direction to "input" iff pin is open-drain and reset in cp2104_gpioconf_init()
1818 if (!(priv->gpio_pushpull & BIT(i)) && (gpio_latch & BIT(i))) in cp2104_gpioconf_init()
1819 priv->gpio_input |= BIT(i); in cp2104_gpioconf_init()
1843 … https://www.silabs.com/community/interface/knowledge-base.entry.html/2017/03/31/cp2102n_setconfig… in cp2102n_gpioconf_init()
1847 return -ENOMEM; in cp2102n_gpioconf_init()
1868 return -ENOTSUPP; in cp2102n_gpioconf_init()
1870 priv->gc.ngpio = 4; in cp2102n_gpioconf_init()
1874 * the direction of an open-drain pin. in cp2102n_gpioconf_init()
1878 /* 0 indicates open-drain mode, 1 is push-pull */ in cp2102n_gpioconf_init()
1879 priv->gpio_pushpull = (gpio_pushpull >> 3) & 0x0f; in cp2102n_gpioconf_init()
1882 priv->gpio_altfunc = (gpio_ctrl >> 2) & 0x0f; in cp2102n_gpioconf_init()
1884 if (priv->partnum == CP210X_PARTNUM_CP2102N_QFN28) { in cp2102n_gpioconf_init()
1886 * For the QFN28 package, GPIO4-6 are controlled by in cp2102n_gpioconf_init()
1892 priv->gc.ngpio = 7; in cp2102n_gpioconf_init()
1894 priv->gpio_pushpull |= (gpio_pushpull & 7) << 4; in cp2102n_gpioconf_init()
1899 * it only knows open-drain and push-pull modes which is set at in cp2102n_gpioconf_init()
1900 * factory. An open-drain pin can function both as an in cp2102n_gpioconf_init()
1901 * input or an output. We emulate input mode for open-drain pins in cp2102n_gpioconf_init()
1903 * push-pull pins to be set as an input. in cp2102n_gpioconf_init()
1905 for (i = 0; i < priv->gc.ngpio; ++i) { in cp2102n_gpioconf_init()
1907 * Set direction to "input" iff pin is open-drain and reset in cp2102n_gpioconf_init()
1910 if (!(priv->gpio_pushpull & BIT(i)) && (gpio_latch & BIT(i))) in cp2102n_gpioconf_init()
1911 priv->gpio_input |= BIT(i); in cp2102n_gpioconf_init()
1922 switch (priv->partnum) { in cp210x_gpio_init()
1941 priv->gc.label = "cp210x"; in cp210x_gpio_init()
1942 priv->gc.request = cp210x_gpio_request; in cp210x_gpio_init()
1943 priv->gc.get_direction = cp210x_gpio_direction_get; in cp210x_gpio_init()
1944 priv->gc.direction_input = cp210x_gpio_direction_input; in cp210x_gpio_init()
1945 priv->gc.direction_output = cp210x_gpio_direction_output; in cp210x_gpio_init()
1946 priv->gc.get = cp210x_gpio_get; in cp210x_gpio_init()
1947 priv->gc.set = cp210x_gpio_set; in cp210x_gpio_init()
1948 priv->gc.set_config = cp210x_gpio_set_config; in cp210x_gpio_init()
1949 priv->gc.owner = THIS_MODULE; in cp210x_gpio_init()
1950 priv->gc.parent = &serial->interface->dev; in cp210x_gpio_init()
1951 priv->gc.base = -1; in cp210x_gpio_init()
1952 priv->gc.can_sleep = true; in cp210x_gpio_init()
1954 result = gpiochip_add_data(&priv->gc, serial); in cp210x_gpio_init()
1956 priv->gpio_registered = true; in cp210x_gpio_init()
1965 if (priv->gpio_registered) { in cp210x_gpio_remove()
1966 gpiochip_remove(&priv->gc); in cp210x_gpio_remove()
1967 priv->gpio_registered = false; in cp210x_gpio_remove()
1987 struct usb_serial *serial = port->serial; in cp210x_port_probe()
1993 return -ENOMEM; in cp210x_port_probe()
1995 port_priv->bInterfaceNumber = cp210x_interface_num(serial); in cp210x_port_probe()
2025 switch (priv->partnum) { in cp210x_init_max_speed()
2060 priv->min_speed = min; in cp210x_init_max_speed()
2061 priv->max_speed = max; in cp210x_init_max_speed()
2062 priv->use_actual_rate = use_actual_rate; in cp210x_init_max_speed()
2072 return -ENOMEM; in cp210x_attach()
2075 CP210X_GET_PARTNUM, &priv->partnum, in cp210x_attach()
2076 sizeof(priv->partnum)); in cp210x_attach()
2078 dev_warn(&serial->interface->dev, in cp210x_attach()
2080 priv->partnum = CP210X_PARTNUM_UNKNOWN; in cp210x_attach()
2089 dev_err(&serial->interface->dev, "GPIO initialisation failed: %d\n", in cp210x_attach()