From: Jackychou <jackychou@asix.com.tw>
To: johan@kernel.org
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, louis@asix.com.tw,
jackychou@asix.com.tw
Subject: [2/2] USB: serial: mos7840: Add a product ID for the new product
Date: Thu, 29 Nov 2018 14:51:38 +0800 [thread overview]
Message-ID: <005901d487af$f9cd87d0$ed689770$@asix.com.tw> (raw)
From: JackyChou <jackychou@asix.com.tw>
Add a new PID 0x7843 to the driver.
Let the new products be able to set up 3 serial ports with the driver.
Signed-off-by: JackyChou <jackychou@asix.com.tw>
---
drivers/usb/serial/mos7840.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
* num_ports is currently never zero as device_type is one of
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 92ab68ef08ab..b6e7b55fcb7c 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)},
@@ -2033,7 +2035,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;
}
@@ -2067,7 +2070,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;
/*
WARNING: multiple messages have this Message-ID (diff)
From: "JackyChou" <jackychou@asix.com.tw>
To: <johan@kernel.org>
Cc: <gregkh@linuxfoundation.org>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <louis@asix.com.tw>,
<jackychou@asix.com.tw>
Subject: FW: [PATCH 2/2] USB: serial: mos7840: Add a product ID for the new product
Date: Thu, 29 Nov 2018 14:51:38 +0800 [thread overview]
Message-ID: <005901d487af$f9cd87d0$ed689770$@asix.com.tw> (raw)
In-Reply-To: <20181129064728.11830-2-jackychou@asix.com.tw>
From: JackyChou <jackychou@asix.com.tw>
Add a new PID 0x7843 to the driver.
Let the new products be able to set up 3 serial ports with the driver.
Signed-off-by: JackyChou <jackychou@asix.com.tw>
---
drivers/usb/serial/mos7840.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 92ab68ef08ab..b6e7b55fcb7c 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)},
@@ -2033,7 +2035,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;
}
@@ -2067,7 +2070,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
--
2.17.1
next reply other threads:[~2018-11-29 6:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-29 6:51 Jackychou [this message]
2018-11-29 6:51 ` FW: [PATCH 2/2] USB: serial: mos7840: Add a product ID for the new product JackyChou
-- strict thread matches above, loose matches on Subject: below --
2018-11-29 15:49 [1/2] USB: serial: mos7840: Adjust port settings for read and write registers Johan Hovold
2018-11-29 15:49 ` [PATCH 1/2] " Johan Hovold
2018-11-29 6:51 [1/2] " Jackychou
2018-11-29 6:51 ` [PATCH 1/2] " JackyChou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='005901d487af$f9cd87d0$ed689770$@asix.com.tw' \
--to=jackychou@asix.com.tw \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=louis@asix.com.tw \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.