diff options
Diffstat (limited to 'drivers/tty/serial/samsung.c')
-rw-r--r-- | drivers/tty/serial/samsung.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index c1d3ebdf3b97..4aff02d6712e 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -203,10 +203,6 @@ static void s3c24xx_serial_stop_rx(struct uart_port *port) } } -static void s3c24xx_serial_enable_ms(struct uart_port *port) -{ -} - static inline struct s3c24xx_uart_info *s3c24xx_port_to_info(struct uart_port *port) { return to_ourport(port)->info; @@ -952,7 +948,6 @@ static struct uart_ops s3c24xx_serial_ops = { .stop_tx = s3c24xx_serial_stop_tx, .start_tx = s3c24xx_serial_start_tx, .stop_rx = s3c24xx_serial_stop_rx, - .enable_ms = s3c24xx_serial_enable_ms, .break_ctl = s3c24xx_serial_break_ctl, .startup = s3c24xx_serial_startup, .shutdown = s3c24xx_serial_shutdown, @@ -1226,8 +1221,8 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, wr_regl(port, S3C64XX_UINTSP, 0xf); } - dbg("port: map=%08x, mem=%p, irq=%d (%d,%d), clock=%u\n", - port->mapbase, port->membase, port->irq, + dbg("port: map=%pa, mem=%p, irq=%d (%d,%d), clock=%u\n", + &port->mapbase, port->membase, port->irq, ourport->rx_irq, ourport->tx_irq, port->uartclk); /* reset the fifos (and setup the uart) */ @@ -1274,12 +1269,20 @@ static inline struct s3c24xx_serial_drv_data *s3c24xx_get_driver_data( static int s3c24xx_serial_probe(struct platform_device *pdev) { + struct device_node *np = pdev->dev.of_node; struct s3c24xx_uart_port *ourport; + int index = probe_index; int ret; - dbg("s3c24xx_serial_probe(%p) %d\n", pdev, probe_index); + if (np) { + ret = of_alias_get_id(np, "serial"); + if (ret >= 0) + index = ret; + } + + dbg("s3c24xx_serial_probe(%p) %d\n", pdev, index); - ourport = &s3c24xx_serial_ports[probe_index]; + ourport = &s3c24xx_serial_ports[index]; ourport->drv_data = s3c24xx_get_driver_data(pdev); if (!ourport->drv_data) { @@ -1293,9 +1296,15 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) dev_get_platdata(&pdev->dev) : ourport->drv_data->def_cfg; - ourport->port.fifosize = (ourport->info->fifosize) ? - ourport->info->fifosize : - ourport->drv_data->fifosize[probe_index]; + if (np) + of_property_read_u32(np, + "samsung,uart-fifosize", &ourport->port.fifosize); + + if (!ourport->port.fifosize) { + ourport->port.fifosize = (ourport->info->fifosize) ? + ourport->info->fifosize : + ourport->drv_data->fifosize[index]; + } probe_index++; @@ -1303,7 +1312,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) ret = s3c24xx_serial_init_port(ourport, pdev); if (ret < 0) - goto probe_err; + return ret; if (!s3c24xx_uart_drv.state) { ret = uart_register_driver(&s3c24xx_uart_drv); @@ -1335,9 +1344,6 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to add cpufreq notifier\n"); return 0; - - probe_err: - return ret; } static int s3c24xx_serial_remove(struct platform_device *dev) @@ -1537,8 +1543,8 @@ s3c24xx_serial_get_options(struct uart_port *port, int *baud, case S3C2410_LCON_CS7: *bits = 7; break; - default: case S3C2410_LCON_CS8: + default: *bits = 8; break; } @@ -1712,9 +1718,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { #define S3C2440_SERIAL_DRV_DATA (kernel_ulong_t)NULL #endif -#if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) || \ - defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) || \ - defined(CONFIG_CPU_S5PC100) +#if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .info = &(struct s3c24xx_uart_info) { .name = "Samsung S3C6400 UART", |