diff options
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 67 | ||||
-rw-r--r-- | include/linux/serial_sci.h | 12 |
2 files changed, 0 insertions, 79 deletions
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 98b8e3c98586..99a64fd16d46 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/dma-mapping.h> | 32 | #include <linux/dma-mapping.h> |
33 | #include <linux/err.h> | 33 | #include <linux/err.h> |
34 | #include <linux/errno.h> | 34 | #include <linux/errno.h> |
35 | #include <linux/gpio.h> | ||
36 | #include <linux/init.h> | 35 | #include <linux/init.h> |
37 | #include <linux/interrupt.h> | 36 | #include <linux/interrupt.h> |
38 | #include <linux/ioport.h> | 37 | #include <linux/ioport.h> |
@@ -79,7 +78,6 @@ struct sci_port { | |||
79 | 78 | ||
80 | int irqs[SCIx_NR_IRQS]; | 79 | int irqs[SCIx_NR_IRQS]; |
81 | char *irqstr[SCIx_NR_IRQS]; | 80 | char *irqstr[SCIx_NR_IRQS]; |
82 | char *gpiostr[SCIx_NR_FNS]; | ||
83 | 81 | ||
84 | struct dma_chan *chan_tx; | 82 | struct dma_chan *chan_tx; |
85 | struct dma_chan *chan_rx; | 83 | struct dma_chan *chan_rx; |
@@ -1153,67 +1151,6 @@ static void sci_free_irq(struct sci_port *port) | |||
1153 | } | 1151 | } |
1154 | } | 1152 | } |
1155 | 1153 | ||
1156 | static const char *sci_gpio_names[SCIx_NR_FNS] = { | ||
1157 | "sck", "rxd", "txd", "cts", "rts", | ||
1158 | }; | ||
1159 | |||
1160 | static const char *sci_gpio_str(unsigned int index) | ||
1161 | { | ||
1162 | return sci_gpio_names[index]; | ||
1163 | } | ||
1164 | |||
1165 | static void sci_init_gpios(struct sci_port *port) | ||
1166 | { | ||
1167 | struct uart_port *up = &port->port; | ||
1168 | int i; | ||
1169 | |||
1170 | if (!port->cfg) | ||
1171 | return; | ||
1172 | |||
1173 | for (i = 0; i < SCIx_NR_FNS; i++) { | ||
1174 | const char *desc; | ||
1175 | int ret; | ||
1176 | |||
1177 | if (!port->cfg->gpios[i]) | ||
1178 | continue; | ||
1179 | |||
1180 | desc = sci_gpio_str(i); | ||
1181 | |||
1182 | port->gpiostr[i] = kasprintf(GFP_KERNEL, "%s:%s", | ||
1183 | dev_name(up->dev), desc); | ||
1184 | |||
1185 | /* | ||
1186 | * If we've failed the allocation, we can still continue | ||
1187 | * on with a NULL string. | ||
1188 | */ | ||
1189 | if (!port->gpiostr[i]) | ||
1190 | dev_notice(up->dev, "%s string allocation failure\n", | ||
1191 | desc); | ||
1192 | |||
1193 | ret = gpio_request(port->cfg->gpios[i], port->gpiostr[i]); | ||
1194 | if (unlikely(ret != 0)) { | ||
1195 | dev_notice(up->dev, "failed %s gpio request\n", desc); | ||
1196 | |||
1197 | /* | ||
1198 | * If we can't get the GPIO for whatever reason, | ||
1199 | * no point in keeping the verbose string around. | ||
1200 | */ | ||
1201 | kfree(port->gpiostr[i]); | ||
1202 | } | ||
1203 | } | ||
1204 | } | ||
1205 | |||
1206 | static void sci_free_gpios(struct sci_port *port) | ||
1207 | { | ||
1208 | int i; | ||
1209 | |||
1210 | for (i = 0; i < SCIx_NR_FNS; i++) | ||
1211 | if (port->cfg->gpios[i]) { | ||
1212 | gpio_free(port->cfg->gpios[i]); | ||
1213 | kfree(port->gpiostr[i]); | ||
1214 | } | ||
1215 | } | ||
1216 | |||
1217 | static unsigned int sci_tx_empty(struct uart_port *port) | 1154 | static unsigned int sci_tx_empty(struct uart_port *port) |
1218 | { | 1155 | { |
1219 | unsigned short status = serial_port_in(port, SCxSR); | 1156 | unsigned short status = serial_port_in(port, SCxSR); |
@@ -2240,8 +2177,6 @@ static int sci_init_single(struct platform_device *dev, | |||
2240 | 2177 | ||
2241 | port->dev = &dev->dev; | 2178 | port->dev = &dev->dev; |
2242 | 2179 | ||
2243 | sci_init_gpios(sci_port); | ||
2244 | |||
2245 | pm_runtime_enable(&dev->dev); | 2180 | pm_runtime_enable(&dev->dev); |
2246 | } | 2181 | } |
2247 | 2182 | ||
@@ -2298,8 +2233,6 @@ static int sci_init_single(struct platform_device *dev, | |||
2298 | 2233 | ||
2299 | static void sci_cleanup_single(struct sci_port *port) | 2234 | static void sci_cleanup_single(struct sci_port *port) |
2300 | { | 2235 | { |
2301 | sci_free_gpios(port); | ||
2302 | |||
2303 | clk_put(port->iclk); | 2236 | clk_put(port->iclk); |
2304 | clk_put(port->fclk); | 2237 | clk_put(port->fclk); |
2305 | 2238 | ||
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h index af9834bc6771..e9c3021a37ae 100644 --- a/include/linux/serial_sci.h +++ b/include/linux/serial_sci.h | |||
@@ -69,17 +69,6 @@ enum { | |||
69 | SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */ | 69 | SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */ |
70 | }; | 70 | }; |
71 | 71 | ||
72 | /* Offsets into the sci_port->gpios array */ | ||
73 | enum { | ||
74 | SCIx_SCK, | ||
75 | SCIx_RXD, | ||
76 | SCIx_TXD, | ||
77 | SCIx_CTS, | ||
78 | SCIx_RTS, | ||
79 | |||
80 | SCIx_NR_FNS, | ||
81 | }; | ||
82 | |||
83 | enum { | 72 | enum { |
84 | SCIx_PROBE_REGTYPE, | 73 | SCIx_PROBE_REGTYPE, |
85 | 74 | ||
@@ -141,7 +130,6 @@ struct plat_sci_port_ops { | |||
141 | struct plat_sci_port { | 130 | struct plat_sci_port { |
142 | unsigned long mapbase; /* resource base */ | 131 | unsigned long mapbase; /* resource base */ |
143 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ | 132 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ |
144 | unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */ | ||
145 | unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ | 133 | unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ |
146 | upf_t flags; /* UPF_* flags */ | 134 | upf_t flags; /* UPF_* flags */ |
147 | unsigned long capabilities; /* Port features/capabilities */ | 135 | unsigned long capabilities; /* Port features/capabilities */ |