Commit 84743898 authored by Pavel Löbl's avatar Pavel Löbl Committed by Greg Kroah-Hartman

USB: serial: mos7840: add USB ID to support Moxa UPort 2210

commit e696d00e upstream.

Add USB ID for MOXA UPort 2210. This device contains mos7820 but
it passes GPIO0 check implemented by driver and it's detected as
mos7840. Hence product id check is added to force mos7820 mode.
Signed-off-by: default avatarPavel Löbl <pavel@loebl.cz>
Cc: stable <stable@vger.kernel.org>
[ johan: rename id defines and add vendor-id check ]
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 356440a7
...@@ -118,11 +118,15 @@ ...@@ -118,11 +118,15 @@
/* This driver also supports /* This driver also supports
* ATEN UC2324 device using Moschip MCS7840 * ATEN UC2324 device using Moschip MCS7840
* ATEN UC2322 device using Moschip MCS7820 * ATEN UC2322 device using Moschip MCS7820
* MOXA UPort 2210 device using Moschip MCS7820
*/ */
#define USB_VENDOR_ID_ATENINTL 0x0557 #define USB_VENDOR_ID_ATENINTL 0x0557
#define ATENINTL_DEVICE_ID_UC2324 0x2011 #define ATENINTL_DEVICE_ID_UC2324 0x2011
#define ATENINTL_DEVICE_ID_UC2322 0x7820 #define ATENINTL_DEVICE_ID_UC2322 0x7820
#define USB_VENDOR_ID_MOXA 0x110a
#define MOXA_DEVICE_ID_2210 0x2210
/* Interrupt Routine Defines */ /* Interrupt Routine Defines */
#define SERIAL_IIR_RLS 0x06 #define SERIAL_IIR_RLS 0x06
...@@ -193,6 +197,7 @@ static const struct usb_device_id id_table[] = { ...@@ -193,6 +197,7 @@ static const struct usb_device_id id_table[] = {
{USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)},
{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
{USB_DEVICE(USB_VENDOR_ID_MOXA, MOXA_DEVICE_ID_2210)},
{} /* terminating entry */ {} /* terminating entry */
}; };
MODULE_DEVICE_TABLE(usb, id_table); MODULE_DEVICE_TABLE(usb, id_table);
...@@ -2053,6 +2058,7 @@ static int mos7840_probe(struct usb_serial *serial, ...@@ -2053,6 +2058,7 @@ static int mos7840_probe(struct usb_serial *serial,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
u16 product = le16_to_cpu(serial->dev->descriptor.idProduct); u16 product = le16_to_cpu(serial->dev->descriptor.idProduct);
u16 vid = le16_to_cpu(serial->dev->descriptor.idVendor);
u8 *buf; u8 *buf;
int device_type; int device_type;
...@@ -2062,6 +2068,11 @@ static int mos7840_probe(struct usb_serial *serial, ...@@ -2062,6 +2068,11 @@ static int mos7840_probe(struct usb_serial *serial,
goto out; goto out;
} }
if (vid == USB_VENDOR_ID_MOXA && product == MOXA_DEVICE_ID_2210) {
device_type = MOSCHIP_DEVICE_ID_7820;
goto out;
}
buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL); buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment