diff options
Diffstat (limited to 'drivers/tty/serial/omap-serial.c')
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 1c2426931484..a3f5ea46f345 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c | |||
@@ -46,6 +46,13 @@ | |||
46 | 46 | ||
47 | #define DEFAULT_CLK_SPEED 48000000 /* 48Mhz*/ | 47 | #define DEFAULT_CLK_SPEED 48000000 /* 48Mhz*/ |
48 | 48 | ||
49 | /* SCR register bitmasks */ | ||
50 | #define OMAP_UART_SCR_RX_TRIG_GRANU1_MASK (1 << 7) | ||
51 | |||
52 | /* FCR register bitmasks */ | ||
53 | #define OMAP_UART_FCR_RX_FIFO_TRIG_SHIFT 6 | ||
54 | #define OMAP_UART_FCR_RX_FIFO_TRIG_MASK (0x3 << 6) | ||
55 | |||
49 | static struct uart_omap_port *ui[OMAP_MAX_HSUART_PORTS]; | 56 | static struct uart_omap_port *ui[OMAP_MAX_HSUART_PORTS]; |
50 | 57 | ||
51 | /* Forward declaration of functions */ | 58 | /* Forward declaration of functions */ |
@@ -811,14 +818,21 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, | |||
811 | up->mcr = serial_in(up, UART_MCR); | 818 | up->mcr = serial_in(up, UART_MCR); |
812 | serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR); | 819 | serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR); |
813 | /* FIFO ENABLE, DMA MODE */ | 820 | /* FIFO ENABLE, DMA MODE */ |
814 | serial_out(up, UART_FCR, up->fcr); | 821 | |
815 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | 822 | up->scr |= OMAP_UART_SCR_RX_TRIG_GRANU1_MASK; |
816 | 823 | ||
817 | if (up->use_dma) { | 824 | if (up->use_dma) { |
818 | serial_out(up, UART_TI752_TLR, 0); | 825 | serial_out(up, UART_TI752_TLR, 0); |
819 | up->scr |= (UART_FCR_TRIGGER_4 | UART_FCR_TRIGGER_8); | 826 | up->scr |= UART_FCR_TRIGGER_4; |
827 | } else { | ||
828 | /* Set receive FIFO threshold to 1 byte */ | ||
829 | up->fcr &= ~OMAP_UART_FCR_RX_FIFO_TRIG_MASK; | ||
830 | up->fcr |= (0x1 << OMAP_UART_FCR_RX_FIFO_TRIG_SHIFT); | ||
820 | } | 831 | } |
821 | 832 | ||
833 | serial_out(up, UART_FCR, up->fcr); | ||
834 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | ||
835 | |||
822 | serial_out(up, UART_OMAP_SCR, up->scr); | 836 | serial_out(up, UART_OMAP_SCR, up->scr); |
823 | 837 | ||
824 | serial_out(up, UART_EFR, up->efr); | 838 | serial_out(up, UART_EFR, up->efr); |