All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: serial: mos7840: Add USB ID to support Moxa UPort 2210
@ 2019-10-30 19:52 Pavel Löbl
  2019-10-31  6:48 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Löbl @ 2019-10-30 19:52 UTC (permalink / raw)
  To: linux-usb; +Cc: Johan Hovold, Greg Kroah-Hartman, Pavel Löbl

Adds 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.
---
 drivers/usb/serial/mos7840.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index a698d46ba773..8afc165cc984 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -119,10 +119,13 @@
 /* This driver also supports
  * ATEN UC2324 device using Moschip MCS7840
  * ATEN UC2322 device using Moschip MCS7820
+ * MOXA UPort 2210 device using Moschip MCS7820
  */
 #define USB_VENDOR_ID_ATENINTL		0x0557
 #define ATENINTL_DEVICE_ID_UC2324	0x2011
 #define ATENINTL_DEVICE_ID_UC2322	0x7820
+#define MXU2_VENDOR_ID              0x110a
+#define MXU2_DEVICE_ID_2210         0x2210
 
 /* Interrupt Routine Defines    */
 
@@ -195,6 +198,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_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
 	{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
+	{USB_DEVICE(MXU2_VENDOR_ID, MXU2_DEVICE_ID_2210)},
 	{}			/* terminating entry */
 };
 MODULE_DEVICE_TABLE(usb, id_table);
@@ -2030,6 +2034,11 @@ static int mos7840_probe(struct usb_serial *serial,
 		goto out;
 	}
 
+	if (product == MXU2_DEVICE_ID_2210) {
+		device_type = MOSCHIP_DEVICE_ID_7820;
+		goto out;
+	}
+
 	buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: serial: mos7840: Add USB ID to support Moxa UPort 2210
  2019-10-30 19:52 Pavel Löbl
@ 2019-10-31  6:48 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2019-10-31  6:48 UTC (permalink / raw)
  To: Pavel Löbl; +Cc: linux-usb, Johan Hovold

On Wed, Oct 30, 2019 at 08:52:53PM +0100, Pavel Löbl wrote:
> Adds 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.
> ---
>  drivers/usb/serial/mos7840.c | 9 +++++++++
>  1 file changed, 9 insertions(+)

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch does not have a Signed-off-by: line.  Please read the
  kernel file, Documentation/SubmittingPatches and resend it after
  adding that line.  Note, the line needs to be in the body of the
  email, before the patch, not at the bottom of the patch or in the
  email signature.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] usb: serial: mos7840: Add USB ID to support Moxa UPort 2210
@ 2019-11-01  7:01 Pavel Löbl
  2019-11-07 13:18 ` Johan Hovold
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Löbl @ 2019-11-01  7:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Johan Hovold, Greg Kroah-Hartman, Pavel Löbl

Adds 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: Pavel Löbl <pavel@loebl.cz>
---
 drivers/usb/serial/mos7840.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index a698d46ba773..13aff04ad027 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -119,10 +119,13 @@
 /* This driver also supports
  * ATEN UC2324 device using Moschip MCS7840
  * ATEN UC2322 device using Moschip MCS7820
+ * MOXA UPort 2210 device using Moschip MCS7820
  */
 #define USB_VENDOR_ID_ATENINTL		0x0557
 #define ATENINTL_DEVICE_ID_UC2324	0x2011
 #define ATENINTL_DEVICE_ID_UC2322	0x7820
+#define USB_VENDOR_ID_MXU2      0x110a
+#define MXU2_DEVICE_ID_2210     0x2210
 
 /* Interrupt Routine Defines    */
 
@@ -195,6 +198,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_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
 	{USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
+	{USB_DEVICE(USB_VENDOR_ID_MXU2, MXU2_DEVICE_ID_2210)},
 	{}			/* terminating entry */
 };
 MODULE_DEVICE_TABLE(usb, id_table);
@@ -2030,6 +2034,11 @@ static int mos7840_probe(struct usb_serial *serial,
 		goto out;
 	}
 
+	if (product == MXU2_DEVICE_ID_2210) {
+		device_type = MOSCHIP_DEVICE_ID_7820;
+		goto out;
+	}
+
 	buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL);
 	if (!buf)
 		return -ENOMEM;
-- 
2.24.0.rc1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: serial: mos7840: Add USB ID to support Moxa UPort 2210
  2019-11-01  7:01 [PATCH] usb: serial: mos7840: Add USB ID to support Moxa UPort 2210 Pavel Löbl
@ 2019-11-07 13:18 ` Johan Hovold
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2019-11-07 13:18 UTC (permalink / raw)
  To: Pavel Löbl; +Cc: linux-kernel, Johan Hovold, Greg Kroah-Hartman

On Fri, Nov 01, 2019 at 08:01:50AM +0100, Pavel Löbl wrote:
> Adds 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: Pavel Löbl <pavel@loebl.cz>

Thanks for the patch.

I've applied this for 5.6 now after adding a vendor id check and
renaming the id defines.

	https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git/commit/?h=usb-next&id=e696d00e65e81d46e911f24b12e441037bf11b38

The device-type detection is indeed fragile, so I've also prepared a
follow-up patch to clean up the device-type handling in order to avoid
adding further id-conditionals throughout the driver.

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-07 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-01  7:01 [PATCH] usb: serial: mos7840: Add USB ID to support Moxa UPort 2210 Pavel Löbl
2019-11-07 13:18 ` Johan Hovold
  -- strict thread matches above, loose matches on Subject: below --
2019-10-30 19:52 Pavel Löbl
2019-10-31  6:48 ` Greg Kroah-Hartman

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.