[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1287771688-14805-48-git-send-email-gregkh@suse.de>
Date: Fri, 22 Oct 2010 11:21:27 -0700
From: Greg Kroah-Hartman <gregkh@...e.de>
To: linux-kernel@...r.kernel.org
Cc: Sonic Zhang <sonic.zhang@...log.com>,
Mike Frysinger <vapier@...too.org>,
Greg Kroah-Hartman <gregkh@...e.de>
Subject: [PATCH 48/49] serial: bfin_sport_uart: speed up sport RX sample rate to be 3% faster
From: Sonic Zhang <sonic.zhang@...log.com>
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@...ca.fr>
Signed-off-by: Sonic Zhang <sonic.zhang@...log.com>
Signed-off-by: Mike Frysinger <vapier@...too.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
drivers/serial/bfin_sport_uart.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c
index 5318dd3..6f1b51e 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)
pr_debug("%s RCR1:%x, RCR2:%x\n", __func__, SPORT_GET_RCR1(up), SPORT_GET_RCR2(up));
tclkdiv = sclk / (2 * baud_rate) - 1;
- rclkdiv = sclk / (2 * baud_rate * 2) - 1;
+ /* The actual uart baud rate of devices vary between +/-2%. The sport
+ * RX sample rate should be faster than the double of the worst case,
+ * otherwise, wrong data are received. So, set sport RX clock to be
+ * 3% faster.
+ */
+ rclkdiv = sclk / (2 * baud_rate * 2 * 97 / 100) - 1;
SPORT_PUT_TCLKDIV(up, tclkdiv);
SPORT_PUT_RCLKDIV(up, rclkdiv);
SSYNC();
--
1.7.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists