diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-12-06 04:59:51 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-12-24 07:50:54 -0500 |
commit | 878fbb91399df0d37e0183890b0ad6aeb63590fe (patch) | |
tree | bfcc19ea0ae9c5535fed83721e22105aacb88709 | |
parent | 20f4e334272dc191e475039d68a3bf3eb46ec66e (diff) |
serial: sh-sci: Remove platform data scbrr_algo_id field
The field isn't set by any board, remote it.
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>
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 26 | ||||
-rw-r--r-- | include/linux/serial_sci.h | 10 |
2 files changed, 5 insertions, 31 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index e4bf0e435af6..96d26d7f8031 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -1757,17 +1757,6 @@ static unsigned int sci_scbrr_calc(struct sci_port *s, unsigned int bps, | |||
1757 | if (s->sampling_rate) | 1757 | if (s->sampling_rate) |
1758 | return DIV_ROUND_CLOSEST(freq, s->sampling_rate * bps) - 1; | 1758 | return DIV_ROUND_CLOSEST(freq, s->sampling_rate * bps) - 1; |
1759 | 1759 | ||
1760 | switch (s->cfg->scbrr_algo_id) { | ||
1761 | case SCBRR_ALGO_1: | ||
1762 | return freq / (16 * bps); | ||
1763 | case SCBRR_ALGO_2: | ||
1764 | return DIV_ROUND_CLOSEST(freq, 32 * bps) - 1; | ||
1765 | case SCBRR_ALGO_3: | ||
1766 | return freq / (8 * bps); | ||
1767 | case SCBRR_ALGO_4: | ||
1768 | return DIV_ROUND_CLOSEST(freq, 16 * bps) - 1; | ||
1769 | } | ||
1770 | |||
1771 | /* Warn, but use a safe default */ | 1760 | /* Warn, but use a safe default */ |
1772 | WARN_ON(1); | 1761 | WARN_ON(1); |
1773 | 1762 | ||
@@ -2176,17 +2165,12 @@ static int sci_init_single(struct platform_device *dev, | |||
2176 | break; | 2165 | break; |
2177 | } | 2166 | } |
2178 | 2167 | ||
2179 | /* Set the sampling rate if the baud rate calculation algorithm isn't | 2168 | /* SCIFA on sh7723 and sh7724 need a custom sampling rate that doesn't |
2180 | * specified. | 2169 | * match the SoC datasheet, this should be investigated. Let platform |
2170 | * data override the sampling rate for now. | ||
2181 | */ | 2171 | */ |
2182 | if (p->scbrr_algo_id == SCBRR_ALGO_NONE) { | 2172 | sci_port->sampling_rate = p->sampling_rate ? p->sampling_rate |
2183 | /* SCIFA on sh7723 and sh7724 need a custom sampling rate that | 2173 | : sampling_rate; |
2184 | * doesn't match the SoC datasheet, this should be investigated. | ||
2185 | * Let platform data override the sampling rate for now. | ||
2186 | */ | ||
2187 | sci_port->sampling_rate = p->sampling_rate ? p->sampling_rate | ||
2188 | : sampling_rate; | ||
2189 | } | ||
2190 | 2174 | ||
2191 | if (!early) { | 2175 | if (!early) { |
2192 | sci_port->iclk = clk_get(&dev->dev, "sci_ick"); | 2176 | sci_port->iclk = clk_get(&dev->dev, "sci_ick"); |
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index af414e1895a5..fd7f9daa92cc 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -10,15 +10,6 @@ | |||
10 | 10 | ||
11 | #define SCIx_NOT_SUPPORTED (-1) | 11 | #define SCIx_NOT_SUPPORTED (-1) |
12 | 12 | ||
13 | enum { | ||
14 | SCBRR_ALGO_NONE, /* Compute sampling rate in the driver */ | ||
15 | SCBRR_ALGO_1, /* clk / (16 * bps) */ | ||
16 | SCBRR_ALGO_2, /* DIV_ROUND_CLOSEST(clk, 32 * bps) - 1 */ | ||
17 | SCBRR_ALGO_3, /* clk / (8 * bps) */ | ||
18 | SCBRR_ALGO_4, /* DIV_ROUND_CLOSEST(clk, 16 * bps) - 1 */ | ||
19 | SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */ | ||
20 | }; | ||
21 | |||
22 | #define SCSCR_TIE (1 << 7) | 13 | #define SCSCR_TIE (1 << 7) |
23 | #define SCSCR_RIE (1 << 6) | 14 | #define SCSCR_RIE (1 << 6) |
24 | #define SCSCR_TE (1 << 5) | 15 | #define SCSCR_TE (1 << 5) |
@@ -136,7 +127,6 @@ struct plat_sci_port { | |||
136 | unsigned long capabilities; /* Port features/capabilities */ | 127 | unsigned long capabilities; /* Port features/capabilities */ |
137 | 128 | ||
138 | unsigned int sampling_rate; | 129 | unsigned int sampling_rate; |
139 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ | ||
140 | unsigned int scscr; /* SCSCR initialization */ | 130 | unsigned int scscr; /* SCSCR initialization */ |
141 | 131 | ||
142 | /* | 132 | /* |