diff options
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/8250/8250.c | 12 | ||||
-rw-r--r-- | drivers/tty/serial/8250/8250_pci.c | 16 | ||||
-rw-r--r-- | drivers/tty/serial/Kconfig | 2 | ||||
-rw-r--r-- | drivers/tty/serial/altera_uart.c | 4 | ||||
-rw-r--r-- | drivers/tty/serial/amba-pl011.c | 8 | ||||
-rw-r--r-- | drivers/tty/serial/atmel_serial.c | 4 | ||||
-rw-r--r-- | drivers/tty/serial/clps711x.c | 14 | ||||
-rw-r--r-- | drivers/tty/serial/mfd.c | 9 | ||||
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 43 | ||||
-rw-r--r-- | drivers/tty/serial/pch_uart.c | 20 | ||||
-rw-r--r-- | drivers/tty/serial/pmac_zilog.c | 6 | ||||
-rw-r--r-- | drivers/tty/serial/samsung.c | 1 | ||||
-rw-r--r-- | drivers/tty/serial/sh-sci.c | 167 | ||||
-rw-r--r-- | drivers/tty/serial/sh-sci.h | 8 | ||||
-rw-r--r-- | drivers/tty/serial/sunzilog.c | 4 |
15 files changed, 153 insertions, 165 deletions
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c index 5b149b466ec8..5c27f7e6c9f1 100644 --- a/drivers/tty/serial/8250/8250.c +++ b/drivers/tty/serial/8250/8250.c | |||
@@ -1572,13 +1572,11 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id) | |||
1572 | do { | 1572 | do { |
1573 | struct uart_8250_port *up; | 1573 | struct uart_8250_port *up; |
1574 | struct uart_port *port; | 1574 | struct uart_port *port; |
1575 | bool skip; | ||
1576 | 1575 | ||
1577 | up = list_entry(l, struct uart_8250_port, list); | 1576 | up = list_entry(l, struct uart_8250_port, list); |
1578 | port = &up->port; | 1577 | port = &up->port; |
1579 | skip = pass_counter && up->port.flags & UPF_IIR_ONCE; | ||
1580 | 1578 | ||
1581 | if (!skip && port->handle_irq(port)) { | 1579 | if (port->handle_irq(port)) { |
1582 | handled = 1; | 1580 | handled = 1; |
1583 | end = NULL; | 1581 | end = NULL; |
1584 | } else if (end == NULL) | 1582 | } else if (end == NULL) |
@@ -2037,10 +2035,12 @@ static int serial8250_startup(struct uart_port *port) | |||
2037 | spin_unlock_irqrestore(&port->lock, flags); | 2035 | spin_unlock_irqrestore(&port->lock, flags); |
2038 | 2036 | ||
2039 | /* | 2037 | /* |
2040 | * If the interrupt is not reasserted, setup a timer to | 2038 | * If the interrupt is not reasserted, or we otherwise |
2041 | * kick the UART on a regular basis. | 2039 | * don't trust the iir, setup a timer to kick the UART |
2040 | * on a regular basis. | ||
2042 | */ | 2041 | */ |
2043 | if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) { | 2042 | if ((!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) || |
2043 | up->port.flags & UPF_BUG_THRE) { | ||
2044 | up->bugs |= UART_BUG_THRE; | 2044 | up->bugs |= UART_BUG_THRE; |
2045 | pr_debug("ttyS%d - using backup timer\n", | 2045 | pr_debug("ttyS%d - using backup timer\n", |
2046 | serial_index(port)); | 2046 | serial_index(port)); |
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c index da2b0b0a183f..858dca865d6a 100644 --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c | |||
@@ -1096,7 +1096,7 @@ static int kt_serial_setup(struct serial_private *priv, | |||
1096 | const struct pciserial_board *board, | 1096 | const struct pciserial_board *board, |
1097 | struct uart_port *port, int idx) | 1097 | struct uart_port *port, int idx) |
1098 | { | 1098 | { |
1099 | port->flags |= UPF_IIR_ONCE; | 1099 | port->flags |= UPF_BUG_THRE; |
1100 | return skip_tx_en_setup(priv, board, port, idx); | 1100 | return skip_tx_en_setup(priv, board, port, idx); |
1101 | } | 1101 | } |
1102 | 1102 | ||
@@ -1118,18 +1118,6 @@ pci_xr17c154_setup(struct serial_private *priv, | |||
1118 | return pci_default_setup(priv, board, port, idx); | 1118 | return pci_default_setup(priv, board, port, idx); |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | static int try_enable_msi(struct pci_dev *dev) | ||
1122 | { | ||
1123 | /* use msi if available, but fallback to legacy otherwise */ | ||
1124 | pci_enable_msi(dev); | ||
1125 | return 0; | ||
1126 | } | ||
1127 | |||
1128 | static void disable_msi(struct pci_dev *dev) | ||
1129 | { | ||
1130 | pci_disable_msi(dev); | ||
1131 | } | ||
1132 | |||
1133 | #define PCI_VENDOR_ID_SBSMODULARIO 0x124B | 1121 | #define PCI_VENDOR_ID_SBSMODULARIO 0x124B |
1134 | #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B | 1122 | #define PCI_SUBVENDOR_ID_SBSMODULARIO 0x124B |
1135 | #define PCI_DEVICE_ID_OCTPRO 0x0001 | 1123 | #define PCI_DEVICE_ID_OCTPRO 0x0001 |
@@ -1249,9 +1237,7 @@ static struct pci_serial_quirk pci_serial_quirks[] __refdata = { | |||
1249 | .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT, | 1237 | .device = PCI_DEVICE_ID_INTEL_PATSBURG_KT, |
1250 | .subvendor = PCI_ANY_ID, | 1238 | .subvendor = PCI_ANY_ID, |
1251 | .subdevice = PCI_ANY_ID, | 1239 | .subdevice = PCI_ANY_ID, |
1252 | .init = try_enable_msi, | ||
1253 | .setup = kt_serial_setup, | 1240 | .setup = kt_serial_setup, |
1254 | .exit = disable_msi, | ||
1255 | }, | 1241 | }, |
1256 | /* | 1242 | /* |
1257 | * ITE | 1243 | * ITE |
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 665beb68f670..070b442c1f81 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig | |||
@@ -1041,7 +1041,7 @@ config SERIAL_OMAP | |||
1041 | 1041 | ||
1042 | config SERIAL_OMAP_CONSOLE | 1042 | config SERIAL_OMAP_CONSOLE |
1043 | bool "Console on OMAP serial port" | 1043 | bool "Console on OMAP serial port" |
1044 | depends on SERIAL_OMAP | 1044 | depends on SERIAL_OMAP=y |
1045 | select SERIAL_CORE_CONSOLE | 1045 | select SERIAL_CORE_CONSOLE |
1046 | help | 1046 | help |
1047 | Select this option if you would like to use omap serial port as | 1047 | Select this option if you would like to use omap serial port as |
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c index e7903751e058..1f0330915d5a 100644 --- a/drivers/tty/serial/altera_uart.c +++ b/drivers/tty/serial/altera_uart.c | |||
@@ -556,7 +556,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev) | |||
556 | res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 556 | res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
557 | if (res_mem) | 557 | if (res_mem) |
558 | port->mapbase = res_mem->start; | 558 | port->mapbase = res_mem->start; |
559 | else if (platp->mapbase) | 559 | else if (platp) |
560 | port->mapbase = platp->mapbase; | 560 | port->mapbase = platp->mapbase; |
561 | else | 561 | else |
562 | return -EINVAL; | 562 | return -EINVAL; |
@@ -564,7 +564,7 @@ static int __devinit altera_uart_probe(struct platform_device *pdev) | |||
564 | res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 564 | res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
565 | if (res_irq) | 565 | if (res_irq) |
566 | port->irq = res_irq->start; | 566 | port->irq = res_irq->start; |
567 | else if (platp->irq) | 567 | else if (platp) |
568 | port->irq = platp->irq; | 568 | port->irq = platp->irq; |
569 | 569 | ||
570 | /* Check platform data first so we can override device node data */ | 570 | /* Check platform data first so we can override device node data */ |
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 0c65c9e66986..3d569cd68f58 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c | |||
@@ -1946,10 +1946,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) | |||
1946 | goto unmap; | 1946 | goto unmap; |
1947 | } | 1947 | } |
1948 | 1948 | ||
1949 | /* Ensure interrupts from this UART are masked and cleared */ | ||
1950 | writew(0, uap->port.membase + UART011_IMSC); | ||
1951 | writew(0xffff, uap->port.membase + UART011_ICR); | ||
1952 | |||
1953 | uap->vendor = vendor; | 1949 | uap->vendor = vendor; |
1954 | uap->lcrh_rx = vendor->lcrh_rx; | 1950 | uap->lcrh_rx = vendor->lcrh_rx; |
1955 | uap->lcrh_tx = vendor->lcrh_tx; | 1951 | uap->lcrh_tx = vendor->lcrh_tx; |
@@ -1967,6 +1963,10 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) | |||
1967 | uap->port.line = i; | 1963 | uap->port.line = i; |
1968 | pl011_dma_probe(uap); | 1964 | pl011_dma_probe(uap); |
1969 | 1965 | ||
1966 | /* Ensure interrupts from this UART are masked and cleared */ | ||
1967 | writew(0, uap->port.membase + UART011_IMSC); | ||
1968 | writew(0xffff, uap->port.membase + UART011_ICR); | ||
1969 | |||
1970 | snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev)); | 1970 | snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev)); |
1971 | 1971 | ||
1972 | amba_ports[i] = uap; | 1972 | amba_ports[i] = uap; |
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index f9a6be7a9bed..3d7e1ee2fa57 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c | |||
@@ -389,6 +389,8 @@ static void atmel_start_rx(struct uart_port *port) | |||
389 | { | 389 | { |
390 | UART_PUT_CR(port, ATMEL_US_RSTSTA); /* reset status and receiver */ | 390 | UART_PUT_CR(port, ATMEL_US_RSTSTA); /* reset status and receiver */ |
391 | 391 | ||
392 | UART_PUT_CR(port, ATMEL_US_RXEN); | ||
393 | |||
392 | if (atmel_use_dma_rx(port)) { | 394 | if (atmel_use_dma_rx(port)) { |
393 | /* enable PDC controller */ | 395 | /* enable PDC controller */ |
394 | UART_PUT_IER(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT | | 396 | UART_PUT_IER(port, ATMEL_US_ENDRX | ATMEL_US_TIMEOUT | |
@@ -404,6 +406,8 @@ static void atmel_start_rx(struct uart_port *port) | |||
404 | */ | 406 | */ |
405 | static void atmel_stop_rx(struct uart_port *port) | 407 | static void atmel_stop_rx(struct uart_port *port) |
406 | { | 408 | { |
409 | UART_PUT_CR(port, ATMEL_US_RXDIS); | ||
410 | |||
407 | if (atmel_use_dma_rx(port)) { | 411 | if (atmel_use_dma_rx(port)) { |
408 | /* disable PDC receive */ | 412 | /* disable PDC receive */ |
409 | UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS); | 413 | UART_PUT_PTCR(port, ATMEL_PDC_RXTDIS); |
diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c index e6c3dbd781d6..836fe2731234 100644 --- a/drivers/tty/serial/clps711x.c +++ b/drivers/tty/serial/clps711x.c | |||
@@ -154,10 +154,9 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id) | |||
154 | port->x_char = 0; | 154 | port->x_char = 0; |
155 | return IRQ_HANDLED; | 155 | return IRQ_HANDLED; |
156 | } | 156 | } |
157 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) { | 157 | |
158 | clps711xuart_stop_tx(port); | 158 | if (uart_circ_empty(xmit) || uart_tx_stopped(port)) |
159 | return IRQ_HANDLED; | 159 | goto disable_tx_irq; |
160 | } | ||
161 | 160 | ||
162 | count = port->fifosize >> 1; | 161 | count = port->fifosize >> 1; |
163 | do { | 162 | do { |
@@ -171,8 +170,11 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id) | |||
171 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 170 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
172 | uart_write_wakeup(port); | 171 | uart_write_wakeup(port); |
173 | 172 | ||
174 | if (uart_circ_empty(xmit)) | 173 | if (uart_circ_empty(xmit)) { |
175 | clps711xuart_stop_tx(port); | 174 | disable_tx_irq: |
175 | disable_irq_nosync(TX_IRQ(port)); | ||
176 | tx_enabled(port) = 0; | ||
177 | } | ||
176 | 178 | ||
177 | return IRQ_HANDLED; | 179 | return IRQ_HANDLED; |
178 | } | 180 | } |
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c index a9234ba8f8d5..c4b50af46c44 100644 --- a/drivers/tty/serial/mfd.c +++ b/drivers/tty/serial/mfd.c | |||
@@ -127,11 +127,6 @@ static inline void serial_out(struct uart_hsu_port *up, int offset, int value) | |||
127 | 127 | ||
128 | #define HSU_REGS_BUFSIZE 1024 | 128 | #define HSU_REGS_BUFSIZE 1024 |
129 | 129 | ||
130 | static int hsu_show_regs_open(struct inode *inode, struct file *file) | ||
131 | { | ||
132 | file->private_data = inode->i_private; | ||
133 | return 0; | ||
134 | } | ||
135 | 130 | ||
136 | static ssize_t port_show_regs(struct file *file, char __user *user_buf, | 131 | static ssize_t port_show_regs(struct file *file, char __user *user_buf, |
137 | size_t count, loff_t *ppos) | 132 | size_t count, loff_t *ppos) |
@@ -231,14 +226,14 @@ static ssize_t dma_show_regs(struct file *file, char __user *user_buf, | |||
231 | 226 | ||
232 | static const struct file_operations port_regs_ops = { | 227 | static const struct file_operations port_regs_ops = { |
233 | .owner = THIS_MODULE, | 228 | .owner = THIS_MODULE, |
234 | .open = hsu_show_regs_open, | 229 | .open = simple_open, |
235 | .read = port_show_regs, | 230 | .read = port_show_regs, |
236 | .llseek = default_llseek, | 231 | .llseek = default_llseek, |
237 | }; | 232 | }; |
238 | 233 | ||
239 | static const struct file_operations dma_regs_ops = { | 234 | static const struct file_operations dma_regs_ops = { |
240 | .owner = THIS_MODULE, | 235 | .owner = THIS_MODULE, |
241 | .open = hsu_show_regs_open, | 236 | .open = simple_open, |
242 | .read = dma_show_regs, | 237 | .read = dma_show_regs, |
243 | .llseek = default_llseek, | 238 | .llseek = default_llseek, |
244 | }; | 239 | }; |
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 0121486ac4fa..d00b38eb268e 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c | |||
@@ -1381,29 +1381,24 @@ static int serial_omap_probe(struct platform_device *pdev) | |||
1381 | return -ENODEV; | 1381 | return -ENODEV; |
1382 | } | 1382 | } |
1383 | 1383 | ||
1384 | if (!request_mem_region(mem->start, resource_size(mem), | 1384 | if (!devm_request_mem_region(&pdev->dev, mem->start, resource_size(mem), |
1385 | pdev->dev.driver->name)) { | 1385 | pdev->dev.driver->name)) { |
1386 | dev_err(&pdev->dev, "memory region already claimed\n"); | 1386 | dev_err(&pdev->dev, "memory region already claimed\n"); |
1387 | return -EBUSY; | 1387 | return -EBUSY; |
1388 | } | 1388 | } |
1389 | 1389 | ||
1390 | dma_rx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); | 1390 | dma_rx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); |
1391 | if (!dma_rx) { | 1391 | if (!dma_rx) |
1392 | ret = -EINVAL; | 1392 | return -ENXIO; |
1393 | goto err; | ||
1394 | } | ||
1395 | 1393 | ||
1396 | dma_tx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); | 1394 | dma_tx = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); |
1397 | if (!dma_tx) { | 1395 | if (!dma_tx) |
1398 | ret = -EINVAL; | 1396 | return -ENXIO; |
1399 | goto err; | 1397 | |
1400 | } | 1398 | up = devm_kzalloc(&pdev->dev, sizeof(*up), GFP_KERNEL); |
1399 | if (!up) | ||
1400 | return -ENOMEM; | ||
1401 | 1401 | ||
1402 | up = kzalloc(sizeof(*up), GFP_KERNEL); | ||
1403 | if (up == NULL) { | ||
1404 | ret = -ENOMEM; | ||
1405 | goto do_release_region; | ||
1406 | } | ||
1407 | up->pdev = pdev; | 1402 | up->pdev = pdev; |
1408 | up->port.dev = &pdev->dev; | 1403 | up->port.dev = &pdev->dev; |
1409 | up->port.type = PORT_OMAP; | 1404 | up->port.type = PORT_OMAP; |
@@ -1423,16 +1418,17 @@ static int serial_omap_probe(struct platform_device *pdev) | |||
1423 | dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n", | 1418 | dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n", |
1424 | up->port.line); | 1419 | up->port.line); |
1425 | ret = -ENODEV; | 1420 | ret = -ENODEV; |
1426 | goto err; | 1421 | goto err_port_line; |
1427 | } | 1422 | } |
1428 | 1423 | ||
1429 | sprintf(up->name, "OMAP UART%d", up->port.line); | 1424 | sprintf(up->name, "OMAP UART%d", up->port.line); |
1430 | up->port.mapbase = mem->start; | 1425 | up->port.mapbase = mem->start; |
1431 | up->port.membase = ioremap(mem->start, resource_size(mem)); | 1426 | up->port.membase = devm_ioremap(&pdev->dev, mem->start, |
1427 | resource_size(mem)); | ||
1432 | if (!up->port.membase) { | 1428 | if (!up->port.membase) { |
1433 | dev_err(&pdev->dev, "can't ioremap UART\n"); | 1429 | dev_err(&pdev->dev, "can't ioremap UART\n"); |
1434 | ret = -ENOMEM; | 1430 | ret = -ENOMEM; |
1435 | goto err; | 1431 | goto err_ioremap; |
1436 | } | 1432 | } |
1437 | 1433 | ||
1438 | up->port.flags = omap_up_info->flags; | 1434 | up->port.flags = omap_up_info->flags; |
@@ -1478,16 +1474,19 @@ static int serial_omap_probe(struct platform_device *pdev) | |||
1478 | 1474 | ||
1479 | ret = uart_add_one_port(&serial_omap_reg, &up->port); | 1475 | ret = uart_add_one_port(&serial_omap_reg, &up->port); |
1480 | if (ret != 0) | 1476 | if (ret != 0) |
1481 | goto do_release_region; | 1477 | goto err_add_port; |
1482 | 1478 | ||
1483 | pm_runtime_put(&pdev->dev); | 1479 | pm_runtime_put(&pdev->dev); |
1484 | platform_set_drvdata(pdev, up); | 1480 | platform_set_drvdata(pdev, up); |
1485 | return 0; | 1481 | return 0; |
1486 | err: | 1482 | |
1483 | err_add_port: | ||
1484 | pm_runtime_put(&pdev->dev); | ||
1485 | pm_runtime_disable(&pdev->dev); | ||
1486 | err_ioremap: | ||
1487 | err_port_line: | ||
1487 | dev_err(&pdev->dev, "[UART%d]: failure [%s]: %d\n", | 1488 | dev_err(&pdev->dev, "[UART%d]: failure [%s]: %d\n", |
1488 | pdev->id, __func__, ret); | 1489 | pdev->id, __func__, ret); |
1489 | do_release_region: | ||
1490 | release_mem_region(mem->start, resource_size(mem)); | ||
1491 | return ret; | 1490 | return ret; |
1492 | } | 1491 | } |
1493 | 1492 | ||
@@ -1499,8 +1498,6 @@ static int serial_omap_remove(struct platform_device *dev) | |||
1499 | pm_runtime_disable(&up->pdev->dev); | 1498 | pm_runtime_disable(&up->pdev->dev); |
1500 | uart_remove_one_port(&serial_omap_reg, &up->port); | 1499 | uart_remove_one_port(&serial_omap_reg, &up->port); |
1501 | pm_qos_remove_request(&up->pm_qos_request); | 1500 | pm_qos_remove_request(&up->pm_qos_request); |
1502 | |||
1503 | kfree(up); | ||
1504 | } | 1501 | } |
1505 | 1502 | ||
1506 | platform_set_drvdata(dev, NULL); | 1503 | platform_set_drvdata(dev, NULL); |
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index e825460478be..c2816f494807 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c | |||
@@ -210,6 +210,7 @@ enum { | |||
210 | #define CMITC_UARTCLK 192000000 /* 192.0000 MHz */ | 210 | #define CMITC_UARTCLK 192000000 /* 192.0000 MHz */ |
211 | #define FRI2_64_UARTCLK 64000000 /* 64.0000 MHz */ | 211 | #define FRI2_64_UARTCLK 64000000 /* 64.0000 MHz */ |
212 | #define FRI2_48_UARTCLK 48000000 /* 48.0000 MHz */ | 212 | #define FRI2_48_UARTCLK 48000000 /* 48.0000 MHz */ |
213 | #define NTC1_UARTCLK 64000000 /* 64.0000 MHz */ | ||
213 | 214 | ||
214 | struct pch_uart_buffer { | 215 | struct pch_uart_buffer { |
215 | unsigned char *buf; | 216 | unsigned char *buf; |
@@ -304,11 +305,7 @@ static const int trigger_level_1[4] = { 1, 1, 1, 1 }; | |||
304 | #ifdef CONFIG_DEBUG_FS | 305 | #ifdef CONFIG_DEBUG_FS |
305 | 306 | ||
306 | #define PCH_REGS_BUFSIZE 1024 | 307 | #define PCH_REGS_BUFSIZE 1024 |
307 | static int pch_show_regs_open(struct inode *inode, struct file *file) | 308 | |
308 | { | ||
309 | file->private_data = inode->i_private; | ||
310 | return 0; | ||
311 | } | ||
312 | 309 | ||
313 | static ssize_t port_show_regs(struct file *file, char __user *user_buf, | 310 | static ssize_t port_show_regs(struct file *file, char __user *user_buf, |
314 | size_t count, loff_t *ppos) | 311 | size_t count, loff_t *ppos) |
@@ -362,7 +359,7 @@ static ssize_t port_show_regs(struct file *file, char __user *user_buf, | |||
362 | 359 | ||
363 | static const struct file_operations port_regs_ops = { | 360 | static const struct file_operations port_regs_ops = { |
364 | .owner = THIS_MODULE, | 361 | .owner = THIS_MODULE, |
365 | .open = pch_show_regs_open, | 362 | .open = simple_open, |
366 | .read = port_show_regs, | 363 | .read = port_show_regs, |
367 | .llseek = default_llseek, | 364 | .llseek = default_llseek, |
368 | }; | 365 | }; |
@@ -388,6 +385,12 @@ static int pch_uart_get_uartclk(void) | |||
388 | if (cmp && strstr(cmp, "Fish River Island II")) | 385 | if (cmp && strstr(cmp, "Fish River Island II")) |
389 | return FRI2_48_UARTCLK; | 386 | return FRI2_48_UARTCLK; |
390 | 387 | ||
388 | /* Kontron COMe-mTT10 (nanoETXexpress-TT) */ | ||
389 | cmp = dmi_get_system_info(DMI_BOARD_NAME); | ||
390 | if (cmp && (strstr(cmp, "COMe-mTT") || | ||
391 | strstr(cmp, "nanoETXexpress-TT"))) | ||
392 | return NTC1_UARTCLK; | ||
393 | |||
391 | return DEFAULT_UARTCLK; | 394 | return DEFAULT_UARTCLK; |
392 | } | 395 | } |
393 | 396 | ||
@@ -1444,9 +1447,11 @@ static int pch_uart_verify_port(struct uart_port *port, | |||
1444 | __func__); | 1447 | __func__); |
1445 | return -EOPNOTSUPP; | 1448 | return -EOPNOTSUPP; |
1446 | #endif | 1449 | #endif |
1447 | priv->use_dma = 1; | ||
1448 | priv->use_dma_flag = 1; | 1450 | priv->use_dma_flag = 1; |
1449 | dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n"); | 1451 | dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n"); |
1452 | if (!priv->use_dma) | ||
1453 | pch_request_dma(port); | ||
1454 | priv->use_dma = 1; | ||
1450 | } | 1455 | } |
1451 | 1456 | ||
1452 | return 0; | 1457 | return 0; |
@@ -1655,6 +1660,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, | |||
1655 | } | 1660 | } |
1656 | 1661 | ||
1657 | pci_enable_msi(pdev); | 1662 | pci_enable_msi(pdev); |
1663 | pci_set_master(pdev); | ||
1658 | 1664 | ||
1659 | iobase = pci_resource_start(pdev, 0); | 1665 | iobase = pci_resource_start(pdev, 0); |
1660 | mapbase = pci_resource_start(pdev, 1); | 1666 | mapbase = pci_resource_start(pdev, 1); |
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 08ebe901bb59..654755a990df 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c | |||
@@ -469,7 +469,7 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) | |||
469 | tty = NULL; | 469 | tty = NULL; |
470 | if (r3 & (CHAEXT | CHATxIP | CHARxIP)) { | 470 | if (r3 & (CHAEXT | CHATxIP | CHARxIP)) { |
471 | if (!ZS_IS_OPEN(uap_a)) { | 471 | if (!ZS_IS_OPEN(uap_a)) { |
472 | pmz_debug("ChanA interrupt while open !\n"); | 472 | pmz_debug("ChanA interrupt while not open !\n"); |
473 | goto skip_a; | 473 | goto skip_a; |
474 | } | 474 | } |
475 | write_zsreg(uap_a, R0, RES_H_IUS); | 475 | write_zsreg(uap_a, R0, RES_H_IUS); |
@@ -493,8 +493,8 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) | |||
493 | spin_lock(&uap_b->port.lock); | 493 | spin_lock(&uap_b->port.lock); |
494 | tty = NULL; | 494 | tty = NULL; |
495 | if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) { | 495 | if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) { |
496 | if (!ZS_IS_OPEN(uap_a)) { | 496 | if (!ZS_IS_OPEN(uap_b)) { |
497 | pmz_debug("ChanB interrupt while open !\n"); | 497 | pmz_debug("ChanB interrupt while not open !\n"); |
498 | goto skip_b; | 498 | goto skip_b; |
499 | } | 499 | } |
500 | write_zsreg(uap_b, R0, RES_H_IUS); | 500 | write_zsreg(uap_b, R0, RES_H_IUS); |
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index de249d265bec..d8b0aee35632 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c | |||
@@ -982,6 +982,7 @@ static void s3c24xx_serial_resetport(struct uart_port *port, | |||
982 | 982 | ||
983 | ucon &= ucon_mask; | 983 | ucon &= ucon_mask; |
984 | wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); | 984 | wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); |
985 | wr_regl(port, S3C2410_ULCON, cfg->ulcon); | ||
985 | 986 | ||
986 | /* reset both fifos */ | 987 | /* reset both fifos */ |
987 | wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); | 988 | wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); |
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index bf461cf99616..3158e17b665c 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -355,9 +355,6 @@ static void sci_serial_out(struct uart_port *p, int offset, int value) | |||
355 | WARN(1, "Invalid register access\n"); | 355 | WARN(1, "Invalid register access\n"); |
356 | } | 356 | } |
357 | 357 | ||
358 | #define sci_in(up, offset) (up->serial_in(up, offset)) | ||
359 | #define sci_out(up, offset, value) (up->serial_out(up, offset, value)) | ||
360 | |||
361 | static int sci_probe_regmap(struct plat_sci_port *cfg) | 358 | static int sci_probe_regmap(struct plat_sci_port *cfg) |
362 | { | 359 | { |
363 | switch (cfg->type) { | 360 | switch (cfg->type) { |
@@ -422,9 +419,9 @@ static int sci_poll_get_char(struct uart_port *port) | |||
422 | int c; | 419 | int c; |
423 | 420 | ||
424 | do { | 421 | do { |
425 | status = sci_in(port, SCxSR); | 422 | status = serial_port_in(port, SCxSR); |
426 | if (status & SCxSR_ERRORS(port)) { | 423 | if (status & SCxSR_ERRORS(port)) { |
427 | sci_out(port, SCxSR, SCxSR_ERROR_CLEAR(port)); | 424 | serial_port_out(port, SCxSR, SCxSR_ERROR_CLEAR(port)); |
428 | continue; | 425 | continue; |
429 | } | 426 | } |
430 | break; | 427 | break; |
@@ -433,11 +430,11 @@ static int sci_poll_get_char(struct uart_port *port) | |||
433 | if (!(status & SCxSR_RDxF(port))) | 430 | if (!(status & SCxSR_RDxF(port))) |
434 | return NO_POLL_CHAR; | 431 | return NO_POLL_CHAR; |
435 | 432 | ||
436 | c = sci_in(port, SCxRDR); | 433 | c = serial_port_in(port, SCxRDR); |
437 | 434 | ||
438 | /* Dummy read */ | 435 | /* Dummy read */ |
439 | sci_in(port, SCxSR); | 436 | serial_port_in(port, SCxSR); |
440 | sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); | 437 | serial_port_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); |
441 | 438 | ||
442 | return c; | 439 | return c; |
443 | } | 440 | } |
@@ -448,11 +445,11 @@ static void sci_poll_put_char(struct uart_port *port, unsigned char c) | |||
448 | unsigned short status; | 445 | unsigned short status; |
449 | 446 | ||
450 | do { | 447 | do { |
451 | status = sci_in(port, SCxSR); | 448 | status = serial_port_in(port, SCxSR); |
452 | } while (!(status & SCxSR_TDxE(port))); | 449 | } while (!(status & SCxSR_TDxE(port))); |
453 | 450 | ||
454 | sci_out(port, SCxTDR, c); | 451 | serial_port_out(port, SCxTDR, c); |
455 | sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port)); | 452 | serial_port_out(port, SCxSR, SCxSR_TDxE_CLEAR(port) & ~SCxSR_TEND(port)); |
456 | } | 453 | } |
457 | #endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */ | 454 | #endif /* CONFIG_CONSOLE_POLL || CONFIG_SERIAL_SH_SCI_CONSOLE */ |
458 | 455 | ||
@@ -480,10 +477,10 @@ static void sci_init_pins(struct uart_port *port, unsigned int cflag) | |||
480 | ((!(cflag & CRTSCTS)))) { | 477 | ((!(cflag & CRTSCTS)))) { |
481 | unsigned short status; | 478 | unsigned short status; |
482 | 479 | ||
483 | status = sci_in(port, SCSPTR); | 480 | status = serial_port_in(port, SCSPTR); |
484 | status &= ~SCSPTR_CTSIO; | 481 | status &= ~SCSPTR_CTSIO; |
485 | status |= SCSPTR_RTSIO; | 482 | status |= SCSPTR_RTSIO; |
486 | sci_out(port, SCSPTR, status); /* Set RTS = 1 */ | 483 | serial_port_out(port, SCSPTR, status); /* Set RTS = 1 */ |
487 | } | 484 | } |
488 | } | 485 | } |
489 | 486 | ||
@@ -493,13 +490,13 @@ static int sci_txfill(struct uart_port *port) | |||
493 | 490 | ||
494 | reg = sci_getreg(port, SCTFDR); | 491 | reg = sci_getreg(port, SCTFDR); |
495 | if (reg->size) | 492 | if (reg->size) |
496 | return sci_in(port, SCTFDR) & 0xff; | 493 | return serial_port_in(port, SCTFDR) & 0xff; |
497 | 494 | ||
498 | reg = sci_getreg(port, SCFDR); | 495 | reg = sci_getreg(port, SCFDR); |
499 | if (reg->size) | 496 | if (reg->size) |
500 | return sci_in(port, SCFDR) >> 8; | 497 | return serial_port_in(port, SCFDR) >> 8; |
501 | 498 | ||
502 | return !(sci_in(port, SCxSR) & SCI_TDRE); | 499 | return !(serial_port_in(port, SCxSR) & SCI_TDRE); |
503 | } | 500 | } |
504 | 501 | ||
505 | static int sci_txroom(struct uart_port *port) | 502 | static int sci_txroom(struct uart_port *port) |
@@ -513,13 +510,13 @@ static int sci_rxfill(struct uart_port *port) | |||
513 | 510 | ||
514 | reg = sci_getreg(port, SCRFDR); | 511 | reg = sci_getreg(port, SCRFDR); |
515 | if (reg->size) | 512 | if (reg->size) |
516 | return sci_in(port, SCRFDR) & 0xff; | 513 | return serial_port_in(port, SCRFDR) & 0xff; |
517 | 514 | ||
518 | reg = sci_getreg(port, SCFDR); | 515 | reg = sci_getreg(port, SCFDR); |
519 | if (reg->size) | 516 | if (reg->size) |
520 | return sci_in(port, SCFDR) & ((port->fifosize << 1) - 1); | 517 | return serial_port_in(port, SCFDR) & ((port->fifosize << 1) - 1); |
521 | 518 | ||
522 | return (sci_in(port, SCxSR) & SCxSR_RDxF(port)) != 0; | 519 | return (serial_port_in(port, SCxSR) & SCxSR_RDxF(port)) != 0; |
523 | } | 520 | } |
524 | 521 | ||
525 | /* | 522 | /* |
@@ -547,14 +544,14 @@ static void sci_transmit_chars(struct uart_port *port) | |||
547 | unsigned short ctrl; | 544 | unsigned short ctrl; |
548 | int count; | 545 | int count; |
549 | 546 | ||
550 | status = sci_in(port, SCxSR); | 547 | status = serial_port_in(port, SCxSR); |
551 | if (!(status & SCxSR_TDxE(port))) { | 548 | if (!(status & SCxSR_TDxE(port))) { |
552 | ctrl = sci_in(port, SCSCR); | 549 | ctrl = serial_port_in(port, SCSCR); |
553 | if (uart_circ_empty(xmit)) | 550 | if (uart_circ_empty(xmit)) |
554 | ctrl &= ~SCSCR_TIE; | 551 | ctrl &= ~SCSCR_TIE; |
555 | else | 552 | else |
556 | ctrl |= SCSCR_TIE; | 553 | ctrl |= SCSCR_TIE; |
557 | sci_out(port, SCSCR, ctrl); | 554 | serial_port_out(port, SCSCR, ctrl); |
558 | return; | 555 | return; |
559 | } | 556 | } |
560 | 557 | ||
@@ -573,27 +570,27 @@ static void sci_transmit_chars(struct uart_port *port) | |||
573 | break; | 570 | break; |
574 | } | 571 | } |
575 | 572 | ||
576 | sci_out(port, SCxTDR, c); | 573 | serial_port_out(port, SCxTDR, c); |
577 | 574 | ||
578 | port->icount.tx++; | 575 | port->icount.tx++; |
579 | } while (--count > 0); | 576 | } while (--count > 0); |
580 | 577 | ||
581 | sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); | 578 | serial_port_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); |
582 | 579 | ||
583 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 580 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
584 | uart_write_wakeup(port); | 581 | uart_write_wakeup(port); |
585 | if (uart_circ_empty(xmit)) { | 582 | if (uart_circ_empty(xmit)) { |
586 | sci_stop_tx(port); | 583 | sci_stop_tx(port); |
587 | } else { | 584 | } else { |
588 | ctrl = sci_in(port, SCSCR); | 585 | ctrl = serial_port_in(port, SCSCR); |
589 | 586 | ||
590 | if (port->type != PORT_SCI) { | 587 | if (port->type != PORT_SCI) { |
591 | sci_in(port, SCxSR); /* Dummy read */ | 588 | serial_port_in(port, SCxSR); /* Dummy read */ |
592 | sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); | 589 | serial_port_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); |
593 | } | 590 | } |
594 | 591 | ||
595 | ctrl |= SCSCR_TIE; | 592 | ctrl |= SCSCR_TIE; |
596 | sci_out(port, SCSCR, ctrl); | 593 | serial_port_out(port, SCSCR, ctrl); |
597 | } | 594 | } |
598 | } | 595 | } |
599 | 596 | ||
@@ -608,7 +605,7 @@ static void sci_receive_chars(struct uart_port *port) | |||
608 | unsigned short status; | 605 | unsigned short status; |
609 | unsigned char flag; | 606 | unsigned char flag; |
610 | 607 | ||
611 | status = sci_in(port, SCxSR); | 608 | status = serial_port_in(port, SCxSR); |
612 | if (!(status & SCxSR_RDxF(port))) | 609 | if (!(status & SCxSR_RDxF(port))) |
613 | return; | 610 | return; |
614 | 611 | ||
@@ -621,7 +618,7 @@ static void sci_receive_chars(struct uart_port *port) | |||
621 | break; | 618 | break; |
622 | 619 | ||
623 | if (port->type == PORT_SCI) { | 620 | if (port->type == PORT_SCI) { |
624 | char c = sci_in(port, SCxRDR); | 621 | char c = serial_port_in(port, SCxRDR); |
625 | if (uart_handle_sysrq_char(port, c) || | 622 | if (uart_handle_sysrq_char(port, c) || |
626 | sci_port->break_flag) | 623 | sci_port->break_flag) |
627 | count = 0; | 624 | count = 0; |
@@ -629,9 +626,9 @@ static void sci_receive_chars(struct uart_port *port) | |||
629 | tty_insert_flip_char(tty, c, TTY_NORMAL); | 626 | tty_insert_flip_char(tty, c, TTY_NORMAL); |
630 | } else { | 627 | } else { |
631 | for (i = 0; i < count; i++) { | 628 | for (i = 0; i < count; i++) { |
632 | char c = sci_in(port, SCxRDR); | 629 | char c = serial_port_in(port, SCxRDR); |
633 | 630 | ||
634 | status = sci_in(port, SCxSR); | 631 | status = serial_port_in(port, SCxSR); |
635 | #if defined(CONFIG_CPU_SH3) | 632 | #if defined(CONFIG_CPU_SH3) |
636 | /* Skip "chars" during break */ | 633 | /* Skip "chars" during break */ |
637 | if (sci_port->break_flag) { | 634 | if (sci_port->break_flag) { |
@@ -672,8 +669,8 @@ static void sci_receive_chars(struct uart_port *port) | |||
672 | } | 669 | } |
673 | } | 670 | } |
674 | 671 | ||
675 | sci_in(port, SCxSR); /* dummy read */ | 672 | serial_port_in(port, SCxSR); /* dummy read */ |
676 | sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); | 673 | serial_port_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); |
677 | 674 | ||
678 | copied += count; | 675 | copied += count; |
679 | port->icount.rx += count; | 676 | port->icount.rx += count; |
@@ -683,8 +680,8 @@ static void sci_receive_chars(struct uart_port *port) | |||
683 | /* Tell the rest of the system the news. New characters! */ | 680 | /* Tell the rest of the system the news. New characters! */ |
684 | tty_flip_buffer_push(tty); | 681 | tty_flip_buffer_push(tty); |
685 | } else { | 682 | } else { |
686 | sci_in(port, SCxSR); /* dummy read */ | 683 | serial_port_in(port, SCxSR); /* dummy read */ |
687 | sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); | 684 | serial_port_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); |
688 | } | 685 | } |
689 | } | 686 | } |
690 | 687 | ||
@@ -726,7 +723,7 @@ static void sci_break_timer(unsigned long data) | |||
726 | static int sci_handle_errors(struct uart_port *port) | 723 | static int sci_handle_errors(struct uart_port *port) |
727 | { | 724 | { |
728 | int copied = 0; | 725 | int copied = 0; |
729 | unsigned short status = sci_in(port, SCxSR); | 726 | unsigned short status = serial_port_in(port, SCxSR); |
730 | struct tty_struct *tty = port->state->port.tty; | 727 | struct tty_struct *tty = port->state->port.tty; |
731 | struct sci_port *s = to_sci_port(port); | 728 | struct sci_port *s = to_sci_port(port); |
732 | 729 | ||
@@ -804,8 +801,8 @@ static int sci_handle_fifo_overrun(struct uart_port *port) | |||
804 | if (!reg->size) | 801 | if (!reg->size) |
805 | return 0; | 802 | return 0; |
806 | 803 | ||
807 | if ((sci_in(port, SCLSR) & (1 << s->cfg->overrun_bit))) { | 804 | if ((serial_port_in(port, SCLSR) & (1 << s->cfg->overrun_bit))) { |
808 | sci_out(port, SCLSR, 0); | 805 | serial_port_out(port, SCLSR, 0); |
809 | 806 | ||
810 | port->icount.overrun++; | 807 | port->icount.overrun++; |
811 | 808 | ||
@@ -822,7 +819,7 @@ static int sci_handle_fifo_overrun(struct uart_port *port) | |||
822 | static int sci_handle_breaks(struct uart_port *port) | 819 | static int sci_handle_breaks(struct uart_port *port) |
823 | { | 820 | { |
824 | int copied = 0; | 821 | int copied = 0; |
825 | unsigned short status = sci_in(port, SCxSR); | 822 | unsigned short status = serial_port_in(port, SCxSR); |
826 | struct tty_struct *tty = port->state->port.tty; | 823 | struct tty_struct *tty = port->state->port.tty; |
827 | struct sci_port *s = to_sci_port(port); | 824 | struct sci_port *s = to_sci_port(port); |
828 | 825 | ||
@@ -859,8 +856,8 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr) | |||
859 | struct sci_port *s = to_sci_port(port); | 856 | struct sci_port *s = to_sci_port(port); |
860 | 857 | ||
861 | if (s->chan_rx) { | 858 | if (s->chan_rx) { |
862 | u16 scr = sci_in(port, SCSCR); | 859 | u16 scr = serial_port_in(port, SCSCR); |
863 | u16 ssr = sci_in(port, SCxSR); | 860 | u16 ssr = serial_port_in(port, SCxSR); |
864 | 861 | ||
865 | /* Disable future Rx interrupts */ | 862 | /* Disable future Rx interrupts */ |
866 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 863 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
@@ -869,9 +866,9 @@ static irqreturn_t sci_rx_interrupt(int irq, void *ptr) | |||
869 | } else { | 866 | } else { |
870 | scr &= ~SCSCR_RIE; | 867 | scr &= ~SCSCR_RIE; |
871 | } | 868 | } |
872 | sci_out(port, SCSCR, scr); | 869 | serial_port_out(port, SCSCR, scr); |
873 | /* Clear current interrupt */ | 870 | /* Clear current interrupt */ |
874 | sci_out(port, SCxSR, ssr & ~(1 | SCxSR_RDxF(port))); | 871 | serial_port_out(port, SCxSR, ssr & ~(1 | SCxSR_RDxF(port))); |
875 | dev_dbg(port->dev, "Rx IRQ %lu: setup t-out in %u jiffies\n", | 872 | dev_dbg(port->dev, "Rx IRQ %lu: setup t-out in %u jiffies\n", |
876 | jiffies, s->rx_timeout); | 873 | jiffies, s->rx_timeout); |
877 | mod_timer(&s->rx_timer, jiffies + s->rx_timeout); | 874 | mod_timer(&s->rx_timer, jiffies + s->rx_timeout); |
@@ -909,15 +906,15 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr) | |||
909 | if (port->type == PORT_SCI) { | 906 | if (port->type == PORT_SCI) { |
910 | if (sci_handle_errors(port)) { | 907 | if (sci_handle_errors(port)) { |
911 | /* discard character in rx buffer */ | 908 | /* discard character in rx buffer */ |
912 | sci_in(port, SCxSR); | 909 | serial_port_in(port, SCxSR); |
913 | sci_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); | 910 | serial_port_out(port, SCxSR, SCxSR_RDxF_CLEAR(port)); |
914 | } | 911 | } |
915 | } else { | 912 | } else { |
916 | sci_handle_fifo_overrun(port); | 913 | sci_handle_fifo_overrun(port); |
917 | sci_rx_interrupt(irq, ptr); | 914 | sci_rx_interrupt(irq, ptr); |
918 | } | 915 | } |
919 | 916 | ||
920 | sci_out(port, SCxSR, SCxSR_ERROR_CLEAR(port)); | 917 | serial_port_out(port, SCxSR, SCxSR_ERROR_CLEAR(port)); |
921 | 918 | ||
922 | /* Kick the transmission */ | 919 | /* Kick the transmission */ |
923 | sci_tx_interrupt(irq, ptr); | 920 | sci_tx_interrupt(irq, ptr); |
@@ -931,7 +928,7 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr) | |||
931 | 928 | ||
932 | /* Handle BREAKs */ | 929 | /* Handle BREAKs */ |
933 | sci_handle_breaks(port); | 930 | sci_handle_breaks(port); |
934 | sci_out(port, SCxSR, SCxSR_BREAK_CLEAR(port)); | 931 | serial_port_out(port, SCxSR, SCxSR_BREAK_CLEAR(port)); |
935 | 932 | ||
936 | return IRQ_HANDLED; | 933 | return IRQ_HANDLED; |
937 | } | 934 | } |
@@ -955,8 +952,8 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) | |||
955 | struct sci_port *s = to_sci_port(port); | 952 | struct sci_port *s = to_sci_port(port); |
956 | irqreturn_t ret = IRQ_NONE; | 953 | irqreturn_t ret = IRQ_NONE; |
957 | 954 | ||
958 | ssr_status = sci_in(port, SCxSR); | 955 | ssr_status = serial_port_in(port, SCxSR); |
959 | scr_status = sci_in(port, SCSCR); | 956 | scr_status = serial_port_in(port, SCSCR); |
960 | err_enabled = scr_status & port_rx_irq_mask(port); | 957 | err_enabled = scr_status & port_rx_irq_mask(port); |
961 | 958 | ||
962 | /* Tx Interrupt */ | 959 | /* Tx Interrupt */ |
@@ -1170,7 +1167,7 @@ static void sci_free_gpios(struct sci_port *port) | |||
1170 | 1167 | ||
1171 | static unsigned int sci_tx_empty(struct uart_port *port) | 1168 | static unsigned int sci_tx_empty(struct uart_port *port) |
1172 | { | 1169 | { |
1173 | unsigned short status = sci_in(port, SCxSR); | 1170 | unsigned short status = serial_port_in(port, SCxSR); |
1174 | unsigned short in_tx_fifo = sci_txfill(port); | 1171 | unsigned short in_tx_fifo = sci_txfill(port); |
1175 | 1172 | ||
1176 | return (status & SCxSR_TEND(port)) && !in_tx_fifo ? TIOCSER_TEMT : 0; | 1173 | return (status & SCxSR_TEND(port)) && !in_tx_fifo ? TIOCSER_TEMT : 0; |
@@ -1198,7 +1195,7 @@ static void sci_set_mctrl(struct uart_port *port, unsigned int mctrl) | |||
1198 | */ | 1195 | */ |
1199 | reg = sci_getreg(port, SCFCR); | 1196 | reg = sci_getreg(port, SCFCR); |
1200 | if (reg->size) | 1197 | if (reg->size) |
1201 | sci_out(port, SCFCR, sci_in(port, SCFCR) | 1); | 1198 | serial_port_out(port, SCFCR, serial_port_in(port, SCFCR) | 1); |
1202 | } | 1199 | } |
1203 | } | 1200 | } |
1204 | 1201 | ||
@@ -1240,8 +1237,8 @@ static void sci_dma_tx_complete(void *arg) | |||
1240 | } else { | 1237 | } else { |
1241 | s->cookie_tx = -EINVAL; | 1238 | s->cookie_tx = -EINVAL; |
1242 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 1239 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
1243 | u16 ctrl = sci_in(port, SCSCR); | 1240 | u16 ctrl = serial_port_in(port, SCSCR); |
1244 | sci_out(port, SCSCR, ctrl & ~SCSCR_TIE); | 1241 | serial_port_out(port, SCSCR, ctrl & ~SCSCR_TIE); |
1245 | } | 1242 | } |
1246 | } | 1243 | } |
1247 | 1244 | ||
@@ -1494,13 +1491,13 @@ static void sci_start_tx(struct uart_port *port) | |||
1494 | 1491 | ||
1495 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | 1492 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |
1496 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 1493 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
1497 | u16 new, scr = sci_in(port, SCSCR); | 1494 | u16 new, scr = serial_port_in(port, SCSCR); |
1498 | if (s->chan_tx) | 1495 | if (s->chan_tx) |
1499 | new = scr | 0x8000; | 1496 | new = scr | 0x8000; |
1500 | else | 1497 | else |
1501 | new = scr & ~0x8000; | 1498 | new = scr & ~0x8000; |
1502 | if (new != scr) | 1499 | if (new != scr) |
1503 | sci_out(port, SCSCR, new); | 1500 | serial_port_out(port, SCSCR, new); |
1504 | } | 1501 | } |
1505 | 1502 | ||
1506 | if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && | 1503 | if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && |
@@ -1512,8 +1509,8 @@ static void sci_start_tx(struct uart_port *port) | |||
1512 | 1509 | ||
1513 | if (!s->chan_tx || port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 1510 | if (!s->chan_tx || port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
1514 | /* Set TIE (Transmit Interrupt Enable) bit in SCSCR */ | 1511 | /* Set TIE (Transmit Interrupt Enable) bit in SCSCR */ |
1515 | ctrl = sci_in(port, SCSCR); | 1512 | ctrl = serial_port_in(port, SCSCR); |
1516 | sci_out(port, SCSCR, ctrl | SCSCR_TIE); | 1513 | serial_port_out(port, SCSCR, ctrl | SCSCR_TIE); |
1517 | } | 1514 | } |
1518 | } | 1515 | } |
1519 | 1516 | ||
@@ -1522,40 +1519,40 @@ static void sci_stop_tx(struct uart_port *port) | |||
1522 | unsigned short ctrl; | 1519 | unsigned short ctrl; |
1523 | 1520 | ||
1524 | /* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */ | 1521 | /* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */ |
1525 | ctrl = sci_in(port, SCSCR); | 1522 | ctrl = serial_port_in(port, SCSCR); |
1526 | 1523 | ||
1527 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) | 1524 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) |
1528 | ctrl &= ~0x8000; | 1525 | ctrl &= ~0x8000; |
1529 | 1526 | ||
1530 | ctrl &= ~SCSCR_TIE; | 1527 | ctrl &= ~SCSCR_TIE; |
1531 | 1528 | ||
1532 | sci_out(port, SCSCR, ctrl); | 1529 | serial_port_out(port, SCSCR, ctrl); |
1533 | } | 1530 | } |
1534 | 1531 | ||
1535 | static void sci_start_rx(struct uart_port *port) | 1532 | static void sci_start_rx(struct uart_port *port) |
1536 | { | 1533 | { |
1537 | unsigned short ctrl; | 1534 | unsigned short ctrl; |
1538 | 1535 | ||
1539 | ctrl = sci_in(port, SCSCR) | port_rx_irq_mask(port); | 1536 | ctrl = serial_port_in(port, SCSCR) | port_rx_irq_mask(port); |
1540 | 1537 | ||
1541 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) | 1538 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) |
1542 | ctrl &= ~0x4000; | 1539 | ctrl &= ~0x4000; |
1543 | 1540 | ||
1544 | sci_out(port, SCSCR, ctrl); | 1541 | serial_port_out(port, SCSCR, ctrl); |
1545 | } | 1542 | } |
1546 | 1543 | ||
1547 | static void sci_stop_rx(struct uart_port *port) | 1544 | static void sci_stop_rx(struct uart_port *port) |
1548 | { | 1545 | { |
1549 | unsigned short ctrl; | 1546 | unsigned short ctrl; |
1550 | 1547 | ||
1551 | ctrl = sci_in(port, SCSCR); | 1548 | ctrl = serial_port_in(port, SCSCR); |
1552 | 1549 | ||
1553 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) | 1550 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) |
1554 | ctrl &= ~0x4000; | 1551 | ctrl &= ~0x4000; |
1555 | 1552 | ||
1556 | ctrl &= ~port_rx_irq_mask(port); | 1553 | ctrl &= ~port_rx_irq_mask(port); |
1557 | 1554 | ||
1558 | sci_out(port, SCSCR, ctrl); | 1555 | serial_port_out(port, SCSCR, ctrl); |
1559 | } | 1556 | } |
1560 | 1557 | ||
1561 | static void sci_enable_ms(struct uart_port *port) | 1558 | static void sci_enable_ms(struct uart_port *port) |
@@ -1589,13 +1586,13 @@ static void rx_timer_fn(unsigned long arg) | |||
1589 | { | 1586 | { |
1590 | struct sci_port *s = (struct sci_port *)arg; | 1587 | struct sci_port *s = (struct sci_port *)arg; |
1591 | struct uart_port *port = &s->port; | 1588 | struct uart_port *port = &s->port; |
1592 | u16 scr = sci_in(port, SCSCR); | 1589 | u16 scr = serial_port_in(port, SCSCR); |
1593 | 1590 | ||
1594 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { | 1591 | if (port->type == PORT_SCIFA || port->type == PORT_SCIFB) { |
1595 | scr &= ~0x4000; | 1592 | scr &= ~0x4000; |
1596 | enable_irq(s->cfg->irqs[1]); | 1593 | enable_irq(s->cfg->irqs[1]); |
1597 | } | 1594 | } |
1598 | sci_out(port, SCSCR, scr | SCSCR_RIE); | 1595 | serial_port_out(port, SCSCR, scr | SCSCR_RIE); |
1599 | dev_dbg(port->dev, "DMA Rx timed out\n"); | 1596 | dev_dbg(port->dev, "DMA Rx timed out\n"); |
1600 | schedule_work(&s->work_rx); | 1597 | schedule_work(&s->work_rx); |
1601 | } | 1598 | } |
@@ -1776,14 +1773,14 @@ static void sci_reset(struct uart_port *port) | |||
1776 | unsigned int status; | 1773 | unsigned int status; |
1777 | 1774 | ||
1778 | do { | 1775 | do { |
1779 | status = sci_in(port, SCxSR); | 1776 | status = serial_port_in(port, SCxSR); |
1780 | } while (!(status & SCxSR_TEND(port))); | 1777 | } while (!(status & SCxSR_TEND(port))); |
1781 | 1778 | ||
1782 | sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ | 1779 | serial_port_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ |
1783 | 1780 | ||
1784 | reg = sci_getreg(port, SCFCR); | 1781 | reg = sci_getreg(port, SCFCR); |
1785 | if (reg->size) | 1782 | if (reg->size) |
1786 | sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); | 1783 | serial_port_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); |
1787 | } | 1784 | } |
1788 | 1785 | ||
1789 | static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | 1786 | static void sci_set_termios(struct uart_port *port, struct ktermios *termios, |
@@ -1812,7 +1809,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1812 | 1809 | ||
1813 | sci_reset(port); | 1810 | sci_reset(port); |
1814 | 1811 | ||
1815 | smr_val = sci_in(port, SCSMR) & 3; | 1812 | smr_val = serial_port_in(port, SCSMR) & 3; |
1816 | 1813 | ||
1817 | if ((termios->c_cflag & CSIZE) == CS7) | 1814 | if ((termios->c_cflag & CSIZE) == CS7) |
1818 | smr_val |= 0x40; | 1815 | smr_val |= 0x40; |
@@ -1825,19 +1822,19 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1825 | 1822 | ||
1826 | uart_update_timeout(port, termios->c_cflag, baud); | 1823 | uart_update_timeout(port, termios->c_cflag, baud); |
1827 | 1824 | ||
1828 | sci_out(port, SCSMR, smr_val); | 1825 | serial_port_out(port, SCSMR, smr_val); |
1829 | 1826 | ||
1830 | dev_dbg(port->dev, "%s: SMR %x, t %x, SCSCR %x\n", __func__, smr_val, t, | 1827 | dev_dbg(port->dev, "%s: SMR %x, t %x, SCSCR %x\n", __func__, smr_val, t, |
1831 | s->cfg->scscr); | 1828 | s->cfg->scscr); |
1832 | 1829 | ||
1833 | if (t > 0) { | 1830 | if (t > 0) { |
1834 | if (t >= 256) { | 1831 | if (t >= 256) { |
1835 | sci_out(port, SCSMR, (sci_in(port, SCSMR) & ~3) | 1); | 1832 | serial_port_out(port, SCSMR, (serial_port_in(port, SCSMR) & ~3) | 1); |
1836 | t >>= 2; | 1833 | t >>= 2; |
1837 | } else | 1834 | } else |
1838 | sci_out(port, SCSMR, sci_in(port, SCSMR) & ~3); | 1835 | serial_port_out(port, SCSMR, serial_port_in(port, SCSMR) & ~3); |
1839 | 1836 | ||
1840 | sci_out(port, SCBRR, t); | 1837 | serial_port_out(port, SCBRR, t); |
1841 | udelay((1000000+(baud-1)) / baud); /* Wait one bit interval */ | 1838 | udelay((1000000+(baud-1)) / baud); /* Wait one bit interval */ |
1842 | } | 1839 | } |
1843 | 1840 | ||
@@ -1845,7 +1842,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1845 | 1842 | ||
1846 | reg = sci_getreg(port, SCFCR); | 1843 | reg = sci_getreg(port, SCFCR); |
1847 | if (reg->size) { | 1844 | if (reg->size) { |
1848 | unsigned short ctrl = sci_in(port, SCFCR); | 1845 | unsigned short ctrl = serial_port_in(port, SCFCR); |
1849 | 1846 | ||
1850 | if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) { | 1847 | if (s->cfg->capabilities & SCIx_HAVE_RTSCTS) { |
1851 | if (termios->c_cflag & CRTSCTS) | 1848 | if (termios->c_cflag & CRTSCTS) |
@@ -1861,10 +1858,10 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1861 | */ | 1858 | */ |
1862 | ctrl &= ~(SCFCR_RFRST | SCFCR_TFRST); | 1859 | ctrl &= ~(SCFCR_RFRST | SCFCR_TFRST); |
1863 | 1860 | ||
1864 | sci_out(port, SCFCR, ctrl); | 1861 | serial_port_out(port, SCFCR, ctrl); |
1865 | } | 1862 | } |
1866 | 1863 | ||
1867 | sci_out(port, SCSCR, s->cfg->scscr); | 1864 | serial_port_out(port, SCSCR, s->cfg->scscr); |
1868 | 1865 | ||
1869 | #ifdef CONFIG_SERIAL_SH_SCI_DMA | 1866 | #ifdef CONFIG_SERIAL_SH_SCI_DMA |
1870 | /* | 1867 | /* |
@@ -2166,7 +2163,7 @@ static void serial_console_write(struct console *co, const char *s, | |||
2166 | 2163 | ||
2167 | /* wait until fifo is empty and last bit has been transmitted */ | 2164 | /* wait until fifo is empty and last bit has been transmitted */ |
2168 | bits = SCxSR_TDxE(port) | SCxSR_TEND(port); | 2165 | bits = SCxSR_TDxE(port) | SCxSR_TEND(port); |
2169 | while ((sci_in(port, SCxSR) & bits) != bits) | 2166 | while ((serial_port_in(port, SCxSR) & bits) != bits) |
2170 | cpu_relax(); | 2167 | cpu_relax(); |
2171 | 2168 | ||
2172 | sci_port_disable(sci_port); | 2169 | sci_port_disable(sci_port); |
@@ -2260,12 +2257,12 @@ static int sci_runtime_suspend(struct device *dev) | |||
2260 | if (uart_console(port)) { | 2257 | if (uart_console(port)) { |
2261 | struct plat_sci_reg *reg; | 2258 | struct plat_sci_reg *reg; |
2262 | 2259 | ||
2263 | sci_port->saved_smr = sci_in(port, SCSMR); | 2260 | sci_port->saved_smr = serial_port_in(port, SCSMR); |
2264 | sci_port->saved_brr = sci_in(port, SCBRR); | 2261 | sci_port->saved_brr = serial_port_in(port, SCBRR); |
2265 | 2262 | ||
2266 | reg = sci_getreg(port, SCFCR); | 2263 | reg = sci_getreg(port, SCFCR); |
2267 | if (reg->size) | 2264 | if (reg->size) |
2268 | sci_port->saved_fcr = sci_in(port, SCFCR); | 2265 | sci_port->saved_fcr = serial_port_in(port, SCFCR); |
2269 | else | 2266 | else |
2270 | sci_port->saved_fcr = 0; | 2267 | sci_port->saved_fcr = 0; |
2271 | } | 2268 | } |
@@ -2279,13 +2276,13 @@ static int sci_runtime_resume(struct device *dev) | |||
2279 | 2276 | ||
2280 | if (uart_console(port)) { | 2277 | if (uart_console(port)) { |
2281 | sci_reset(port); | 2278 | sci_reset(port); |
2282 | sci_out(port, SCSMR, sci_port->saved_smr); | 2279 | serial_port_out(port, SCSMR, sci_port->saved_smr); |
2283 | sci_out(port, SCBRR, sci_port->saved_brr); | 2280 | serial_port_out(port, SCBRR, sci_port->saved_brr); |
2284 | 2281 | ||
2285 | if (sci_port->saved_fcr) | 2282 | if (sci_port->saved_fcr) |
2286 | sci_out(port, SCFCR, sci_port->saved_fcr); | 2283 | serial_port_out(port, SCFCR, sci_port->saved_fcr); |
2287 | 2284 | ||
2288 | sci_out(port, SCSCR, sci_port->cfg->scscr); | 2285 | serial_port_out(port, SCSCR, sci_port->cfg->scscr); |
2289 | } | 2286 | } |
2290 | return 0; | 2287 | return 0; |
2291 | } | 2288 | } |
diff --git a/drivers/tty/serial/sh-sci.h b/drivers/tty/serial/sh-sci.h index a1a2d364f92b..4c22a1529aac 100644 --- a/drivers/tty/serial/sh-sci.h +++ b/drivers/tty/serial/sh-sci.h | |||
@@ -20,10 +20,10 @@ | |||
20 | defined(CONFIG_ARCH_SH7372) || \ | 20 | defined(CONFIG_ARCH_SH7372) || \ |
21 | defined(CONFIG_ARCH_R8A7740) | 21 | defined(CONFIG_ARCH_R8A7740) |
22 | 22 | ||
23 | # define SCxSR_RDxF_CLEAR(port) (sci_in(port, SCxSR) & 0xfffc) | 23 | # define SCxSR_RDxF_CLEAR(port) (serial_port_in(port, SCxSR) & 0xfffc) |
24 | # define SCxSR_ERROR_CLEAR(port) (sci_in(port, SCxSR) & 0xfd73) | 24 | # define SCxSR_ERROR_CLEAR(port) (serial_port_in(port, SCxSR) & 0xfd73) |
25 | # define SCxSR_TDxE_CLEAR(port) (sci_in(port, SCxSR) & 0xffdf) | 25 | # define SCxSR_TDxE_CLEAR(port) (serial_port_in(port, SCxSR) & 0xffdf) |
26 | # define SCxSR_BREAK_CLEAR(port) (sci_in(port, SCxSR) & 0xffe3) | 26 | # define SCxSR_BREAK_CLEAR(port) (serial_port_in(port, SCxSR) & 0xffe3) |
27 | #else | 27 | #else |
28 | # define SCxSR_RDxF_CLEAR(port) (((port)->type == PORT_SCI) ? 0xbc : 0x00fc) | 28 | # define SCxSR_RDxF_CLEAR(port) (((port)->type == PORT_SCI) ? 0xbc : 0x00fc) |
29 | # define SCxSR_ERROR_CLEAR(port) (((port)->type == PORT_SCI) ? 0xc4 : 0x0073) | 29 | # define SCxSR_ERROR_CLEAR(port) (((port)->type == PORT_SCI) ? 0xc4 : 0x0073) |
diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c index b3b70b0bf85b..babd9470982b 100644 --- a/drivers/tty/serial/sunzilog.c +++ b/drivers/tty/serial/sunzilog.c | |||
@@ -1581,7 +1581,7 @@ static int __init sunzilog_init(void) | |||
1581 | if (err) | 1581 | if (err) |
1582 | goto out_unregister_uart; | 1582 | goto out_unregister_uart; |
1583 | 1583 | ||
1584 | if (!zilog_irq) { | 1584 | if (zilog_irq) { |
1585 | struct uart_sunzilog_port *up = sunzilog_irq_chain; | 1585 | struct uart_sunzilog_port *up = sunzilog_irq_chain; |
1586 | err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED, | 1586 | err = request_irq(zilog_irq, sunzilog_interrupt, IRQF_SHARED, |
1587 | "zs", sunzilog_irq_chain); | 1587 | "zs", sunzilog_irq_chain); |
@@ -1622,7 +1622,7 @@ static void __exit sunzilog_exit(void) | |||
1622 | { | 1622 | { |
1623 | platform_driver_unregister(&zs_driver); | 1623 | platform_driver_unregister(&zs_driver); |
1624 | 1624 | ||
1625 | if (!zilog_irq) { | 1625 | if (zilog_irq) { |
1626 | struct uart_sunzilog_port *up = sunzilog_irq_chain; | 1626 | struct uart_sunzilog_port *up = sunzilog_irq_chain; |
1627 | 1627 | ||
1628 | /* Disable Interrupts */ | 1628 | /* Disable Interrupts */ |