Commit b1a5ffda authored by Russell King's avatar Russell King

[SERIAL] Move custom_divisor from uart_state to uart_port.

This is another step towards moving the divisor calculations into
the low level drivers, thereby allowing the faster baud rates
mentioned in the previous cset.  Moving this field to uart_port
means that the low level drivers do not have to know about the
uart_state structure.
parent e75784be
......@@ -309,7 +309,7 @@ unsigned int uart_calculate_quot(struct uart_info *info, unsigned int baud)
/* Old HI/VHI/custom speed handling */
if (baud == 38400 &&
((port->flags & UPF_SPD_MASK) == UPF_SPD_CUST))
quot = info->state->custom_divisor;
quot = port->custom_divisor;
else
quot = port->uartclk / (16 * baud);
......@@ -617,7 +617,7 @@ static int uart_get_info(struct uart_info *info, struct serial_struct *retinfo)
tmp.baud_base = port->uartclk / 16;
tmp.close_delay = state->close_delay;
tmp.closing_wait = state->closing_wait;
tmp.custom_divisor = state->custom_divisor;
tmp.custom_divisor = port->custom_divisor;
tmp.hub6 = port->hub6;
tmp.io_type = port->iotype;
tmp.iomem_reg_shift = port->regshift;
......@@ -672,7 +672,7 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo)
new_serial.type != port->type;
old_flags = port->flags;
old_custom_divisor = state->custom_divisor;
old_custom_divisor = port->custom_divisor;
if (!capable(CAP_SYS_ADMIN)) {
retval = -EPERM;
......@@ -685,7 +685,7 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo)
goto exit;
port->flags = ((port->flags & ~UPF_USR_MASK) |
(new_serial.flags & UPF_USR_MASK));
state->custom_divisor = new_serial.custom_divisor;
port->custom_divisor = new_serial.custom_divisor;
goto check_and_exit;
}
......@@ -777,7 +777,7 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo)
port->irq = new_serial.irq;
port->uartclk = new_serial.baud_base * 16;
port->flags = new_serial.flags & UPF_FLAGS;
state->custom_divisor = new_serial.custom_divisor;
port->custom_divisor = new_serial.custom_divisor;
state->close_delay = new_serial.close_delay * HZ / 100;
state->closing_wait = new_serial.closing_wait * HZ / 100;
port->fifosize = new_serial.xmit_fifo_size;
......@@ -789,7 +789,7 @@ uart_set_info(struct uart_info *info, struct serial_struct *newinfo)
goto exit;
if (info->flags & UIF_INITIALIZED) {
if (((old_flags ^ port->flags) & UPF_SPD_MASK) ||
old_custom_divisor != state->custom_divisor)
old_custom_divisor != port->custom_divisor)
uart_change_speed(info, NULL);
} else
retval = uart_startup(info, 1);
......
......@@ -186,6 +186,7 @@ struct uart_port {
unsigned int timeout; /* character-based timeout */
unsigned int type; /* port type */
struct uart_ops *ops;
unsigned int custom_divisor;
unsigned int line; /* port index */
unsigned long mapbase; /* for ioremap */
unsigned char hub6; /* this should be in the 8250 driver */
......@@ -204,8 +205,6 @@ struct uart_state {
#define USF_CLOSING_WAIT_INF (0)
#define USF_CLOSING_WAIT_NONE (65535)
unsigned int custom_divisor;
int count;
struct uart_info *info;
struct uart_port *port;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment