aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/serial.c')
-rw-r--r--arch/arm/mach-omap2/serial.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 39b797bc14d6..8c964bec8159 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -125,6 +125,13 @@ static struct plat_serial8250_port serial_platform_data3[] = {
125 } 125 }
126}; 126};
127#endif 127#endif
128static inline unsigned int __serial_read_reg(struct uart_port *up,
129 int offset)
130{
131 offset <<= up->regshift;
132 return (unsigned int)__raw_readb(up->membase + offset);
133}
134
128static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, 135static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
129 int offset) 136 int offset)
130{ 137{
@@ -583,11 +590,12 @@ static unsigned int serial_in_override(struct uart_port *up, int offset)
583{ 590{
584 if (UART_RX == offset) { 591 if (UART_RX == offset) {
585 unsigned int lsr; 592 unsigned int lsr;
586 lsr = serial_read_reg(omap_uart[up->line].p, UART_LSR); 593 lsr = __serial_read_reg(up, UART_LSR);
587 if (!(lsr & UART_LSR_DR)) 594 if (!(lsr & UART_LSR_DR))
588 return -EPERM; 595 return -EPERM;
589 } 596 }
590 return serial_read_reg(omap_uart[up->line].p, offset); 597
598 return __serial_read_reg(up, offset);
591} 599}
592 600
593void __init omap_serial_early_init(void) 601void __init omap_serial_early_init(void)
@@ -640,12 +648,9 @@ void __init omap_serial_early_init(void)
640 uart->num = i; 648 uart->num = i;
641 p->private_data = uart; 649 p->private_data = uart;
642 uart->p = p; 650 uart->p = p;
643 list_add_tail(&uart->node, &uart_list);
644 651
645 if (cpu_is_omap44xx()) 652 if (cpu_is_omap44xx())
646 p->irq += 32; 653 p->irq += 32;
647
648 omap_uart_enable_clocks(uart);
649 } 654 }
650} 655}
651 656
@@ -673,9 +678,13 @@ void __init omap_serial_init_port(int port)
673 pdev = &uart->pdev; 678 pdev = &uart->pdev;
674 dev = &pdev->dev; 679 dev = &pdev->dev;
675 680
681 omap_uart_enable_clocks(uart);
682
676 omap_uart_reset(uart); 683 omap_uart_reset(uart);
677 omap_uart_idle_init(uart); 684 omap_uart_idle_init(uart);
678 685
686 list_add_tail(&uart->node, &uart_list);
687
679 if (WARN_ON(platform_device_register(pdev))) 688 if (WARN_ON(platform_device_register(pdev)))
680 return; 689 return;
681 690