aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-06-27 06:40:44 -0400
committerDave Airlie <airlied@redhat.com>2013-06-27 06:40:44 -0400
commit4300a0f8bdcce5a03b88bfa16fc9827e15c52dc4 (patch)
treedea0276d7d0a12147f04ddbef9121e32e903c5ca /drivers/tty
parent160954b7bca43da7cd3cfbce310e6df919a8216e (diff)
parent9e895ace5d82df8929b16f58e9f515f6d54ab82d (diff)
Merge tag 'v3.10-rc7' into drm-next
Linux 3.10-rc7 The sdvo lvds fix in this -fixes pull commit c3456fb3e4712d0448592af3c5d644c9472cd3c1 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Mon Jun 10 09:47:58 2013 +0200 drm/i915: prefer VBT modes for SVDO-LVDS over EDID has a silent functional conflict with commit 990256aec2f10800595dddf4d1c3441fcd6b2616 Author: Ville Syrjälä <ville.syrjala@linux.intel.com> Date: Fri May 31 12:17:07 2013 +0000 drm: Add probed modes in probe order in drm-next. W simply need to add the vbt modes before edid modes, i.e. the other way round than now. Conflicts: drivers/gpu/drm/drm_prime.c drivers/gpu/drm/i915/intel_sdvo.c
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/pty.c13
-rw-r--r--drivers/tty/serial/8250/8250_core.c14
-rw-r--r--drivers/tty/serial/8250/8250_gsc.c10
-rw-r--r--drivers/tty/serial/imx.c2
-rw-r--r--drivers/tty/serial/omap-serial.c23
-rw-r--r--drivers/tty/serial/samsung.c13
-rw-r--r--drivers/tty/vt/vt_ioctl.c5
7 files changed, 37 insertions, 43 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 59bfaecc4e14..abfd99089781 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -244,14 +244,9 @@ static void pty_flush_buffer(struct tty_struct *tty)
244 244
245static int pty_open(struct tty_struct *tty, struct file *filp) 245static int pty_open(struct tty_struct *tty, struct file *filp)
246{ 246{
247 int retval = -ENODEV;
248
249 if (!tty || !tty->link) 247 if (!tty || !tty->link)
250 goto out; 248 return -ENODEV;
251
252 set_bit(TTY_IO_ERROR, &tty->flags);
253 249
254 retval = -EIO;
255 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) 250 if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
256 goto out; 251 goto out;
257 if (test_bit(TTY_PTY_LOCK, &tty->link->flags)) 252 if (test_bit(TTY_PTY_LOCK, &tty->link->flags))
@@ -262,9 +257,11 @@ static int pty_open(struct tty_struct *tty, struct file *filp)
262 clear_bit(TTY_IO_ERROR, &tty->flags); 257 clear_bit(TTY_IO_ERROR, &tty->flags);
263 clear_bit(TTY_OTHER_CLOSED, &tty->link->flags); 258 clear_bit(TTY_OTHER_CLOSED, &tty->link->flags);
264 set_bit(TTY_THROTTLED, &tty->flags); 259 set_bit(TTY_THROTTLED, &tty->flags);
265 retval = 0; 260 return 0;
261
266out: 262out:
267 return retval; 263 set_bit(TTY_IO_ERROR, &tty->flags);
264 return -EIO;
268} 265}
269 266
270static void pty_set_termios(struct tty_struct *tty, 267static void pty_set_termios(struct tty_struct *tty,
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 46528d57be72..86c00b1c5583 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -2755,7 +2755,7 @@ static void __init serial8250_isa_init_ports(void)
2755 if (nr_uarts > UART_NR) 2755 if (nr_uarts > UART_NR)
2756 nr_uarts = UART_NR; 2756 nr_uarts = UART_NR;
2757 2757
2758 for (i = 0; i < UART_NR; i++) { 2758 for (i = 0; i < nr_uarts; i++) {
2759 struct uart_8250_port *up = &serial8250_ports[i]; 2759 struct uart_8250_port *up = &serial8250_ports[i];
2760 struct uart_port *port = &up->port; 2760 struct uart_port *port = &up->port;
2761 2761
@@ -2916,7 +2916,7 @@ static int __init serial8250_console_setup(struct console *co, char *options)
2916 * if so, search for the first available port that does have 2916 * if so, search for the first available port that does have
2917 * console support. 2917 * console support.
2918 */ 2918 */
2919 if (co->index >= UART_NR) 2919 if (co->index >= nr_uarts)
2920 co->index = 0; 2920 co->index = 0;
2921 port = &serial8250_ports[co->index].port; 2921 port = &serial8250_ports[co->index].port;
2922 if (!port->iobase && !port->membase) 2922 if (!port->iobase && !port->membase)
@@ -2957,7 +2957,7 @@ int serial8250_find_port(struct uart_port *p)
2957 int line; 2957 int line;
2958 struct uart_port *port; 2958 struct uart_port *port;
2959 2959
2960 for (line = 0; line < UART_NR; line++) { 2960 for (line = 0; line < nr_uarts; line++) {
2961 port = &serial8250_ports[line].port; 2961 port = &serial8250_ports[line].port;
2962 if (uart_match_port(p, port)) 2962 if (uart_match_port(p, port))
2963 return line; 2963 return line;
@@ -3110,7 +3110,7 @@ static int serial8250_remove(struct platform_device *dev)
3110{ 3110{
3111 int i; 3111 int i;
3112 3112
3113 for (i = 0; i < UART_NR; i++) { 3113 for (i = 0; i < nr_uarts; i++) {
3114 struct uart_8250_port *up = &serial8250_ports[i]; 3114 struct uart_8250_port *up = &serial8250_ports[i];
3115 3115
3116 if (up->port.dev == &dev->dev) 3116 if (up->port.dev == &dev->dev)
@@ -3178,7 +3178,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
3178 /* 3178 /*
3179 * First, find a port entry which matches. 3179 * First, find a port entry which matches.
3180 */ 3180 */
3181 for (i = 0; i < UART_NR; i++) 3181 for (i = 0; i < nr_uarts; i++)
3182 if (uart_match_port(&serial8250_ports[i].port, port)) 3182 if (uart_match_port(&serial8250_ports[i].port, port))
3183 return &serial8250_ports[i]; 3183 return &serial8250_ports[i];
3184 3184
@@ -3187,7 +3187,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
3187 * free entry. We look for one which hasn't been previously 3187 * free entry. We look for one which hasn't been previously
3188 * used (indicated by zero iobase). 3188 * used (indicated by zero iobase).
3189 */ 3189 */
3190 for (i = 0; i < UART_NR; i++) 3190 for (i = 0; i < nr_uarts; i++)
3191 if (serial8250_ports[i].port.type == PORT_UNKNOWN && 3191 if (serial8250_ports[i].port.type == PORT_UNKNOWN &&
3192 serial8250_ports[i].port.iobase == 0) 3192 serial8250_ports[i].port.iobase == 0)
3193 return &serial8250_ports[i]; 3193 return &serial8250_ports[i];
@@ -3196,7 +3196,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
3196 * That also failed. Last resort is to find any entry which 3196 * That also failed. Last resort is to find any entry which
3197 * doesn't have a real port associated with it. 3197 * doesn't have a real port associated with it.
3198 */ 3198 */
3199 for (i = 0; i < UART_NR; i++) 3199 for (i = 0; i < nr_uarts; i++)
3200 if (serial8250_ports[i].port.type == PORT_UNKNOWN) 3200 if (serial8250_ports[i].port.type == PORT_UNKNOWN)
3201 return &serial8250_ports[i]; 3201 return &serial8250_ports[i];
3202 3202
diff --git a/drivers/tty/serial/8250/8250_gsc.c b/drivers/tty/serial/8250/8250_gsc.c
index 097dff9c08ad..bb91b4713ebd 100644
--- a/drivers/tty/serial/8250/8250_gsc.c
+++ b/drivers/tty/serial/8250/8250_gsc.c
@@ -30,6 +30,12 @@ static int __init serial_init_chip(struct parisc_device *dev)
30 unsigned long address; 30 unsigned long address;
31 int err; 31 int err;
32 32
33#ifdef CONFIG_64BIT
34 extern int iosapic_serial_irq(int cellnum);
35 if (!dev->irq && (dev->id.sversion == 0xad))
36 dev->irq = iosapic_serial_irq(dev->mod_index-1);
37#endif
38
33 if (!dev->irq) { 39 if (!dev->irq) {
34 /* We find some unattached serial ports by walking native 40 /* We find some unattached serial ports by walking native
35 * busses. These should be silently ignored. Otherwise, 41 * busses. These should be silently ignored. Otherwise,
@@ -51,7 +57,8 @@ static int __init serial_init_chip(struct parisc_device *dev)
51 memset(&uart, 0, sizeof(uart)); 57 memset(&uart, 0, sizeof(uart));
52 uart.port.iotype = UPIO_MEM; 58 uart.port.iotype = UPIO_MEM;
53 /* 7.272727MHz on Lasi. Assumed the same for Dino, Wax and Timi. */ 59 /* 7.272727MHz on Lasi. Assumed the same for Dino, Wax and Timi. */
54 uart.port.uartclk = 7272727; 60 uart.port.uartclk = (dev->id.sversion != 0xad) ?
61 7272727 : 1843200;
55 uart.port.mapbase = address; 62 uart.port.mapbase = address;
56 uart.port.membase = ioremap_nocache(address, 16); 63 uart.port.membase = ioremap_nocache(address, 16);
57 uart.port.irq = dev->irq; 64 uart.port.irq = dev->irq;
@@ -73,6 +80,7 @@ static struct parisc_device_id serial_tbl[] = {
73 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00075 }, 80 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00075 },
74 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008c }, 81 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008c },
75 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008d }, 82 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x0008d },
83 { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x000ad },
76 { 0 } 84 { 0 }
77}; 85};
78 86
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 147c9e193595..8cdfbd365892 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -761,6 +761,8 @@ static int imx_startup(struct uart_port *port)
761 761
762 temp = readl(sport->port.membase + UCR2); 762 temp = readl(sport->port.membase + UCR2);
763 temp |= (UCR2_RXEN | UCR2_TXEN); 763 temp |= (UCR2_RXEN | UCR2_TXEN);
764 if (!sport->have_rtscts)
765 temp |= UCR2_IRTS;
764 writel(temp, sport->port.membase + UCR2); 766 writel(temp, sport->port.membase + UCR2);
765 767
766 if (USE_IRDA(sport)) { 768 if (USE_IRDA(sport)) {
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 30d4f7a783cd..f0b9f6b52b32 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -202,26 +202,6 @@ static int serial_omap_get_context_loss_count(struct uart_omap_port *up)
202 return pdata->get_context_loss_count(up->dev); 202 return pdata->get_context_loss_count(up->dev);
203} 203}
204 204
205static void serial_omap_set_forceidle(struct uart_omap_port *up)
206{
207 struct omap_uart_port_info *pdata = up->dev->platform_data;
208
209 if (!pdata || !pdata->set_forceidle)
210 return;
211
212 pdata->set_forceidle(up->dev);
213}
214
215static void serial_omap_set_noidle(struct uart_omap_port *up)
216{
217 struct omap_uart_port_info *pdata = up->dev->platform_data;
218
219 if (!pdata || !pdata->set_noidle)
220 return;
221
222 pdata->set_noidle(up->dev);
223}
224
225static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable) 205static void serial_omap_enable_wakeup(struct uart_omap_port *up, bool enable)
226{ 206{
227 struct omap_uart_port_info *pdata = up->dev->platform_data; 207 struct omap_uart_port_info *pdata = up->dev->platform_data;
@@ -298,8 +278,6 @@ static void serial_omap_stop_tx(struct uart_port *port)
298 serial_out(up, UART_IER, up->ier); 278 serial_out(up, UART_IER, up->ier);
299 } 279 }
300 280
301 serial_omap_set_forceidle(up);
302
303 pm_runtime_mark_last_busy(up->dev); 281 pm_runtime_mark_last_busy(up->dev);
304 pm_runtime_put_autosuspend(up->dev); 282 pm_runtime_put_autosuspend(up->dev);
305} 283}
@@ -364,7 +342,6 @@ static void serial_omap_start_tx(struct uart_port *port)
364 342
365 pm_runtime_get_sync(up->dev); 343 pm_runtime_get_sync(up->dev);
366 serial_omap_enable_ier_thri(up); 344 serial_omap_enable_ier_thri(up);
367 serial_omap_set_noidle(up);
368 pm_runtime_mark_last_busy(up->dev); 345 pm_runtime_mark_last_busy(up->dev);
369 pm_runtime_put_autosuspend(up->dev); 346 pm_runtime_put_autosuspend(up->dev);
370} 347}
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index 89429410a245..0c8a9fa2be6c 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1166,6 +1166,18 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
1166 ourport->tx_irq = ret; 1166 ourport->tx_irq = ret;
1167 1167
1168 ourport->clk = clk_get(&platdev->dev, "uart"); 1168 ourport->clk = clk_get(&platdev->dev, "uart");
1169 if (IS_ERR(ourport->clk)) {
1170 pr_err("%s: Controller clock not found\n",
1171 dev_name(&platdev->dev));
1172 return PTR_ERR(ourport->clk);
1173 }
1174
1175 ret = clk_prepare_enable(ourport->clk);
1176 if (ret) {
1177 pr_err("uart: clock failed to prepare+enable: %d\n", ret);
1178 clk_put(ourport->clk);
1179 return ret;
1180 }
1169 1181
1170 /* Keep all interrupts masked and cleared */ 1182 /* Keep all interrupts masked and cleared */
1171 if (s3c24xx_serial_has_interrupt_mask(port)) { 1183 if (s3c24xx_serial_has_interrupt_mask(port)) {
@@ -1180,6 +1192,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
1180 1192
1181 /* reset the fifos (and setup the uart) */ 1193 /* reset the fifos (and setup the uart) */
1182 s3c24xx_serial_resetport(port, cfg); 1194 s3c24xx_serial_resetport(port, cfg);
1195 clk_disable_unprepare(ourport->clk);
1183 return 0; 1196 return 0;
1184} 1197}
1185 1198
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
index fc2c06c66e89..2bd78e2ac8ec 100644
--- a/drivers/tty/vt/vt_ioctl.c
+++ b/drivers/tty/vt/vt_ioctl.c
@@ -289,13 +289,10 @@ static int vt_disallocate(unsigned int vc_num)
289 struct vc_data *vc = NULL; 289 struct vc_data *vc = NULL;
290 int ret = 0; 290 int ret = 0;
291 291
292 if (!vc_num)
293 return 0;
294
295 console_lock(); 292 console_lock();
296 if (VT_BUSY(vc_num)) 293 if (VT_BUSY(vc_num))
297 ret = -EBUSY; 294 ret = -EBUSY;
298 else 295 else if (vc_num)
299 vc = vc_deallocate(vc_num); 296 vc = vc_deallocate(vc_num);
300 console_unlock(); 297 console_unlock();
301 298