Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325795
b: refs/heads/master
c: b3564c2
h: refs/heads/master
i:
  325793: 3a22c1d
  325791: 3270a82
v: v3
  • Loading branch information
Anton Vorontsov authored and Greg Kroah-Hartman committed Sep 26, 2012
1 parent b0858c6 commit 9558a01
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c7f3e7087ab0abb52bb1286010f2c104fd38ca5c
refs/heads/master: b3564c2cf464e11f8cb4f8d9c124e5e0f5418e3f
44 changes: 33 additions & 11 deletions trunk/drivers/tty/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,10 +1309,9 @@ static void pl011_put_poll_char(struct uart_port *port,

#endif /* CONFIG_CONSOLE_POLL */

static int pl011_startup(struct uart_port *port)
static int pl011_hwinit(struct uart_port *port)
{
struct uart_amba_port *uap = (struct uart_amba_port *)port;
unsigned int cr;
int retval;

/* Optionaly enable pins to be muxed in and configured */
Expand All @@ -1336,6 +1335,37 @@ static int pl011_startup(struct uart_port *port)
writew(UART011_OEIS | UART011_BEIS | UART011_PEIS | UART011_FEIS |
UART011_RTIS | UART011_RXIS, uap->port.membase + UART011_ICR);

/*
* Save interrupts enable mask, and enable RX interrupts in case if
* the interrupt is used for NMI entry.
*/
uap->im = readw(uap->port.membase + UART011_IMSC);
writew(UART011_RTIM | UART011_RXIM, uap->port.membase + UART011_IMSC);

if (uap->port.dev->platform_data) {
struct amba_pl011_data *plat;

plat = uap->port.dev->platform_data;
if (plat->init)
plat->init();
}
return 0;
out:
return retval;
}

static int pl011_startup(struct uart_port *port)
{
struct uart_amba_port *uap = (struct uart_amba_port *)port;
unsigned int cr;
int retval;

retval = pl011_hwinit(port);
if (retval)
goto clk_dis;

writew(uap->im, uap->port.membase + UART011_IMSC);

/*
* Allocate the IRQ
*/
Expand Down Expand Up @@ -1395,19 +1425,10 @@ static int pl011_startup(struct uart_port *port)
writew(uap->im, uap->port.membase + UART011_IMSC);
spin_unlock_irq(&uap->port.lock);

if (uap->port.dev->platform_data) {
struct amba_pl011_data *plat;

plat = uap->port.dev->platform_data;
if (plat->init)
plat->init();
}

return 0;

clk_dis:
clk_disable_unprepare(uap->clk);
out:
return retval;
}

Expand Down Expand Up @@ -1701,6 +1722,7 @@ static struct uart_ops amba_pl011_pops = {
.config_port = pl011_config_port,
.verify_port = pl011_verify_port,
#ifdef CONFIG_CONSOLE_POLL
.poll_init = pl011_hwinit,
.poll_get_char = pl011_get_poll_char,
.poll_put_char = pl011_put_poll_char,
#endif
Expand Down

0 comments on commit 9558a01

Please sign in to comment.