From ec09c5eb491834d4011c72538e58d8b7096076bd Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 6 Dec 2013 10:59:20 +0100 Subject: serial: sh-sci: Rework baud rate calculation Computing the baud rate register value requires knowledge of the hardware sampling rate. This information is currently encoded in a baud rate calculation algorithm ID passed through platform data. However, it can be derived from the port type directly in most cases. Compute the sampling rate internally in the driver if the baud rate calculation algorithm ID isn't specified, and allow platforms to override the sampling rate through platform data in special cases (this is only required for SCIFA ports on sh7723 and sh7724, the reason needs to be investigated). Signed-off-by: Laurent Pinchart Acked-by: Greg Kroah-Hartman Signed-off-by: Simon Horman --- include/linux/serial_sci.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux/serial_sci.h') diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index e9c3021..af414e1 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h @@ -11,6 +11,7 @@ #define SCIx_NOT_SUPPORTED (-1) enum { + SCBRR_ALGO_NONE, /* Compute sampling rate in the driver */ SCBRR_ALGO_1, /* clk / (16 * bps) */ SCBRR_ALGO_2, /* DIV_ROUND_CLOSEST(clk, 32 * bps) - 1 */ SCBRR_ALGO_3, /* clk / (8 * bps) */ @@ -134,6 +135,7 @@ struct plat_sci_port { upf_t flags; /* UPF_* flags */ unsigned long capabilities; /* Port features/capabilities */ + unsigned int sampling_rate; unsigned int scbrr_algo_id; /* SCBRR calculation algo */ unsigned int scscr; /* SCSCR initialization */ -- cgit v1.1