All of lore.kernel.org
 help / color / mirror / Atom feed
* CR for ftdi_sio.c, SCS P4 Dragon
@ 2021-05-03 19:45 Robert Wolters
  2021-05-04  4:45 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Wolters @ 2021-05-03 19:45 UTC (permalink / raw)
  To: johan; +Cc: linux-usb

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

Dear Johan,

I'd like to submit a small change request for the ftdi_sio.c Kernel module.

Problem: setting a special Baud-rate for the SCS P4 Dragon series 
(Pactor 4) of short-wave modems.

Solution: as implemented in the patch file attached. This change has 
been tested on several Debian-based machines, and works okay. Which is 
not a surprise, as only the Baud-rate is set, using a specific divisor, 
in a same manner as is already done for other devices currently 
supported by ftdi_sio.

I'm also submitting this change request on behalf of SCS GmbH & Co KG of 
Hanau in Germany.

Many thanks in advance. Looking forward to any feedback and/or comments.

Regards,
Robert Wolters (DM4RW)

Südstrasse 4b
82131 Stockdorf (nr Munich)
Germany


[-- Attachment #2: ftdi_sio.c.patch --]
[-- Type: text/x-patch, Size: 2125 bytes --]

--- ftdi_sio.c  2021-04-21 13:01:00.000000000 +0200
+++ ftdi_sio_new.c      2021-04-26 18:53:00.819175707 +0200
@@ -97,6 +97,7 @@
 static int   ftdi_8u2232c_probe(struct usb_serial *serial);
 static void  ftdi_USB_UIRT_setup(struct ftdi_private *priv);
 static void  ftdi_HE_TIRA1_setup(struct ftdi_private *priv);
+static void  ftdi_SCS_DR7X00_setup(struct ftdi_private *priv);
 
 static const struct ftdi_sio_quirk ftdi_jtag_quirk = {
        .probe  = ftdi_jtag_probe,
@@ -122,6 +123,10 @@
        .probe  = ftdi_8u2232c_probe,
 };
 
+static const struct ftdi_sio_quirk ftdi_SCS_DR7X00_quirk = {
+       .port_probe = ftdi_SCS_DR7X00_setup,
+};
+
 /*
  * The 8U232AM has the same API as the sio except for:
  * - it can support MUCH higher baudrates; up to:
@@ -157,8 +162,12 @@
        { USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) },
-       { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) },
-       { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) },
+/*     { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) },
+       { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) },*/
+       { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) ,
+               .driver_info = (kernel_ulong_t)&ftdi_SCS_DR7X00_quirk },
+       { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) ,
+               .driver_info = (kernel_ulong_t)&ftdi_SCS_DR7X00_quirk },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_4_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_5_PID) },
        { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_6_PID) },
@@ -2296,6 +2305,15 @@
        priv->force_rtscts = 1;
 }
 
+/* Setup for the SCS P4dragon DR-7X00 devices, which require hardwired
+ * baudrate of 829440 (38400 gets mapped to 829440) */
+static void ftdi_SCS_DR7X00_setup(struct ftdi_private *priv)
+{
+       priv->flags |= ASYNC_SPD_CUST;
+       priv->custom_divisor = 29;
+       priv->force_baud = 38400;
+}
+
 /*
  * Module parameter to control latency timer for NDI FTDI-based USB devices.
  * If this value is not set in /etc/modprobe.d/ its value will be set

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

* Re: CR for ftdi_sio.c, SCS P4 Dragon
  2021-05-03 19:45 CR for ftdi_sio.c, SCS P4 Dragon Robert Wolters
@ 2021-05-04  4:45 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-05-04  4:45 UTC (permalink / raw)
  To: Robert Wolters; +Cc: johan, linux-usb

On Mon, May 03, 2021 at 09:45:04PM +0200, Robert Wolters wrote:
> Dear Johan,
> 
> I'd like to submit a small change request for the ftdi_sio.c Kernel module.
> 
> Problem: setting a special Baud-rate for the SCS P4 Dragon series (Pactor 4)
> of short-wave modems.
> 
> Solution: as implemented in the patch file attached. This change has been
> tested on several Debian-based machines, and works okay. Which is not a
> surprise, as only the Baud-rate is set, using a specific divisor, in a same
> manner as is already done for other devices currently supported by ftdi_sio.
> 
> I'm also submitting this change request on behalf of SCS GmbH & Co KG of
> Hanau in Germany.
> 
> Many thanks in advance. Looking forward to any feedback and/or comments.
> 
> Regards,
> Robert Wolters (DM4RW)
> 
> Südstrasse 4b
> 82131 Stockdorf (nr Munich)
> Germany
> 

> --- ftdi_sio.c  2021-04-21 13:01:00.000000000 +0200
> +++ ftdi_sio_new.c      2021-04-26 18:53:00.819175707 +0200
> @@ -97,6 +97,7 @@
>  static int   ftdi_8u2232c_probe(struct usb_serial *serial);
>  static void  ftdi_USB_UIRT_setup(struct ftdi_private *priv);
>  static void  ftdi_HE_TIRA1_setup(struct ftdi_private *priv);
> +static void  ftdi_SCS_DR7X00_setup(struct ftdi_private *priv);
>  
>  static const struct ftdi_sio_quirk ftdi_jtag_quirk = {
>         .probe  = ftdi_jtag_probe,
> @@ -122,6 +123,10 @@
>         .probe  = ftdi_8u2232c_probe,
>  };
>  
> +static const struct ftdi_sio_quirk ftdi_SCS_DR7X00_quirk = {
> +       .port_probe = ftdi_SCS_DR7X00_setup,
> +};
> +
>  /*
>   * The 8U232AM has the same API as the sio except for:
>   * - it can support MUCH higher baudrates; up to:
> @@ -157,8 +162,12 @@
>         { USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) },
>         { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) },
>         { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) },
> -       { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) },
> -       { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) },
> +/*     { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) },
> +       { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) },*/
> +       { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) ,
> +               .driver_info = (kernel_ulong_t)&ftdi_SCS_DR7X00_quirk },
> +       { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_3_PID) ,
> +               .driver_info = (kernel_ulong_t)&ftdi_SCS_DR7X00_quirk },
>         { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_4_PID) },
>         { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_5_PID) },
>         { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_6_PID) },
> @@ -2296,6 +2305,15 @@
>         priv->force_rtscts = 1;
>  }
>  
> +/* Setup for the SCS P4dragon DR-7X00 devices, which require hardwired
> + * baudrate of 829440 (38400 gets mapped to 829440) */
> +static void ftdi_SCS_DR7X00_setup(struct ftdi_private *priv)
> +{
> +       priv->flags |= ASYNC_SPD_CUST;
> +       priv->custom_divisor = 29;
> +       priv->force_baud = 38400;
> +}
> +
>  /*
>   * Module parameter to control latency timer for NDI FTDI-based USB devices.
>   * If this value is not set in /etc/modprobe.d/ its value will be set

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 is malformed (tabs converted to spaces, linewrapped, etc.)
  and can not be applied.  Please read the file,
  Documentation/email-clients.txt in order to fix this.

- Your patch was attached, please place it inline so that it can be
  applied directly from the email message itself.

- 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.

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

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] 2+ messages in thread

end of thread, other threads:[~2021-05-04  4:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-03 19:45 CR for ftdi_sio.c, SCS P4 Dragon Robert Wolters
2021-05-04  4:45 ` Greg KH

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.