linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* set custom baud-rate for SCS P4 Dragon
@ 2021-05-06  7:43 Robert Wolters
  2021-05-06  7:56 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Wolters @ 2021-05-06  7:43 UTC (permalink / raw)
  To: johan; +Cc: linux-usb

|Why: FTDI USB serial speed issue with SCS P4 Dragon short-wave modems, 
a custom baud-rate is required Solution: set special baud-rate by 
setting a custom divisor on 38400B Signed-off-by: Robert Wolters 
<robert@woltersonline.net> | ||--- ftdi_sio.c 2021-04-21 
13:01:00.000000000 +0200| ||+++ ftdi_sio.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) ,| |+ .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 baud-rate 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] 4+ messages in thread

* Re: set custom baud-rate for SCS P4 Dragon
  2021-05-06  7:43 set custom baud-rate for SCS P4 Dragon Robert Wolters
@ 2021-05-06  7:56 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2021-05-06  7:56 UTC (permalink / raw)
  To: Robert Wolters; +Cc: johan, linux-usb

On Thu, May 06, 2021 at 09:43:41AM +0200, Robert Wolters wrote:
> |Why: FTDI USB serial speed issue with SCS P4 Dragon short-wave modems, a
> custom baud-rate is required Solution: set special baud-rate by setting a
> custom divisor on 38400B Signed-off-by: Robert Wolters
> <robert@woltersonline.net> | ||--- ftdi_sio.c 2021-04-21 13:01:00.000000000
> +0200| ||+++ ftdi_sio.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) ,| |+ .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 baud-rate 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|
> 

I think something went wrong with your email client :(



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

* Re: Set custom baud-rate for SCS P4 Dragon
  2021-05-06  8:44 Set " Robert Wolters
@ 2021-05-10  8:22 ` Johan Hovold
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2021-05-10  8:22 UTC (permalink / raw)
  To: Robert Wolters; +Cc: linux-usb

On Thu, May 06, 2021 at 10:44:25AM +0200, Robert Wolters wrote:
> Why: FTDI USB serial speed issue with SCS P4 Dragon short-wave modems,
> a custom baud-rate is required
> 
> Solution: set special baud-rate by setting a custom divisor on 38400B

You can set any baudrate you want using the TCSETS2 interface, and you
can still use the legacy TIOCSSERIAL ioctl interface (e.g. setserial)
if you prefer.

No need to be hardcoding anything in the kernel.

Johan

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

* Set custom baud-rate for SCS P4 Dragon
@ 2021-05-06  8:44 Robert Wolters
  2021-05-10  8:22 ` Johan Hovold
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Wolters @ 2021-05-06  8:44 UTC (permalink / raw)
  To: johan; +Cc: linux-usb

Why: FTDI USB serial speed issue with SCS P4 Dragon short-wave modems,
a custom baud-rate is required

Solution: set special baud-rate by setting a custom divisor on 38400B

Signed-off-by: Robert Wolters <robert@woltersonline.net>

--- ftdi_sio.c 2021-04-21 13:01:00.000000000 +0200
+++ ftdi_sio.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) ,
+		.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 baud-rate 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] 4+ messages in thread

end of thread, other threads:[~2021-05-10  8:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06  7:43 set custom baud-rate for SCS P4 Dragon Robert Wolters
2021-05-06  7:56 ` Greg KH
2021-05-06  8:44 Set " Robert Wolters
2021-05-10  8:22 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).