aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorChristopher Kenna <cjk@cs.unc.edu>2012-09-28 13:46:28 -0400
committerChristopher Kenna <cjk@cs.unc.edu>2012-09-28 14:50:15 -0400
commitdaa22703f14c007e93b464c45fa60019a36f546d (patch)
treea1a130b6e128dc9d57c35c026977e1b4953105e1 /drivers/tty/serial
parent5aa287dcf1b5879aa0150b0511833c52885f5b4c (diff)
Apply k4412 kernel from HardKernel for ODROID-X.
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/Kconfig4
-rw-r--r--drivers/tty/serial/s5pv210.c14
-rw-r--r--drivers/tty/serial/samsung.c16
-rw-r--r--drivers/tty/serial/samsung.h19
-rw-r--r--drivers/tty/serial/serial_core.c3
5 files changed, 21 insertions, 35 deletions
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 9789293a844..9b178ef30ae 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -537,8 +537,8 @@ config SERIAL_S3C6400
537 537
538config SERIAL_S5PV210 538config SERIAL_S5PV210
539 tristate "Samsung S5PV210 Serial port support" 539 tristate "Samsung S5PV210 Serial port support"
540 depends on SERIAL_SAMSUNG && (CPU_S5PV210 || CPU_EXYNOS4210) 540 depends on SERIAL_SAMSUNG && (CPU_S5PV210 || ARCH_EXYNOS)
541 select SERIAL_SAMSUNG_UARTS_4 if (CPU_S5PV210 || CPU_EXYNOS4210) 541 select SERIAL_SAMSUNG_UARTS_4 if (CPU_S5PV210 || ARCH_EXYNOS)
542 default y 542 default y
543 help 543 help
544 Serial port support for Samsung's S5P Family of SoC's 544 Serial port support for Samsung's S5P Family of SoC's
diff --git a/drivers/tty/serial/s5pv210.c b/drivers/tty/serial/s5pv210.c
index dd194dc80ee..ce7a0778284 100644
--- a/drivers/tty/serial/s5pv210.c
+++ b/drivers/tty/serial/s5pv210.c
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
20#include <linux/serial.h> 20#include <linux/serial.h>
21#include <linux/delay.h>
21 22
22#include <asm/irq.h> 23#include <asm/irq.h>
23#include <mach/hardware.h> 24#include <mach/hardware.h>
@@ -83,6 +84,12 @@ static int s5pv210_serial_resetport(struct uart_port *port,
83 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); 84 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH);
84 wr_regl(port, S3C2410_UFCON, cfg->ufcon); 85 wr_regl(port, S3C2410_UFCON, cfg->ufcon);
85 86
87 wr_regl(port, S3C64XX_UINTM, 0xf);
88 wr_regl(port, S3C64XX_UINTP, 0xf);
89
90 /* It is need to delay when reset FIFO register */
91 udelay(1);
92
86 return 0; 93 return 0;
87} 94}
88 95
@@ -135,13 +142,6 @@ static struct platform_driver s5p_serial_driver = {
135 }, 142 },
136}; 143};
137 144
138static int __init s5pv210_serial_console_init(void)
139{
140 return s3c24xx_serial_initconsole(&s5p_serial_driver, s5p_uart_inf);
141}
142
143console_initcall(s5pv210_serial_console_init);
144
145static int __init s5p_serial_init(void) 145static int __init s5p_serial_init(void)
146{ 146{
147 return s3c24xx_serial_init(&s5p_serial_driver, *s5p_uart_inf); 147 return s3c24xx_serial_init(&s5p_serial_driver, *s5p_uart_inf);
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index f66f6482930..ab179b867da 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -377,12 +377,14 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
377 struct s3c24xx_uart_port *ourport = to_ourport(port); 377 struct s3c24xx_uart_port *ourport = to_ourport(port);
378 378
379 if (ourport->tx_claimed) { 379 if (ourport->tx_claimed) {
380 disable_irq(ourport->tx_irq);
380 free_irq(ourport->tx_irq, ourport); 381 free_irq(ourport->tx_irq, ourport);
381 tx_enabled(port) = 0; 382 tx_enabled(port) = 0;
382 ourport->tx_claimed = 0; 383 ourport->tx_claimed = 0;
383 } 384 }
384 385
385 if (ourport->rx_claimed) { 386 if (ourport->rx_claimed) {
387 disable_irq(ourport->rx_irq);
386 free_irq(ourport->rx_irq, ourport); 388 free_irq(ourport->rx_irq, ourport);
387 ourport->rx_claimed = 0; 389 ourport->rx_claimed = 0;
388 rx_enabled(port) = 0; 390 rx_enabled(port) = 0;
@@ -608,6 +610,7 @@ static unsigned int s3c24xx_serial_getclk(struct uart_port *port,
608 unsigned int deviation = (1<<30)|((1<<30)-1); 610 unsigned int deviation = (1<<30)|((1<<30)-1);
609 int calc_deviation; 611 int calc_deviation;
610 612
613 best = res;
611 for (sptr = res; sptr < resptr; sptr++) { 614 for (sptr = res; sptr < resptr; sptr++) {
612 calc_deviation = baud - sptr->calc; 615 calc_deviation = baud - sptr->calc;
613 if (calc_deviation < 0) 616 if (calc_deviation < 0)
@@ -676,7 +679,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
676 * Ask the core to calculate the divisor for us. 679 * Ask the core to calculate the divisor for us.
677 */ 680 */
678 681
679 baud = uart_get_baud_rate(port, termios, old, 0, 115200*8); 682 baud = uart_get_baud_rate(port, termios, old, 0, 3000000);
680 683
681 if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST) 684 if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST)
682 quot = port->custom_divisor; 685 quot = port->custom_divisor;
@@ -1132,7 +1135,7 @@ static ssize_t s3c24xx_serial_show_clksrc(struct device *dev,
1132 struct uart_port *port = s3c24xx_dev_to_port(dev); 1135 struct uart_port *port = s3c24xx_dev_to_port(dev);
1133 struct s3c24xx_uart_port *ourport = to_ourport(port); 1136 struct s3c24xx_uart_port *ourport = to_ourport(port);
1134 1137
1135 return snprintf(buf, PAGE_SIZE, "* %s\n", ourport->clksrc->name); 1138 return snprintf(buf, PAGE_SIZE, "* %s\n", ourport->clksrc->name ?: "(null)");
1136} 1139}
1137 1140
1138static DEVICE_ATTR(clock_source, S_IRUGO, s3c24xx_serial_show_clksrc, NULL); 1141static DEVICE_ATTR(clock_source, S_IRUGO, s3c24xx_serial_show_clksrc, NULL);
@@ -1416,10 +1419,8 @@ s3c24xx_serial_console_setup(struct console *co, char *options)
1416 1419
1417 /* is the port configured? */ 1420 /* is the port configured? */
1418 1421
1419 if (port->mapbase == 0x0) { 1422 if (port->mapbase == 0x0)
1420 co->index = 0; 1423 return -ENODEV;
1421 port = &s3c24xx_serial_ports[co->index].port;
1422 }
1423 1424
1424 cons_uart = port; 1425 cons_uart = port;
1425 1426
@@ -1451,7 +1452,8 @@ static struct console s3c24xx_serial_console = {
1451 .flags = CON_PRINTBUFFER, 1452 .flags = CON_PRINTBUFFER,
1452 .index = -1, 1453 .index = -1,
1453 .write = s3c24xx_serial_console_write, 1454 .write = s3c24xx_serial_console_write,
1454 .setup = s3c24xx_serial_console_setup 1455 .setup = s3c24xx_serial_console_setup,
1456 .data = &s3c24xx_uart_drv,
1455}; 1457};
1456 1458
1457int s3c24xx_serial_initconsole(struct platform_driver *drv, 1459int s3c24xx_serial_initconsole(struct platform_driver *drv,
diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
index 5b098cd7604..a69d9a54be9 100644
--- a/drivers/tty/serial/samsung.h
+++ b/drivers/tty/serial/samsung.h
@@ -79,25 +79,6 @@ extern int s3c24xx_serial_initconsole(struct platform_driver *drv,
79extern int s3c24xx_serial_init(struct platform_driver *drv, 79extern int s3c24xx_serial_init(struct platform_driver *drv,
80 struct s3c24xx_uart_info *info); 80 struct s3c24xx_uart_info *info);
81 81
82#ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE
83
84#define s3c24xx_console_init(__drv, __inf) \
85static int __init s3c_serial_console_init(void) \
86{ \
87 struct s3c24xx_uart_info *uinfo[CONFIG_SERIAL_SAMSUNG_UARTS]; \
88 int i; \
89 \
90 for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) \
91 uinfo[i] = __inf; \
92 return s3c24xx_serial_initconsole(__drv, uinfo); \
93} \
94 \
95console_initcall(s3c_serial_console_init)
96
97#else
98#define s3c24xx_console_init(drv, inf) extern void no_console(void)
99#endif
100
101#ifdef CONFIG_SERIAL_SAMSUNG_DEBUG 82#ifdef CONFIG_SERIAL_SAMSUNG_DEBUG
102 83
103extern void printascii(const char *); 84extern void printascii(const char *);
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index de5e33fc129..2a106a94cdd 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -91,6 +91,9 @@ static void __uart_start(struct tty_struct *tty)
91 struct uart_state *state = tty->driver_data; 91 struct uart_state *state = tty->driver_data;
92 struct uart_port *port = state->uart_port; 92 struct uart_port *port = state->uart_port;
93 93
94 if (port->ops->wake_peer)
95 port->ops->wake_peer(port);
96
94 if (!uart_circ_empty(&state->xmit) && state->xmit.buf && 97 if (!uart_circ_empty(&state->xmit) && state->xmit.buf &&
95 !tty->stopped && !tty->hw_stopped) 98 !tty->stopped && !tty->hw_stopped)
96 port->ops->start_tx(port); 99 port->ops->start_tx(port);