aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2010-10-16 18:22:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:20:11 -0400
commit0dd25df1a4e63c078f357aaffb09789c9438378f (patch)
treee1ae2b79738420bb7b3150e0c156c1cc181d998c /drivers/serial
parentaf7f3743567e3d5b40e2f9c21541b7f40b99c103 (diff)
serial: bfin_sport_uart: speed up sport RX sample rate to be 3% faster
The actual uart baud rate of devices vary between +/-2% of what is asked. The SPORT RX sample rate should be faster than double of the worst case. Otherwise, wrong data may be received. So set SPORT RX clock to be 3% faster in general. Reported-by: Olivier STOCK <ostockemer@ereca.fr> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/bfin_sport_uart.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c
index 5318dd3774ae..6f1b51e231e4 100644
--- a/drivers/serial/bfin_sport_uart.c
+++ b/drivers/serial/bfin_sport_uart.c
@@ -131,7 +131,12 @@ static int sport_uart_setup(struct sport_uart_port *up, int size, int baud_rate)
131 pr_debug("%s RCR1:%x, RCR2:%x\n", __func__, SPORT_GET_RCR1(up), SPORT_GET_RCR2(up)); 131 pr_debug("%s RCR1:%x, RCR2:%x\n", __func__, SPORT_GET_RCR1(up), SPORT_GET_RCR2(up));
132 132
133 tclkdiv = sclk / (2 * baud_rate) - 1; 133 tclkdiv = sclk / (2 * baud_rate) - 1;
134 rclkdiv = sclk / (2 * baud_rate * 2) - 1; 134 /* The actual uart baud rate of devices vary between +/-2%. The sport
135 * RX sample rate should be faster than the double of the worst case,
136 * otherwise, wrong data are received. So, set sport RX clock to be
137 * 3% faster.
138 */
139 rclkdiv = sclk / (2 * baud_rate * 2 * 97 / 100) - 1;
135 SPORT_PUT_TCLKDIV(up, tclkdiv); 140 SPORT_PUT_TCLKDIV(up, tclkdiv);
136 SPORT_PUT_RCLKDIV(up, rclkdiv); 141 SPORT_PUT_RCLKDIV(up, rclkdiv);
137 SSYNC(); 142 SSYNC();