git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
serial
/
amba-pl011.c
diff --git
a/drivers/serial/amba-pl011.c
b/drivers/serial/amba-pl011.c
index
034a029
..
44639e7
100644
(file)
--- a/
drivers/serial/amba-pl011.c
+++ b/
drivers/serial/amba-pl011.c
@@
-31,7
+31,6
@@
* required, these have to be supplied via some other means (eg, GPIO)
* and hooked into this driver.
*/
* required, these have to be supplied via some other means (eg, GPIO)
* and hooked into this driver.
*/
-#include <linux/config.h>
#if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
#define SUPPORT_SYSRQ
#if defined(CONFIG_SERIAL_AMBA_PL011_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
#define SUPPORT_SYSRQ
@@
-108,12
+107,7
@@
static void pl011_enable_ms(struct uart_port *port)
writew(uap->im, uap->port.membase + UART011_IMSC);
}
writew(uap->im, uap->port.membase + UART011_IMSC);
}
-static void
-#ifdef SUPPORT_SYSRQ
-pl011_rx_chars(struct uart_amba_port *uap, struct pt_regs *regs)
-#else
-pl011_rx_chars(struct uart_amba_port *uap)
-#endif
+static void pl011_rx_chars(struct uart_amba_port *uap)
{
struct tty_struct *tty = uap->port.info->tty;
unsigned int status, ch, flag, max_count = 256;
{
struct tty_struct *tty = uap->port.info->tty;
unsigned int status, ch, flag, max_count = 256;
@@
-151,7
+145,7
@@
pl011_rx_chars(struct uart_amba_port *uap)
flag = TTY_FRAME;
}
flag = TTY_FRAME;
}
- if (uart_handle_sysrq_char(&uap->port, ch & 255
, regs
))
+ if (uart_handle_sysrq_char(&uap->port, ch & 255))
goto ignore_char;
uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag);
goto ignore_char;
uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag);
@@
-219,7
+213,7
@@
static void pl011_modem_status(struct uart_amba_port *uap)
wake_up_interruptible(&uap->port.info->delta_msr_wait);
}
wake_up_interruptible(&uap->port.info->delta_msr_wait);
}
-static irqreturn_t pl011_int(int irq, void *dev_id
, struct pt_regs *regs
)
+static irqreturn_t pl011_int(int irq, void *dev_id)
{
struct uart_amba_port *uap = dev_id;
unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT;
{
struct uart_amba_port *uap = dev_id;
unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT;
@@
-235,11
+229,7
@@
static irqreturn_t pl011_int(int irq, void *dev_id, struct pt_regs *regs)
uap->port.membase + UART011_ICR);
if (status & (UART011_RTIS|UART011_RXIS))
uap->port.membase + UART011_ICR);
if (status & (UART011_RTIS|UART011_RXIS))
-#ifdef SUPPORT_SYSRQ
- pl011_rx_chars(uap, regs);
-#else
pl011_rx_chars(uap);
pl011_rx_chars(uap);
-#endif
if (status & (UART011_DSRMIS|UART011_DCDMIS|
UART011_CTSMIS|UART011_RIMIS))
pl011_modem_status(uap);
if (status & (UART011_DSRMIS|UART011_DCDMIS|
UART011_CTSMIS|UART011_RIMIS))
pl011_modem_status(uap);
@@
-422,8
+412,8
@@
static void pl011_shutdown(struct uart_port *port)
}
static void
}
static void
-pl011_set_termios(struct uart_port *port, struct termios *termios,
- struct termios *old)
+pl011_set_termios(struct uart_port *port, struct
k
termios *termios,
+ struct
k
termios *old)
{
unsigned int lcr_h, old_cr;
unsigned long flags;
{
unsigned int lcr_h, old_cr;
unsigned long flags;
@@
-587,14
+577,12
@@
static struct uart_amba_port *amba_ports[UART_NR];
#ifdef CONFIG_SERIAL_AMBA_PL011_CONSOLE
#ifdef CONFIG_SERIAL_AMBA_PL011_CONSOLE
-static inline void
-pl011_console_write_char(struct uart_amba_port *uap, char ch)
+static void pl011_console_putchar(struct uart_port *port, int ch)
{
{
-
unsigned int status
;
+
struct uart_amba_port *uap = (struct uart_amba_port *)port
;
- do {
- status = readw(uap->port.membase + UART01x_FR);
- } while (status & UART01x_FR_TXFF);
+ while (readw(uap->port.membase + UART01x_FR) & UART01x_FR_TXFF)
+ barrier();
writew(ch, uap->port.membase + UART01x_DR);
}
writew(ch, uap->port.membase + UART01x_DR);
}
@@
-603,7
+591,6
@@
pl011_console_write(struct console *co, const char *s, unsigned int count)
{
struct uart_amba_port *uap = amba_ports[co->index];
unsigned int status, old_cr, new_cr;
{
struct uart_amba_port *uap = amba_ports[co->index];
unsigned int status, old_cr, new_cr;
- int i;
clk_enable(uap->clk);
clk_enable(uap->clk);
@@
-615,14
+602,7
@@
pl011_console_write(struct console *co, const char *s, unsigned int count)
new_cr |= UART01x_CR_UARTEN | UART011_CR_TXE;
writew(new_cr, uap->port.membase + UART011_CR);
new_cr |= UART01x_CR_UARTEN | UART011_CR_TXE;
writew(new_cr, uap->port.membase + UART011_CR);
- /*
- * Now, do each character
- */
- for (i = 0; i < count; i++) {
- pl011_console_write_char(uap, s[i]);
- if (s[i] == '\n')
- pl011_console_write_char(uap, '\r');
- }
+ uart_console_write(&uap->port, s, count, pl011_console_putchar);
/*
* Finally, wait for transmitter to become empty
/*
* Finally, wait for transmitter to become empty
@@
-681,6
+661,8
@@
static int __init pl011_console_setup(struct console *co, char *options)
if (co->index >= UART_NR)
co->index = 0;
uap = amba_ports[co->index];
if (co->index >= UART_NR)
co->index = 0;
uap = amba_ports[co->index];
+ if (!uap)
+ return -ENODEV;
uap->port.uartclk = clk_get_rate(uap->clk);
uap->port.uartclk = clk_get_rate(uap->clk);