• Peter Hurley's avatar
    serial: 8250: Refactor XR17V35X divisor calculation · 06a4c710
    Peter Hurley authored
    Exar XR17V35X PCIe uarts support a 4-bit fractional divisor register.
    Refactor the divisor calculation from the divisor programming.
    
    Allow a fractional result from serial8250_get_divisor() and pass this
    result to serial8250_dl_write().
    
    Simplify the calculation for quot and quot_frac. This was verified
    to be identical to the results of the original calculation with a test
    jig.
    
    NB: The results were also compared with the divisor value chart
    on pg 33 of the Exar XR17V352 datasheet, rev 1.0.3, here:
    http://www.exar.com/common/content/document.ashx?id=1585
    which differs from the calculated values by 1 in the fractional result.
    This is because the calculated values are still rounded in the
    fractional result, whereas the table values are truncated. Note
    that the data error rate % values in the datasheet are for
    rounded fractional results, as the truncated fractional results
    have more error.
    
    Cc: Joe Schultz <jschultz@xes-inc.com>
    Cc: Aaron Sierra <asierra@xes-inc.com>
    Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    06a4c710
8250_core.c 96.7 KB