From: Nobuhiro Iwamatsu Date: Fri, 3 Oct 2008 08:37:31 +0000 (+0900) Subject: serial: sh-sci: Add support SCIF of SH7723 X-Git-Tag: v2.6.28-rc1~99^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ba1d28181c586deec468cc6ae558c0c099f1b956;p=linux-2.6-omap-h63xx.git serial: sh-sci: Add support SCIF of SH7723 SH7723 has two types of SCIF (SCIF and SCIFA). The current sh-sci driver supports only SCIFA, and calculation methods of SCBRR are different. This patch support this methods. Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Paul Mundt --- diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index 511c10d4218..7cd28b22680 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h @@ -789,7 +789,14 @@ static inline int sci_rxd_in(struct uart_port *port) defined(CONFIG_CPU_SUBTYPE_SH7721) #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) #elif defined(CONFIG_CPU_SUBTYPE_SH7723) -#define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(16*bps)-1) +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; + else + return ((clk*2)+16*bps)/(16*bps)-1; +} +#define SCBRR_VALUE(bps, clk) scbrr_calc(port, bps, clk) #elif defined(__H8300H__) || defined(__H8300S__) #define SCBRR_VALUE(bps, clk) (((clk*1000/32)/bps)-1) #else /* Generic SH */