diff options
author | JackyChou <jackychou@asix.com.tw> | 2018-11-30 14:31:22 +0800 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2018-12-05 07:05:11 +0100 |
commit | 32899682cf457de5c091ee7dbbee34ad9bf2f992 (patch) | |
tree | 9d4f458faf132f8460c3dee45605a5002896b242 /drivers | |
parent | e8603076f5404cc103869a62f319bc8a4797cc50 (diff) | |
download | linux-32899682cf457de5c091ee7dbbee34ad9bf2f992.tar.gz linux-32899682cf457de5c091ee7dbbee34ad9bf2f992.tar.bz2 linux-32899682cf457de5c091ee7dbbee34ad9bf2f992.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/mos7840.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 4159d3195388..6ff6d67b6d5a 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -94,6 +94,7 @@ /* The native mos7840/7820 component */ #define USB_VENDOR_ID_MOSCHIP 0x9710 #define MOSCHIP_DEVICE_ID_7840 0x7840 +#define MOSCHIP_DEVICE_ID_7843 0x7843 #define MOSCHIP_DEVICE_ID_7820 0x7820 #define MOSCHIP_DEVICE_ID_7810 0x7810 /* The native component can have its vendor/device id's overridden @@ -176,6 +177,7 @@ enum mos7840_flag { static const struct usb_device_id id_table[] = { {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, + {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7843)}, {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7810)}, {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)}, @@ -2028,7 +2030,8 @@ static int mos7840_probe(struct usb_serial *serial, int device_type; if (product == MOSCHIP_DEVICE_ID_7810 || - product == MOSCHIP_DEVICE_ID_7820) { + product == MOSCHIP_DEVICE_ID_7820 || + product == MOSCHIP_DEVICE_ID_7843) { device_type = product; goto out; } @@ -2062,7 +2065,10 @@ static int mos7840_calc_num_ports(struct usb_serial *serial, int device_type = (unsigned long)usb_get_serial_data(serial); int num_ports; - num_ports = (device_type >> 4) & 0x000F; + if (device_type == MOSCHIP_DEVICE_ID_7843) + num_ports = 3; + else + num_ports = (device_type >> 4) & 0x000F; /* * num_ports is currently never zero as device_type is one of |