From: Kuninori Morimoto <morimoto.kuninori@renesas.com>
To: linux-sh@vger.kernel.org
Subject: [PATCH] sh-sci: fix SCBRR value calculation
Date: Tue, 14 Apr 2009 04:34:52 +0000 [thread overview]
Message-ID: <ud4bf3jpm.wl%morimoto.kuninori@renesas.com> (raw)
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
---
>> Iwamatsu-san
Please check this patch to make sure it doesn't break any boards.
I checked this patch by AP325 (for SCIFA)
and Diamond Head (for SCIF)
It works well
But I don't know about some strange Hitachi ULSI board with magical clock settings.
drivers/serial/sh-sci.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h
index d0aa82d..f8c0b87 100644
--- a/drivers/serial/sh-sci.h
+++ b/drivers/serial/sh-sci.h
@@ -761,9 +761,9 @@ static inline int sci_rxd_in(struct uart_port *port)
static inline int scbrr_calc(struct uart_port *port, int bps, int clk)
{
if (port->type = PORT_SCIF)
- return (clk+16*bps)/(32*bps)-1;
+ return (clk/(32*bps)) - 1;
else
- return ((clk*2)+16*bps)/(16*bps)-1;
+ return ((clk*2)/(16*bps)) - 1;
}
#define SCBRR_VALUE(bps, clk) scbrr_calc(port, bps, clk)
#elif defined(__H8300H__) || defined(__H8300S__)
--
1.5.6.3
next reply other threads:[~2009-04-14 4:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-14 4:34 Kuninori Morimoto [this message]
2009-04-14 5:37 ` [PATCH] sh-sci: fix SCBRR value calculation yoshii.takashi
2009-04-14 5:53 ` morimoto.kuninori
2009-04-22 0:36 ` Paul Mundt
2009-04-22 2:50 ` Kuninori Morimoto
2009-04-22 2:55 ` Paul Mundt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ud4bf3jpm.wl%morimoto.kuninori@renesas.com \
--to=morimoto.kuninori@renesas.com \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox