[PATCH 6/8] pl2303: increase the allow baud rate range for the divisor based encoding method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reinhard Max has done some tests with a PL2303HX (rev A) and a logic analyzer and
it seems, that although the PL2303HX is specified for baud rates from 75 to 6M
baud, the full divisor range can be used with the divisor based baud rate
encoding method. This corresponds to baud rates from 46 to 24M baud.
Baud rates down to 46 baud (max. divisor) have been confirmed to work even under
heavy/permanent load, so remove the lower limit.
Baud rates up to 24M baud should really be tested carefully in "real life"
scenarios before removing the upper limit completely.
Anyway, the Windows driver allows maximum baud rates of 110% of the specified limit,
so for now, increase the upper limit to this value.

Signed-off-by: Frank Schäfer <fschaefer.oss@xxxxxxxxxxxxxx>
Signed-off-by: Reinhard Max <max@xxxxxxx>
---
 drivers/usb/serial/pl2303.c |   16 ++++++++++++----
 1 Datei geändert, 12 Zeilen hinzugefügt(+), 4 Zeilen entfernt(-)

diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 174c685..5085568 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -321,12 +321,20 @@ static int pl2303_baudrate_encode_divisor(int baud, enum pl2303_type type,
 	 */
 	unsigned int A, B;
 
-	/* Respect the specified baud rate limits */
-	baud = max_t(int, baud, 75);
+	/*
+	 * NOTE: The Windows driver allows maximum baud rates of 110% of the
+	 * specified maximium value.
+	 * Quick tests with early (2004) HX (rev. A) chips suggest, that even
+	 * higher baud rates (up to the maximum of 24M baud !) are working fine,
+	 * but that should really be tested carefully in "real life" scenarios
+	 * before removing the upper limit completely.
+	 * Baud rates smaller than the specified 75 baud are definitely working
+	 * fine.
+	 */
 	if (type == HX)
-		baud = min_t(int, baud, 6000000);
+		baud = min_t(int, baud, 6000000 * 1.1);
 	else
-		baud = min_t(int, baud, 1228800);
+		baud = min_t(int, baud, 1228800 * 1.1);
 	/* Determine factors A and B */
 	A = 0;
 	B = 12000000 * 32 / baud;  /* 12MHz */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux