Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: mos7840: add a product ID for the new product

Add a new PID 0x7843 to the driver.
Let the new products be able to set up 3 serial ports with the driver.

Note that this depends on e8603076f540 ("USB: serial: mos7840: clean up
register handling").

Signed-off-by: JackyChou <jackychou@asix.com.tw>
[ johan: mention dependency in case anyone wants to backport this ]
Signed-off-by: Johan Hovold <johan@kernel.org>

authored by

JackyChou and committed by
Johan Hovold
32899682 e8603076

+8 -2
+8 -2
drivers/usb/serial/mos7840.c
··· 94 94 /* The native mos7840/7820 component */ 95 95 #define USB_VENDOR_ID_MOSCHIP 0x9710 96 96 #define MOSCHIP_DEVICE_ID_7840 0x7840 97 + #define MOSCHIP_DEVICE_ID_7843 0x7843 97 98 #define MOSCHIP_DEVICE_ID_7820 0x7820 98 99 #define MOSCHIP_DEVICE_ID_7810 0x7810 99 100 /* The native component can have its vendor/device id's overridden ··· 177 176 178 177 static const struct usb_device_id id_table[] = { 179 178 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, 179 + {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7843)}, 180 180 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, 181 181 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)}, 182 182 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)}, ··· 2030 2028 int device_type; 2031 2029 2032 2030 if (product == MOSCHIP_DEVICE_ID_7810 || 2033 - product == MOSCHIP_DEVICE_ID_7820) { 2031 + product == MOSCHIP_DEVICE_ID_7820 || 2032 + product == MOSCHIP_DEVICE_ID_7843) { 2034 2033 device_type = product; 2035 2034 goto out; 2036 2035 } ··· 2065 2062 int device_type = (unsigned long)usb_get_serial_data(serial); 2066 2063 int num_ports; 2067 2064 2068 - num_ports = (device_type >> 4) & 0x000F; 2065 + if (device_type == MOSCHIP_DEVICE_ID_7843) 2066 + num_ports = 3; 2067 + else 2068 + num_ports = (device_type >> 4) & 0x000F; 2069 2069 2070 2070 /* 2071 2071 * num_ports is currently never zero as device_type is one of