aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan T. Ivanov <ivan.ivanov@linaro.org>2015-09-30 08:27:00 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 14:15:17 -0400
commit558abdb05fe0c7fc86eba8803d74bc9592c3cb26 (patch)
treebbe2ae6aad8c2dba30fb7cc734e1735e7d810ddc
parenteec43b8afaf57af5dfbbdcd92c64e83a3ef8ca57 (diff)
tty: serial: msm: Add msm prefix to all driver functions
Make function naming consistent across this driver. Also rename msm_irq to msm_uart_irq. No functional changes. Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/msm_serial.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index d08cfd3e1c3a..2315a614ff45 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -57,7 +57,7 @@ struct msm_port {
57 bool break_detected; 57 bool break_detected;
58}; 58};
59 59
60static inline void wait_for_xmitr(struct uart_port *port) 60static inline void msm_wait_for_xmitr(struct uart_port *port)
61{ 61{
62 while (!(msm_read(port, UART_SR) & UART_SR_TX_EMPTY)) { 62 while (!(msm_read(port, UART_SR) & UART_SR_TX_EMPTY)) {
63 if (msm_read(port, UART_ISR) & UART_ISR_TX_READY) 63 if (msm_read(port, UART_ISR) & UART_ISR_TX_READY)
@@ -99,7 +99,7 @@ static void msm_enable_ms(struct uart_port *port)
99 msm_write(port, msm_port->imr, UART_IMR); 99 msm_write(port, msm_port->imr, UART_IMR);
100} 100}
101 101
102static void handle_rx_dm(struct uart_port *port, unsigned int misr) 102static void msm_handle_rx_dm(struct uart_port *port, unsigned int misr)
103{ 103{
104 struct tty_port *tport = &port->state->port; 104 struct tty_port *tport = &port->state->port;
105 unsigned int sr; 105 unsigned int sr;
@@ -171,7 +171,7 @@ static void handle_rx_dm(struct uart_port *port, unsigned int misr)
171 msm_write(port, UART_CR_CMD_STALE_EVENT_ENABLE, UART_CR); 171 msm_write(port, UART_CR_CMD_STALE_EVENT_ENABLE, UART_CR);
172} 172}
173 173
174static void handle_rx(struct uart_port *port) 174static void msm_handle_rx(struct uart_port *port)
175{ 175{
176 struct tty_port *tport = &port->state->port; 176 struct tty_port *tport = &port->state->port;
177 unsigned int sr; 177 unsigned int sr;
@@ -224,14 +224,14 @@ static void handle_rx(struct uart_port *port)
224 spin_lock(&port->lock); 224 spin_lock(&port->lock);
225} 225}
226 226
227static void reset_dm_count(struct uart_port *port, int count) 227static void msm_reset_dm_count(struct uart_port *port, int count)
228{ 228{
229 wait_for_xmitr(port); 229 msm_wait_for_xmitr(port);
230 msm_write(port, count, UARTDM_NCF_TX); 230 msm_write(port, count, UARTDM_NCF_TX);
231 msm_read(port, UARTDM_NCF_TX); 231 msm_read(port, UARTDM_NCF_TX);
232} 232}
233 233
234static void handle_tx(struct uart_port *port) 234static void msm_handle_tx(struct uart_port *port)
235{ 235{
236 struct circ_buf *xmit = &port->state->xmit; 236 struct circ_buf *xmit = &port->state->xmit;
237 struct msm_port *msm_port = UART_TO_MSM(port); 237 struct msm_port *msm_port = UART_TO_MSM(port);
@@ -250,13 +250,13 @@ static void handle_tx(struct uart_port *port)
250 250
251 if (port->x_char) { 251 if (port->x_char) {
252 if (msm_port->is_uartdm) 252 if (msm_port->is_uartdm)
253 reset_dm_count(port, tx_count + 1); 253 msm_reset_dm_count(port, tx_count + 1);
254 254
255 iowrite8_rep(tf, &port->x_char, 1); 255 iowrite8_rep(tf, &port->x_char, 1);
256 port->icount.tx++; 256 port->icount.tx++;
257 port->x_char = 0; 257 port->x_char = 0;
258 } else if (tx_count && msm_port->is_uartdm) { 258 } else if (tx_count && msm_port->is_uartdm) {
259 reset_dm_count(port, tx_count); 259 msm_reset_dm_count(port, tx_count);
260 } 260 }
261 261
262 while (tf_pointer < tx_count) { 262 while (tf_pointer < tx_count) {
@@ -290,14 +290,14 @@ static void handle_tx(struct uart_port *port)
290 uart_write_wakeup(port); 290 uart_write_wakeup(port);
291} 291}
292 292
293static void handle_delta_cts(struct uart_port *port) 293static void msm_handle_delta_cts(struct uart_port *port)
294{ 294{
295 msm_write(port, UART_CR_CMD_RESET_CTS, UART_CR); 295 msm_write(port, UART_CR_CMD_RESET_CTS, UART_CR);
296 port->icount.cts++; 296 port->icount.cts++;
297 wake_up_interruptible(&port->state->port.delta_msr_wait); 297 wake_up_interruptible(&port->state->port.delta_msr_wait);
298} 298}
299 299
300static irqreturn_t msm_irq(int irq, void *dev_id) 300static irqreturn_t msm_uart_irq(int irq, void *dev_id)
301{ 301{
302 struct uart_port *port = dev_id; 302 struct uart_port *port = dev_id;
303 struct msm_port *msm_port = UART_TO_MSM(port); 303 struct msm_port *msm_port = UART_TO_MSM(port);
@@ -314,14 +314,14 @@ static irqreturn_t msm_irq(int irq, void *dev_id)
314 314
315 if (misr & (UART_IMR_RXLEV | UART_IMR_RXSTALE)) { 315 if (misr & (UART_IMR_RXLEV | UART_IMR_RXSTALE)) {
316 if (msm_port->is_uartdm) 316 if (msm_port->is_uartdm)
317 handle_rx_dm(port, misr); 317 msm_handle_rx_dm(port, misr);
318 else 318 else
319 handle_rx(port); 319 msm_handle_rx(port);
320 } 320 }
321 if (misr & UART_IMR_TXLEV) 321 if (misr & UART_IMR_TXLEV)
322 handle_tx(port); 322 msm_handle_tx(port);
323 if (misr & UART_IMR_DELTA_CTS) 323 if (misr & UART_IMR_DELTA_CTS)
324 handle_delta_cts(port); 324 msm_handle_delta_cts(port);
325 325
326 msm_write(port, msm_port->imr, UART_IMR); /* restore interrupt */ 326 msm_write(port, msm_port->imr, UART_IMR); /* restore interrupt */
327 spin_unlock(&port->lock); 327 spin_unlock(&port->lock);
@@ -489,7 +489,7 @@ static int msm_startup(struct uart_port *port)
489 snprintf(msm_port->name, sizeof(msm_port->name), 489 snprintf(msm_port->name, sizeof(msm_port->name),
490 "msm_serial%d", port->line); 490 "msm_serial%d", port->line);
491 491
492 ret = request_irq(port->irq, msm_irq, IRQF_TRIGGER_HIGH, 492 ret = request_irq(port->irq, msm_uart_irq, IRQF_TRIGGER_HIGH,
493 msm_port->name, port); 493 msm_port->name, port);
494 if (unlikely(ret)) 494 if (unlikely(ret))
495 return ret; 495 return ret;
@@ -779,7 +779,7 @@ static void msm_poll_put_char(struct uart_port *port, unsigned char c)
779 msm_write(port, 0, UART_IMR); 779 msm_write(port, 0, UART_IMR);
780 780
781 if (msm_port->is_uartdm) 781 if (msm_port->is_uartdm)
782 reset_dm_count(port, 1); 782 msm_reset_dm_count(port, 1);
783 783
784 /* Wait until FIFO is empty */ 784 /* Wait until FIFO is empty */
785 while (!(msm_read(port, UART_SR) & UART_SR_TX_READY)) 785 while (!(msm_read(port, UART_SR) & UART_SR_TX_READY))
@@ -853,7 +853,7 @@ static struct msm_port msm_uart_ports[] = {
853 853
854#define UART_NR ARRAY_SIZE(msm_uart_ports) 854#define UART_NR ARRAY_SIZE(msm_uart_ports)
855 855
856static inline struct uart_port *get_port_from_line(unsigned int line) 856static inline struct uart_port *msm_get_port_from_line(unsigned int line)
857{ 857{
858 return &msm_uart_ports[line].uart; 858 return &msm_uart_ports[line].uart;
859} 859}
@@ -880,7 +880,7 @@ static void __msm_console_write(struct uart_port *port, const char *s,
880 880
881 spin_lock(&port->lock); 881 spin_lock(&port->lock);
882 if (is_uartdm) 882 if (is_uartdm)
883 reset_dm_count(port, count); 883 msm_reset_dm_count(port, count);
884 884
885 i = 0; 885 i = 0;
886 while (i < count) { 886 while (i < count) {
@@ -925,7 +925,7 @@ static void msm_console_write(struct console *co, const char *s,
925 925
926 BUG_ON(co->index < 0 || co->index >= UART_NR); 926 BUG_ON(co->index < 0 || co->index >= UART_NR);
927 927
928 port = get_port_from_line(co->index); 928 port = msm_get_port_from_line(co->index);
929 msm_port = UART_TO_MSM(port); 929 msm_port = UART_TO_MSM(port);
930 930
931 __msm_console_write(port, s, count, msm_port->is_uartdm); 931 __msm_console_write(port, s, count, msm_port->is_uartdm);
@@ -942,7 +942,7 @@ static int __init msm_console_setup(struct console *co, char *options)
942 if (unlikely(co->index >= UART_NR || co->index < 0)) 942 if (unlikely(co->index >= UART_NR || co->index < 0))
943 return -ENXIO; 943 return -ENXIO;
944 944
945 port = get_port_from_line(co->index); 945 port = msm_get_port_from_line(co->index);
946 946
947 if (unlikely(!port->membase)) 947 if (unlikely(!port->membase))
948 return -ENXIO; 948 return -ENXIO;
@@ -1057,7 +1057,7 @@ static int msm_serial_probe(struct platform_device *pdev)
1057 1057
1058 dev_info(&pdev->dev, "msm_serial: detected port #%d\n", line); 1058 dev_info(&pdev->dev, "msm_serial: detected port #%d\n", line);
1059 1059
1060 port = get_port_from_line(line); 1060 port = msm_get_port_from_line(line);
1061 port->dev = &pdev->dev; 1061 port->dev = &pdev->dev;
1062 msm_port = UART_TO_MSM(port); 1062 msm_port = UART_TO_MSM(port);
1063 1063