Skip to content

Commit

Permalink
Merge master.kernel.org:/home/rmk/linux-2.6-serial
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Jan 31, 2006
2 parents bb4bc81 + df7559d commit d195ea4
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 126 deletions.
2 changes: 1 addition & 1 deletion drivers/misc/ibmasm/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void ibmasm_register_uart(struct service_processor *sp)
memset(&uport, 0, sizeof(struct uart_port));
uport.irq = sp->irq;
uport.uartclk = 3686400;
uport.flags = UPF_AUTOPROBE | UPF_SHARE_IRQ;
uport.flags = UPF_SHARE_IRQ;
uport.iotype = UPIO_MEM;
uport.membase = iomem_base;

Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/21285.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ static struct uart_port serial21285_port = {
.irq = NO_IRQ,
.fifosize = 16,
.ops = &serial21285_ops,
.flags = ASYNC_BOOT_AUTOCONF,
.flags = UPF_BOOT_AUTOCONF,
};

static void serial21285_setup_ports(void)
Expand Down
19 changes: 6 additions & 13 deletions drivers/serial/8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <linux/init.h>
#include <linux/console.h>
#include <linux/sysrq.h>
#include <linux/mca.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/tty.h>
Expand Down Expand Up @@ -2026,12 +2025,6 @@ static void serial8250_config_port(struct uart_port *port, int flags)
int probeflags = PROBE_ANY;
int ret;

/*
* Don't probe for MCA ports on non-MCA machines.
*/
if (up->port.flags & UPF_BOOT_ONLYMCA && !MCA_bus)
return;

/*
* Find the region that we can probe for. This in turn
* tells us whether we can probe for the type of port.
Expand Down Expand Up @@ -2164,7 +2157,7 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev)
/*
* Wait for transmitter & holding register to empty
*/
static inline void wait_for_xmitr(struct uart_8250_port *up)
static inline void wait_for_xmitr(struct uart_8250_port *up, int bits)
{
unsigned int status, tmout = 10000;

Expand All @@ -2178,7 +2171,7 @@ static inline void wait_for_xmitr(struct uart_8250_port *up)
if (--tmout == 0)
break;
udelay(1);
} while ((status & BOTH_EMPTY) != BOTH_EMPTY);
} while ((status & bits) != bits);

/* Wait up to 1s for flow control if necessary */
if (up->port.flags & UPF_CONS_FLOW) {
Expand Down Expand Up @@ -2218,15 +2211,15 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
* Now, do each character
*/
for (i = 0; i < count; i++, s++) {
wait_for_xmitr(up);
wait_for_xmitr(up, UART_LSR_THRE);

/*
* Send the character out.
* If a LF, also do CR...
*/
serial_out(up, UART_TX, *s);
if (*s == 10) {
wait_for_xmitr(up);
wait_for_xmitr(up, UART_LSR_THRE);
serial_out(up, UART_TX, 13);
}
}
Expand All @@ -2235,8 +2228,8 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
* Finally, wait for transmitter to become empty
* and restore the IER
*/
wait_for_xmitr(up);
serial_out(up, UART_IER, ier);
wait_for_xmitr(up, BOTH_EMPTY);
serial_out(up, UART_IER, ier | UART_IER_THRI);
}

static int serial8250_console_setup(struct console *co, char *options)
Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ config SERIAL_8250
work.)

