Skip to contentSkip to conversation

Improve the accuracy of the baud rate generator by using round-to-closest instead of truncating when calculating baud rate divisors.

DISCUSSION Nikolaj Fogh 1 participant 1 message Nov 13, 2018 USB

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines · Johan Hovold
Quoted 1 line · Nikolaj Fogh

I have experienced that the ftdi_sio driver gives less-than-optimal baud rates as the driver truncates instead of rounds to nearest during baud rate divisor calculation.

Please break your lines at 72 cols or so, and use the common subject prefix (e.g. "USB: serial: ftdi_sio: improve...") with a concise summary.

Ok. I will do that in the future.

Quoted 7 lines
Quoted 1 line

This patch improves on the baud rate generation. The generated baud rate corresponds to the optimal baud rate achievable with the chip. This is what the windows driver gives as well.

How did you verify this? Did you trace and compare the divisors actually requested by the Windows driver, or did you measure the resulting rates using a scope?

Thanks,
Johan

I verified it by scope. Granted, I only verified it for one baud rate (961200). Whether it gives the same as the Windows driver in general, I'm not sure. However, I would think that rounding instead of flooring would always yield the most accurate result.

Best regards
  Nikolaj Fogh