diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-06-24 05:23:52 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-06-24 05:23:52 -0400 |
commit | 26c92f3728d738aaa7e4859d5581323cd68096dd (patch) | |
tree | b7cc2f49a6ffe6a6b88d19b33547a370ae314de6 /include/linux/serial_sci.h | |
parent | 00b9de9c249f51f09c19aa41cbbb3e3eb4eea807 (diff) |
serial: sh-sci: Move SCBRR calculation algo in to platform data.
This permits each port to select its own SCBRR calculation algorithm,
rather than having it all ifdef'ed in the header. There are presently
only 5 different variations that all parts fall under.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/linux/serial_sci.h')
-rw-r--r-- | include/linux/serial_sci.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index f722a2275add..ff856b5bd276 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -7,6 +7,14 @@ | |||
7 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) | 7 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) |
8 | */ | 8 | */ |
9 | 9 | ||
10 | enum { | ||
11 | SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ | ||
12 | SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ | ||
13 | SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ | ||
14 | SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ | ||
15 | SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ | ||
16 | }; | ||
17 | |||
10 | #define SCSCR_TIE (1 << 7) | 18 | #define SCSCR_TIE (1 << 7) |
11 | #define SCSCR_RIE (1 << 6) | 19 | #define SCSCR_RIE (1 << 6) |
12 | #define SCSCR_TE (1 << 5) | 20 | #define SCSCR_TE (1 << 5) |
@@ -36,6 +44,7 @@ struct plat_sci_port { | |||
36 | upf_t flags; /* UPF_* flags */ | 44 | upf_t flags; /* UPF_* flags */ |
37 | char *clk; /* clock string */ | 45 | char *clk; /* clock string */ |
38 | 46 | ||
47 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ | ||
39 | unsigned int scscr; /* SCSCR initialization */ | 48 | unsigned int scscr; /* SCSCR initialization */ |
40 | }; | 49 | }; |
41 | 50 | ||