To compile this driver as a module, choose M here: the
module will be called serial.
module will be called 8250.
[WARNING: Do not compile this driver as a module if you are using
non-standard serial ports, since the configuration information will
be lost when the driver is unloaded. This limitation may be lifted
Expand Down
4 changes: 2 additions & 2 deletions drivers/serial/amba-pl010.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ static struct uart_amba_port amba_ports[UART_NR] = {
.uartclk = 14745600,
.fifosize = 16,
.ops = &amba_pl010_pops,
.flags = ASYNC_BOOT_AUTOCONF,
.flags = UPF_BOOT_AUTOCONF,
.line = 0,
},
.dtr_mask = 1 << 5,
Expand All @@ -581,7 +581,7 @@ static struct uart_amba_port amba_ports[UART_NR] = {
.uartclk = 14745600,
.fifosize = 16,
.ops = &amba_pl010_pops,
.flags = ASYNC_BOOT_AUTOCONF,
.flags = UPF_BOOT_AUTOCONF,
.line = 1,
},
.dtr_mask = 1 << 7,
Expand Down
4 changes: 2 additions & 2 deletions drivers/serial/clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static struct uart_port clps711x_ports[UART_NR] = {
.fifosize = 16,
.ops = &clps711x_pops,
.line = 0,
.flags = ASYNC_BOOT_AUTOCONF,
.flags = UPF_BOOT_AUTOCONF,
},
{
.iobase = SYSCON2,
Expand All @@ -419,7 +419,7 @@ static struct uart_port clps711x_ports[UART_NR] = {
.fifosize = 16,
.ops = &clps711x_pops,
.line = 1,
.flags = ASYNC_BOOT_AUTOCONF,
.flags = UPF_BOOT_AUTOCONF,
}
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/serial/imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ static struct imx_port imx_ports[] = {
.irq = UART1_MINT_RX,
.uartclk = 16000000,
.fifosize = 8,
.flags = ASYNC_BOOT_AUTOCONF,
.flags = UPF_BOOT_AUTOCONF,
.ops = &imx_pops,
.line = 0,
},
Expand All @@ -690,7 +690,7 @@ static struct imx_port imx_ports[] = {
.irq = UART2_MINT_RX,
.uartclk = 16000000,
.fifosize = 8,
.flags = ASYNC_BOOT_AUTOCONF,
.flags = UPF_BOOT_AUTOCONF,
.ops = &imx_pops,
.line = 1,
},
Expand Down
6 changes: 3 additions & 3 deletions drivers/serial/sa1100.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,21 +665,21 @@ void __init sa1100_register_uart(int idx, int port)
sa1100_ports[idx].port.membase = (void __iomem *)&Ser1UTCR0;
sa1100_ports[idx].port.mapbase = _Ser1UTCR0;
sa1100_ports[idx].port.irq = IRQ_Ser1UART;
sa1100_ports[idx].port.flags = ASYNC_BOOT_AUTOCONF;
sa1100_ports[idx].port.flags = UPF_BOOT_AUTOCONF;
break;

case 2:
sa1100_ports[idx].port.membase = (void __iomem *)&Ser2UTCR0;
sa1100_ports[idx].port.mapbase = _Ser2UTCR0;
sa1100_ports[idx].port.irq = IRQ_Ser2ICP;
sa1100_ports[idx].port.flags = ASYNC_BOOT_AUTOCONF;
sa1100_ports[idx].port.flags = UPF_BOOT_AUTOCONF;
break;

case 3:
sa1100_ports[idx].port.membase = (void __iomem *)&Ser3UTCR0;
sa1100_ports[idx].port.mapbase = _Ser3UTCR0;
sa1100_ports[idx].port.irq = IRQ_Ser3UART;
sa1100_ports[idx].port.flags = ASYNC_BOOT_AUTOCONF;
sa1100_ports[idx].port.flags = UPF_BOOT_AUTOCONF;
break;

default:
Expand Down
16 changes: 9 additions & 7 deletions drivers/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ uart_get_baud_rate(struct uart_port *port, struct termios *termios,
struct termios *old, unsigned int min, unsigned int max)
{
unsigned int try, baud, altbaud = 38400;
unsigned int flags = port->flags & UPF_SPD_MASK;
upf_t flags = port->flags & UPF_SPD_MASK;

if (flags == UPF_SPD_HI)
altbaud = 57600;
Expand Down Expand Up @@ -615,8 +615,9 @@ static int uart_set_info(struct uart_state *state,
struct serial_struct new_serial;
struct uart_port *port = state->port;
unsigned long new_port;
unsigned int change_irq, change_port, old_flags, closing_wait;
unsigned int change_irq, change_port, closing_wait;
unsigned int old_custom_divisor, close_delay;
upf_t old_flags, new_flags;
int retval = 0;

if (copy_from_user(&new_serial, newinfo, sizeof(new_serial)))
Expand Down Expand Up @@ -655,6 +656,7 @@ static int uart_set_info(struct uart_state *state,
new_serial.type != port->type;

old_flags = port->flags;
new_flags = new_serial.flags;
old_custom_divisor = port->custom_divisor;

if (!capable(CAP_SYS_ADMIN)) {
Expand All @@ -664,10 +666,10 @@ static int uart_set_info(struct uart_state *state,
(close_delay != state->close_delay) ||
(closing_wait != state->closing_wait) ||
(new_serial.xmit_fifo_size != port->fifosize) ||
(((new_serial.flags ^ old_flags) & ~UPF_USR_MASK) != 0))
(((new_flags ^ old_flags) & ~UPF_USR_MASK) != 0))
goto exit;
port->flags = ((port->flags & ~UPF_USR_MASK) |
(new_serial.flags & UPF_USR_MASK));
(new_flags & UPF_USR_MASK));
port->custom_divisor = new_serial.custom_divisor;
goto check_and_exit;
}
Expand Down Expand Up @@ -764,7 +766,7 @@ static int uart_set_info(struct uart_state *state,
port->irq = new_serial.irq;
port->uartclk = new_serial.baud_base * 16;
port->flags = (port->flags & ~UPF_CHANGE_MASK) |
(new_serial.flags & UPF_CHANGE_MASK);
(new_flags & UPF_CHANGE_MASK);
port->custom_divisor = new_serial.custom_divisor;
state->close_delay = close_delay;
state->closing_wait = closing_wait;
Expand Down Expand Up @@ -1870,7 +1872,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
mutex_lock(&state->mutex);

if (state->info && state->info->flags & UIF_INITIALIZED) {
struct uart_ops *ops = port->ops;
const struct uart_ops *ops = port->ops;

spin_lock_irq(&port->lock);
ops->stop_tx(port);
Expand Down Expand Up @@ -1932,7 +1934,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
}

if (state->info && state->info->flags & UIF_INITIALIZED) {
struct uart_ops *ops = port->ops;
const struct uart_ops *ops = port->ops;
int ret;

ops->set_mctrl(port, 0);
Expand Down
6 changes: 3 additions & 3 deletions drivers/serial/serial_lh7a40x.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = {
.uartclk = 14745600/2,
.fifosize = 16,
.ops = &lh7a40x_uart_ops,
.flags = ASYNC_BOOT_AUTOCONF,
.flags = UPF_BOOT_AUTOCONF,
.line = 0,
},
},
Expand All @@ -519,7 +519,7 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = {
.uartclk = 14745600/2,
.fifosize = 16,
.ops = &lh7a40x_uart_ops,
.flags = ASYNC_BOOT_AUTOCONF,
.flags = UPF_BOOT_AUTOCONF,
.line = 1,
},
},
Expand All @@ -532,7 +532,7 @@ static struct uart_port_lh7a40x lh7a40x_ports[DEV_NR] = {
.uartclk = 14745600/2,
.fifosize = 16,
.ops = &lh7a40x_uart_ops,
.flags = ASYNC_BOOT_AUTOCONF,
.flags = UPF_BOOT_AUTOCONF,
.line = 2,
},
},
Expand Down
Loading

0 comments on commit d195ea4

Please sign in to comment.