/* Enable the IrDA function if tty->ldisc.num is N_IRDA. In other cases, disable IrDA function.  */
static void bfin_serial_set_ldisc(struct uart_port *port)
/* Enable the IrDA function if tty->ldisc.num is N_IRDA. In other cases, disable IrDA function.  */
static void bfin_serial_set_ldisc(struct uart_port *port)
{
	int line = port->line;
	unsigned short val;
	if (line >= port->state->port.tty->driver->num)
		return;
	switch (port->state->port.tty->termios->c_line) {
	case N_IRDA:
		val = UART_GET_GCTL(&bfin_serial_ports[line]);
		val |= (IREN | RPOLC);
		UART_PUT_GCTL(&bfin_serial_ports[line], val);
		break;
	default:
		val = UART_GET_GCTL(&bfin_serial_ports[line]);
		val &= ~(IREN | RPOLC);
		UART_PUT_GCTL(&bfin_serial_ports[line], val);
	}
}