aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2013-12-06 04:59:20 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-12-23 21:17:53 -0500
commitec09c5eb491834d4011c72538e58d8b7096076bd (patch)
treec493ee1a5617cc46fe4bbb63fcf28d5d5a9e8b3f /include/linux
parentb545e4f40613be708ad660517f10c87423a09e8d (diff)
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 <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/serial_sci.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index e9c3021a37ae..af414e1895a5 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -11,6 +11,7 @@
11#define SCIx_NOT_SUPPORTED (-1) 11#define SCIx_NOT_SUPPORTED (-1)
12 12
13enum { 13enum {
14 SCBRR_ALGO_NONE, /* Compute sampling rate in the driver */
14 SCBRR_ALGO_1, /* clk / (16 * bps) */ 15 SCBRR_ALGO_1, /* clk / (16 * bps) */
15 SCBRR_ALGO_2, /* DIV_ROUND_CLOSEST(clk, 32 * bps) - 1 */ 16 SCBRR_ALGO_2, /* DIV_ROUND_CLOSEST(clk, 32 * bps) - 1 */
16 SCBRR_ALGO_3, /* clk / (8 * bps) */ 17 SCBRR_ALGO_3, /* clk / (8 * bps) */
@@ -134,6 +135,7 @@ struct plat_sci_port {
134 upf_t flags; /* UPF_* flags */ 135 upf_t flags; /* UPF_* flags */
135 unsigned long capabilities; /* Port features/capabilities */ 136 unsigned long capabilities; /* Port features/capabilities */
136 137
138 unsigned int sampling_rate;
137 unsigned int scbrr_algo_id; /* SCBRR calculation algo */ 139 unsigned int scbrr_algo_id; /* SCBRR calculation algo */
138 unsigned int scscr; /* SCSCR initialization */ 140 unsigned int scscr; /* SCSCR initialization */
139 141