Skip to content
Permalink
Browse files

tty: 8250: jz4780: Add MCR register bits for flow control.

These bits are not standard 550 uart.
For the serial module in the JZ4780, they need to be enabled
for flow control to work.

Found using old ingenic history to get BT to work on 3.16

Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
  • Loading branch information...
Zubair Lutfullah Kakakhel Zubair Lutfullah Kakakhel
Zubair Lutfullah Kakakhel authored and Zubair Lutfullah Kakakhel committed Oct 28, 2014
1 parent 1a94fa6 commit 1d1d702613e0f4241ab7d8021b937e6366117c79
Showing with 16 additions and 1 deletion.
  1. +16 −1 drivers/tty/serial/8250/8250_core.c
@@ -47,6 +47,11 @@

#include "8250.h"

#ifdef CONFIG_MACH_JZ4780
#define JZ_UART_MCR_MDCE 0x80 /* Enable modem function */
#define JZ_UART_MCR_FCM 0x40 /* flow control by hardware */
#endif

/*
* Configuration:
* share_irqs - whether we pass IRQF_SHARED to request_irq(). This option
@@ -1860,6 +1865,13 @@ static void serial8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
if (mctrl & TIOCM_LOOP)
mcr |= UART_MCR_LOOP;

if (port->type == PORT_INGENIC_JZ) {
if (mctrl & JZ_UART_MCR_MDCE)
mcr |= JZ_UART_MCR_MDCE;
if (mctrl & JZ_UART_MCR_FCM)
mcr |= JZ_UART_MCR_FCM;
}

mcr = (mcr & up->mcr_mask) | up->mcr_force | up->mcr;

serial_port_out(port, UART_MCR, mcr);
@@ -2411,8 +2423,11 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
*/
up->ier &= ~UART_IER_MSI;
if (!(up->bugs & UART_BUG_NOMSR) &&
UART_ENABLE_MS(&up->port, termios->c_cflag))
UART_ENABLE_MS(&up->port, termios->c_cflag)) {
up->ier |= UART_IER_MSI;
if (port->type == PORT_INGENIC_JZ)
up->port.mctrl = JZ_UART_MCR_MDCE | JZ_UART_MCR_FCM;
}
if (up->capabilities & UART_CAP_UUE)
up->ier |= UART_IER_UUE;
if (up->capabilities & UART_CAP_RTOIE)

0 comments on commit 1d1d702

Please sign in to comment.
You can’t perform that action at this time.