/* Set the port FIFO timeout value. The @cflag value should reflect the actual hardware settings.  */
void uart_update_timeout(struct uart_port *port, unsigned int cflag, unsigned int baud)
/* Set the port FIFO timeout value. The @cflag value should reflect the actual hardware settings.  */
void uart_update_timeout(struct uart_port *port, unsigned int cflag, unsigned int baud)
{
	unsigned int bits;
	switch (cflag & CSIZE) {
	case CS5:
		bits = 7;
		break;
	case CS6:
		bits = 8;
		break;
	case CS7:
		bits = 9;
		break;
	default:
		bits = 10;
		break;
	}
	if (cflag & CSTOPB)
		bits++;
	if (cflag & PARENB)
		bits++;
	bits = bits * port->fifosize;
	port->timeout = (HZ * bits) / baud + HZ/50;
}