• Frank Schäfer's avatar
    usb: pl2303: fix+improve the divsor based baud rate encoding method · 57ce61aa
    Frank Schäfer authored
    Based on the formula in the code description, Reinhard Max and me have
    investigated the devices behavior / functional principle of the divisor
    based baud rate encoding method.
    
    It turned out, that (although beeing a good starting point) the current
    code has some flaws. It doesn't work correctly for a wide range of baud
    rates and the divisor resolution can be improved. It also doesn't
    report the actually set baud rate.
    
    This patch fixes and improves the code for the divisor based baud rate
    encoding method a lot. It can now be used for the whole range of baud
    rates from 46 baud to 24M baud with a very good divisor resolution and
    userspace can read back the resulting baud rate.
    
    It also documents the formula used for encoding and the hardware
    behavior (including special cases).
    
    The basic algorithm, rounding and several code comments/explanations
    are provided by Reinhard Max.
    I've added some minor fixes, the handling of the special cases and
    further code/algorithm descriptions.
    Signed-off-by: default avatarFrank Schäfer <fschaefer.oss@googlemail.com>
    Signed-off-by: default avatarReinhard Max <max@suse.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    57ce61aa
pl2303.c 24.7 KB