summaryrefslogtreecommitdiff
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorQipan Li <Qipan.Li@csr.com>2013-08-19 07:47:52 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-20 04:13:22 +0400
commit15cdcb12cbcbd6abf16d6b6a52e04d452b464e3b (patch)
treed96b2244741bccd2d1bddfe718d2c77f857037fe /drivers/tty/serial
parent67bc306cec18b962966208a8b553ac99fa554247 (diff)
downloadlinux-15cdcb12cbcbd6abf16d6b6a52e04d452b464e3b.tar.xz
serial: sirf: fix the namespace of startup_uart entry
startup_uart_controller() loses namespace, this patch drops the function directly and move the content into sirfsoc_uart_startup(). Signed-off-by: Qipan Li <Qipan.Li@csr.com> Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/sirfsoc_uart.c52
1 files changed, 23 insertions, 29 deletions
diff --git a/drivers/tty/serial/sirfsoc_uart.c b/drivers/tty/serial/sirfsoc_uart.c
index 10718c0d5439..d37609dfcf76 100644
--- a/drivers/tty/serial/sirfsoc_uart.c
+++ b/drivers/tty/serial/sirfsoc_uart.c
@@ -649,37 +649,10 @@ static void sirfsoc_uart_set_termios(struct uart_port *port,
spin_unlock_irqrestore(&port->lock, flags);
}
-static void startup_uart_controller(struct uart_port *port)
-{
- struct sirfsoc_uart_port *sirfport = to_sirfport(port);
- struct sirfsoc_register *ureg = &sirfport->uart_reg->uart_reg;
- unsigned long temp_regv;
- int temp;
- temp_regv = rd_regl(port, ureg->sirfsoc_tx_dma_io_ctrl);
- wr_regl(port, ureg->sirfsoc_tx_dma_io_ctrl, temp_regv |
- SIRFUART_IO_MODE);
- temp_regv = rd_regl(port, ureg->sirfsoc_rx_dma_io_ctrl);
- wr_regl(port, ureg->sirfsoc_rx_dma_io_ctrl, temp_regv |
- SIRFUART_IO_MODE);
- wr_regl(port, ureg->sirfsoc_tx_dma_io_len, 0);
- wr_regl(port, ureg->sirfsoc_rx_dma_io_len, 0);
- wr_regl(port, ureg->sirfsoc_tx_rx_en, SIRFUART_RX_EN | SIRFUART_TX_EN);
- if (sirfport->uart_reg->uart_type == SIRF_USP_UART)
- wr_regl(port, ureg->sirfsoc_mode1,
- SIRFSOC_USP_ENDIAN_CTRL_LSBF |
- SIRFSOC_USP_EN);
- wr_regl(port, ureg->sirfsoc_tx_fifo_op, SIRFUART_FIFO_RESET);
- wr_regl(port, ureg->sirfsoc_tx_fifo_op, 0);
- wr_regl(port, ureg->sirfsoc_rx_fifo_op, SIRFUART_FIFO_RESET);
- wr_regl(port, ureg->sirfsoc_rx_fifo_op, 0);
- temp = SIRFUART_FIFO_THD(port);
- wr_regl(port, ureg->sirfsoc_tx_fifo_ctrl, temp);
- wr_regl(port, ureg->sirfsoc_rx_fifo_ctrl, temp);
-}
-
static int sirfsoc_uart_startup(struct uart_port *port)
{
struct sirfsoc_uart_port *sirfport = to_sirfport(port);
+ struct sirfsoc_register *ureg = &sirfport->uart_reg->uart_reg;
unsigned int index = port->line;
int ret;
set_irq_flags(port->irq, IRQF_VALID | IRQF_NOAUTOEN);
@@ -693,7 +666,27 @@ static int sirfsoc_uart_startup(struct uart_port *port)
index, port->irq);
goto irq_err;
}
- startup_uart_controller(port);
+
+ /* initial hardware settings */
+ wr_regl(port, ureg->sirfsoc_tx_dma_io_ctrl,
+ rd_regl(port, ureg->sirfsoc_tx_dma_io_ctrl) |
+ SIRFUART_IO_MODE);
+ wr_regl(port, ureg->sirfsoc_rx_dma_io_ctrl,
+ rd_regl(port, ureg->sirfsoc_rx_dma_io_ctrl) |
+ SIRFUART_IO_MODE);
+ wr_regl(port, ureg->sirfsoc_tx_dma_io_len, 0);
+ wr_regl(port, ureg->sirfsoc_rx_dma_io_len, 0);
+ wr_regl(port, ureg->sirfsoc_tx_rx_en, SIRFUART_RX_EN | SIRFUART_TX_EN);
+ if (sirfport->uart_reg->uart_type == SIRF_USP_UART)
+ wr_regl(port, ureg->sirfsoc_mode1,
+ SIRFSOC_USP_ENDIAN_CTRL_LSBF |
+ SIRFSOC_USP_EN);
+ wr_regl(port, ureg->sirfsoc_tx_fifo_op, SIRFUART_FIFO_RESET);
+ wr_regl(port, ureg->sirfsoc_tx_fifo_op, 0);
+ wr_regl(port, ureg->sirfsoc_rx_fifo_op, SIRFUART_FIFO_RESET);
+ wr_regl(port, ureg->sirfsoc_rx_fifo_op, 0);
+ wr_regl(port, ureg->sirfsoc_tx_fifo_ctrl, SIRFUART_FIFO_THD(port));
+ wr_regl(port, ureg->sirfsoc_rx_fifo_ctrl, SIRFUART_FIFO_THD(port));
sirfport->ms_enabled = false;
if (sirfport->uart_reg->uart_type == SIRF_USP_UART &&
@@ -711,6 +704,7 @@ static int sirfsoc_uart_startup(struct uart_port *port)
enable_irq(port->irq);
+ return 0;
init_rx_err:
free_irq(port->irq, sirfport);
irq_err: