Merge tag 'usb-serial-6.19-rc6' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB serial fix for 6.19-rc6

Here's a fix for an f81232 enumeration issue that could prevent some
ports from being enabled (e.g. during driver rebind).

Included are also some new device ids.

All have been in linux-next with no reported issues.

* tag 'usb-serial-6.19-rc6' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial:
USB: serial: f81232: fix incomplete serial port generation
USB: serial: ftdi_sio: add support for PICAXE AXE027 cable
USB: serial: option: add Telit LE910 MBIM composition

+51 -30
+47 -30
drivers/usb/serial/f81232.c
··· 70 70 #define F81232_REGISTER_REQUEST 0xa0 71 71 #define F81232_GET_REGISTER 0xc0 72 72 #define F81232_SET_REGISTER 0x40 73 - #define F81534A_ACCESS_REG_RETRY 2 74 73 75 74 #define SERIAL_BASE_ADDRESS 0x0120 76 75 #define RECEIVE_BUFFER_REGISTER (0x00 + SERIAL_BASE_ADDRESS) ··· 823 824 static int f81534a_ctrl_set_register(struct usb_interface *intf, u16 reg, 824 825 u16 size, void *val) 825 826 { 826 - struct usb_device *dev = interface_to_usbdev(intf); 827 - int retry = F81534A_ACCESS_REG_RETRY; 828 - int status; 827 + return usb_control_msg_send(interface_to_usbdev(intf), 828 + 0, 829 + F81232_REGISTER_REQUEST, 830 + F81232_SET_REGISTER, 831 + reg, 832 + 0, 833 + val, 834 + size, 835 + USB_CTRL_SET_TIMEOUT, 836 + GFP_KERNEL); 837 + } 829 838 830 - while (retry--) { 831 - status = usb_control_msg_send(dev, 832 - 0, 833 - F81232_REGISTER_REQUEST, 834 - F81232_SET_REGISTER, 835 - reg, 836 - 0, 837 - val, 838 - size, 839 - USB_CTRL_SET_TIMEOUT, 840 - GFP_KERNEL); 841 - if (status) { 842 - status = usb_translate_errors(status); 843 - if (status == -EIO) 844 - continue; 845 - } 846 - 847 - break; 848 - } 849 - 850 - if (status) { 851 - dev_err(&intf->dev, "failed to set register 0x%x: %d\n", 852 - reg, status); 853 - } 854 - 855 - return status; 839 + static int f81534a_ctrl_get_register(struct usb_interface *intf, u16 reg, 840 + u16 size, void *val) 841 + { 842 + return usb_control_msg_recv(interface_to_usbdev(intf), 843 + 0, 844 + F81232_REGISTER_REQUEST, 845 + F81232_GET_REGISTER, 846 + reg, 847 + 0, 848 + val, 849 + size, 850 + USB_CTRL_GET_TIMEOUT, 851 + GFP_KERNEL); 856 852 } 857 853 858 854 static int f81534a_ctrl_enable_all_ports(struct usb_interface *intf, bool en) ··· 863 869 * bit 0~11 : Serial port enable bit. 864 870 */ 865 871 if (en) { 872 + /* 873 + * The Fintek F81532A/534A/535/536 family relies on the 874 + * F81534A_CTRL_CMD_ENABLE_PORT (116h) register during 875 + * initialization to both determine serial port status and 876 + * control port creation. 877 + * 878 + * If the driver experiences fast load/unload cycles, the 879 + * device state may becomes unstable, resulting in the 880 + * incomplete generation of serial ports. 881 + * 882 + * Performing a dummy read operation on the register prior 883 + * to the initial write command resolves the issue. 884 + * 885 + * This clears the device's stale internal state. Subsequent 886 + * write operations will correctly generate all serial ports. 887 + */ 888 + status = f81534a_ctrl_get_register(intf, 889 + F81534A_CTRL_CMD_ENABLE_PORT, 890 + sizeof(enable), 891 + enable); 892 + if (status) 893 + return status; 894 + 866 895 enable[0] = 0xff; 867 896 enable[1] = 0x8f; 868 897 }
+1
drivers/usb/serial/ftdi_sio.c
··· 848 848 { USB_DEVICE_INTERFACE_NUMBER(FTDI_VID, LMI_LM3S_DEVEL_BOARD_PID, 1) }, 849 849 { USB_DEVICE_INTERFACE_NUMBER(FTDI_VID, LMI_LM3S_EVAL_BOARD_PID, 1) }, 850 850 { USB_DEVICE_INTERFACE_NUMBER(FTDI_VID, LMI_LM3S_ICDI_BOARD_PID, 1) }, 851 + { USB_DEVICE(FTDI_VID, FTDI_AXE027_PID) }, 851 852 { USB_DEVICE_INTERFACE_NUMBER(FTDI_VID, FTDI_TURTELIZER_PID, 1) }, 852 853 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, 853 854 { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) },
+2
drivers/usb/serial/ftdi_sio_ids.h
··· 96 96 #define LMI_LM3S_EVAL_BOARD_PID 0xbcd9 97 97 #define LMI_LM3S_ICDI_BOARD_PID 0xbcda 98 98 99 + #define FTDI_AXE027_PID 0xBD90 /* PICAXE AXE027 USB download cable */ 100 + 99 101 #define FTDI_TURTELIZER_PID 0xBDC8 /* JTAG/RS-232 adapter by egnite GmbH */ 100 102 101 103 /* OpenDCC (www.opendcc.de) product id */
+1
drivers/usb/serial/option.c
··· 1505 1505 { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1231, 0xff), /* Telit LE910Cx (RNDIS) */ 1506 1506 .driver_info = NCTRL(2) | RSVD(3) }, 1507 1507 { USB_DEVICE_AND_INTERFACE_INFO(TELIT_VENDOR_ID, 0x1250, 0xff, 0x00, 0x00) }, /* Telit LE910Cx (rmnet) */ 1508 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1252, 0xff) }, /* Telit LE910Cx (MBIM) */ 1508 1509 { USB_DEVICE(TELIT_VENDOR_ID, 0x1260), 1509 1510 .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, 1510 1511 { USB_DEVICE(TELIT_VENDOR_ID, 0x1261),