diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/sh-sci.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index 511c10d42187..7cd28b226800 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) | |||
789 | defined(CONFIG_CPU_SUBTYPE_SH7721) | 789 | defined(CONFIG_CPU_SUBTYPE_SH7721) |
790 | #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) | 790 | #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) |
791 | #elif defined(CONFIG_CPU_SUBTYPE_SH7723) | 791 | #elif defined(CONFIG_CPU_SUBTYPE_SH7723) |
792 | #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(16*bps)-1) | 792 | static inline int scbrr_calc(struct uart_port *port, int bps, int clk) |
793 | { | ||
794 | if (port->type == PORT_SCIF) | ||
795 | return (clk+16*bps)/(32*bps)-1; | ||
796 | else | ||
797 | return ((clk*2)+16*bps)/(16*bps)-1; | ||
798 | } | ||
799 | #define SCBRR_VALUE(bps, clk) scbrr_calc(port, bps, clk) | ||
793 | #elif defined(__H8300H__) || defined(__H8300S__) | 800 | #elif defined(__H8300H__) || defined(__H8300S__) |
794 | #define SCBRR_VALUE(bps, clk) (((clk*1000/32)/bps)-1) | 801 | #define SCBRR_VALUE(bps, clk) (((clk*1000/32)/bps)-1) |
795 | #else /* Generic SH */ | 802 | #else /* Generic SH */ |