From 6557b1f69ea0961efde7ab33bfe0cb7e3bfed54e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 6 Dec 2013 10:59:12 +0100 Subject: serial: sh-sci: Simplify baud rate calculation algorithms Rewrite the baud rate register value calculations in easier to read forms. The computed value isn't modified. Signed-off-by: Laurent Pinchart Acked-by: Greg Kroah-Hartman Signed-off-by: Simon Horman --- include/linux/serial_sci.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/linux/serial_sci.h') diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index babc5fe070b9..12cf50c1c047 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h @@ -11,10 +11,10 @@ #define SCIx_NOT_SUPPORTED (-1) enum { - SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ - SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ - SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ - SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ + SCBRR_ALGO_1, /* clk / (16 * bps) */ + SCBRR_ALGO_2, /* DIV_ROUND_CLOSEST(clk, 32 * bps) - 1 */ + SCBRR_ALGO_3, /* clk / (8 * bps) */ + SCBRR_ALGO_4, /* DIV_ROUND_CLOSEST(clk, 16 * bps) - 1 */ SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */ }; -- cgit v1.2.3-59-g8ed1b