aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2014-01-02 13:33:15 -0500
committerOlof Johansson <olof@lixom.net>2014-01-02 13:33:15 -0500
commit615e303e241cafa2ecf6452183532c2aff607920 (patch)
tree2baa5731ddc81d8aeb3ef7aa95e5e8274e7fb189 /include/linux
parent5aa88ce1137ca46164cc05dca3d7ee75ddee93d8 (diff)
parentec09c5eb491834d4011c72538e58d8b7096076bd (diff)
Merge tag 'renesas-sh-sci2-for-v3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/cleanup
From Simon Horman: Second Round of Renesas SH SCI updates for v3.14 * Rework baud rate calculation * Compute overrun_bit without using baud rate algo * Remove unused GPIO request code * Move overrun_bit and error_mask fields out of pdata * Support resources passed through platform resources * Don't check IRQ in verify port operation * Set the UPF_FIXED_PORT flag * Remove duplicate interrupt check in verify port op * Simplify baud rate calculation algorithms * Remove baud rate calculation algorithm 5 * Sort headers alphabetically * tag 'renesas-sh-sci2-for-v3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: serial: sh-sci: Rework baud rate calculation serial: sh-sci: Compute overrun_bit without using baud rate algo serial: sh-sci: Remove unused GPIO request code serial: sh-sci: Move overrun_bit and error_mask fields out of pdata serial: sh-sci: Support resources passed through platform resources serial: sh-sci: Don't check IRQ in verify port operation serial: sh-sci: Set the UPF_FIXED_PORT flag serial: sh-sci: Remove duplicate interrupt check in verify port op serial: sh-sci: Simplify baud rate calculation algorithms serial: sh-sci: Remove baud rate calculation algorithm 5 serial: sh-sci: Sort headers alphabetically Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/serial_sci.h34
1 files changed, 10 insertions, 24 deletions
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index 50fe651da965..af414e1895a5 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -11,11 +11,11 @@
11#define SCIx_NOT_SUPPORTED (-1) 11#define SCIx_NOT_SUPPORTED (-1)
12 12
13enum { 13enum {
14 SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ 14 SCBRR_ALGO_NONE, /* Compute sampling rate in the driver */
15 SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ 15 SCBRR_ALGO_1, /* clk / (16 * bps) */
16 SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ 16 SCBRR_ALGO_2, /* DIV_ROUND_CLOSEST(clk, 32 * bps) - 1 */
17 SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ 17 SCBRR_ALGO_3, /* clk / (8 * bps) */
18 SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ 18 SCBRR_ALGO_4, /* DIV_ROUND_CLOSEST(clk, 16 * bps) - 1 */
19 SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */ 19 SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */
20}; 20};
21 21
@@ -70,17 +70,6 @@ enum {
70 SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */ 70 SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
71}; 71};
72 72
73/* Offsets into the sci_port->gpios array */
74enum {
75 SCIx_SCK,
76 SCIx_RXD,
77 SCIx_TXD,
78 SCIx_CTS,
79 SCIx_RTS,
80
81 SCIx_NR_FNS,
82};
83
84enum { 73enum {
85 SCIx_PROBE_REGTYPE, 74 SCIx_PROBE_REGTYPE,
86 75
@@ -108,10 +97,10 @@ enum {
108} 97}
109 98
110#define SCIx_IRQ_IS_MUXED(port) \ 99#define SCIx_IRQ_IS_MUXED(port) \
111 ((port)->cfg->irqs[SCIx_ERI_IRQ] == \ 100 ((port)->irqs[SCIx_ERI_IRQ] == \
112 (port)->cfg->irqs[SCIx_RXI_IRQ]) || \ 101 (port)->irqs[SCIx_RXI_IRQ]) || \
113 ((port)->cfg->irqs[SCIx_ERI_IRQ] && \ 102 ((port)->irqs[SCIx_ERI_IRQ] && \
114 !(port)->cfg->irqs[SCIx_RXI_IRQ]) 103 ((port)->irqs[SCIx_RXI_IRQ] < 0))
115/* 104/*
116 * SCI register subset common for all port types. 105 * SCI register subset common for all port types.
117 * Not all registers will exist on all parts. 106 * Not all registers will exist on all parts.
@@ -142,20 +131,17 @@ struct plat_sci_port_ops {
142struct plat_sci_port { 131struct plat_sci_port {
143 unsigned long mapbase; /* resource base */ 132 unsigned long mapbase; /* resource base */
144 unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ 133 unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */
145 unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */
146 unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ 134 unsigned int type; /* SCI / SCIF / IRDA / HSCIF */
147 upf_t flags; /* UPF_* flags */ 135 upf_t flags; /* UPF_* flags */
148 unsigned long capabilities; /* Port features/capabilities */ 136 unsigned long capabilities; /* Port features/capabilities */
149 137
138 unsigned int sampling_rate;
150 unsigned int scbrr_algo_id; /* SCBRR calculation algo */ 139 unsigned int scbrr_algo_id; /* SCBRR calculation algo */
151 unsigned int scscr; /* SCSCR initialization */ 140 unsigned int scscr; /* SCSCR initialization */
152 141
153 /* 142 /*
154 * Platform overrides if necessary, defaults otherwise. 143 * Platform overrides if necessary, defaults otherwise.
155 */ 144 */
156 int overrun_bit;
157 unsigned int error_mask;
158
159 int port_reg; 145 int port_reg;
160 unsigned char regshift; 146 unsigned char regshift;
161 unsigned char regtype; 147 unsigned char regtype;