diff options
| -rw-r--r-- | drivers/tty/serial/sh-sci.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 99a64fd16d46..d5239d5ff98b 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
| @@ -2133,30 +2133,38 @@ static int sci_init_single(struct platform_device *dev, | |||
| 2133 | sci_port->irqs[i] = p->irqs[i] ? p->irqs[i] : -ENXIO; | 2133 | sci_port->irqs[i] = p->irqs[i] ? p->irqs[i] : -ENXIO; |
| 2134 | } | 2134 | } |
| 2135 | 2135 | ||
| 2136 | if (p->regtype == SCIx_PROBE_REGTYPE) { | ||
| 2137 | ret = sci_probe_regmap(p); | ||
| 2138 | if (unlikely(ret)) | ||
| 2139 | return ret; | ||
| 2140 | } | ||
| 2141 | |||
| 2136 | switch (p->type) { | 2142 | switch (p->type) { |
| 2137 | case PORT_SCIFB: | 2143 | case PORT_SCIFB: |
| 2138 | port->fifosize = 256; | 2144 | port->fifosize = 256; |
| 2145 | sci_port->overrun_bit = 9; | ||
| 2139 | break; | 2146 | break; |
| 2140 | case PORT_HSCIF: | 2147 | case PORT_HSCIF: |
| 2141 | port->fifosize = 128; | 2148 | port->fifosize = 128; |
| 2149 | sci_port->overrun_bit = 0; | ||
| 2142 | break; | 2150 | break; |
| 2143 | case PORT_SCIFA: | 2151 | case PORT_SCIFA: |
| 2144 | port->fifosize = 64; | 2152 | port->fifosize = 64; |
| 2153 | sci_port->overrun_bit = 9; | ||
| 2145 | break; | 2154 | break; |
| 2146 | case PORT_SCIF: | 2155 | case PORT_SCIF: |
| 2147 | port->fifosize = 16; | 2156 | port->fifosize = 16; |
| 2157 | if (p->regtype == SCIx_SH7705_SCIF_REGTYPE) | ||
| 2158 | sci_port->overrun_bit = 9; | ||
| 2159 | else | ||
| 2160 | sci_port->overrun_bit = 0; | ||
| 2148 | break; | 2161 | break; |
| 2149 | default: | 2162 | default: |
| 2150 | port->fifosize = 1; | 2163 | port->fifosize = 1; |
| 2164 | sci_port->overrun_bit = 5; | ||
| 2151 | break; | 2165 | break; |
| 2152 | } | 2166 | } |
| 2153 | 2167 | ||
| 2154 | if (p->regtype == SCIx_PROBE_REGTYPE) { | ||
| 2155 | ret = sci_probe_regmap(p); | ||
| 2156 | if (unlikely(ret)) | ||
| 2157 | return ret; | ||
| 2158 | } | ||
| 2159 | |||
| 2160 | if (!early) { | 2168 | if (!early) { |
| 2161 | sci_port->iclk = clk_get(&dev->dev, "sci_ick"); | 2169 | sci_port->iclk = clk_get(&dev->dev, "sci_ick"); |
| 2162 | if (IS_ERR(sci_port->iclk)) { | 2170 | if (IS_ERR(sci_port->iclk)) { |
| @@ -2194,12 +2202,6 @@ static int sci_init_single(struct platform_device *dev, | |||
| 2194 | * Establish sensible defaults for the overrun detection, unless | 2202 | * Establish sensible defaults for the overrun detection, unless |
| 2195 | * the part has explicitly disabled support for it. | 2203 | * the part has explicitly disabled support for it. |
| 2196 | */ | 2204 | */ |
| 2197 | if (p->type == PORT_SCI) | ||
| 2198 | sci_port->overrun_bit = 5; | ||
| 2199 | else if (p->scbrr_algo_id == SCBRR_ALGO_4) | ||
| 2200 | sci_port->overrun_bit = 9; | ||
| 2201 | else | ||
| 2202 | sci_port->overrun_bit = 0; | ||
| 2203 | 2205 | ||
| 2204 | /* | 2206 | /* |
| 2205 | * Make the error mask inclusive of overrun detection, if | 2207 | * Make the error mask inclusive of overrun detection, if |
