Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / drivers / tty / serial / pch_uart.c
index d6aba8c..08b92a6 100644 (file)
@@ -660,7 +660,8 @@ static void pch_dma_rx_complete(void *arg)
                tty_flip_buffer_push(tty);
        tty_kref_put(tty);
        async_tx_ack(priv->desc_rx);
-       pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_RX_INT);
+       pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_RX_INT |
+                                           PCH_UART_HAL_RX_ERR_INT);
 }
 
 static void pch_dma_tx_complete(void *arg)
@@ -715,7 +716,8 @@ static int handle_rx_to(struct eg20t_port *priv)
        int rx_size;
        int ret;
        if (!priv->start_rx) {
-               pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_RX_INT);
+               pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_RX_INT |
+                                                    PCH_UART_HAL_RX_ERR_INT);
                return 0;
        }
        buf = &priv->rxbuf;
@@ -977,11 +979,13 @@ static irqreturn_t pch_uart_interrupt(int irq, void *dev_id)
                case PCH_UART_IID_RDR:  /* Received Data Ready */
                        if (priv->use_dma) {
                                pch_uart_hal_disable_interrupt(priv,
-                                                       PCH_UART_HAL_RX_INT);
+                                               PCH_UART_HAL_RX_INT |
+                                               PCH_UART_HAL_RX_ERR_INT);
                                ret = dma_handle_rx(priv);
                                if (!ret)
                                        pch_uart_hal_enable_interrupt(priv,
-                                                       PCH_UART_HAL_RX_INT);
+                                               PCH_UART_HAL_RX_INT |
+                                               PCH_UART_HAL_RX_ERR_INT);
                        } else {
                                ret = handle_rx(priv);
                        }
@@ -1107,7 +1111,8 @@ static void pch_uart_stop_rx(struct uart_port *port)
        struct eg20t_port *priv;
        priv = container_of(port, struct eg20t_port, port);
        priv->start_rx = 0;
-       pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_RX_INT);
+       pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_RX_INT |
+                                            PCH_UART_HAL_RX_ERR_INT);
        priv->int_dis_flag = 1;
 }
 
@@ -1163,6 +1168,7 @@ static int pch_uart_startup(struct uart_port *port)
                break;
        case 16:
                fifo_size = PCH_UART_HAL_FIFO16;
+               break;
        case 1:
        default:
                fifo_size = PCH_UART_HAL_FIFO_DIS;
@@ -1200,7 +1206,8 @@ static int pch_uart_startup(struct uart_port *port)
                pch_request_dma(port);
 
        priv->start_rx = 1;
-       pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_RX_INT);
+       pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_RX_INT |
+                                           PCH_UART_HAL_RX_ERR_INT);
        uart_update_timeout(port, CS8, default_baud);
 
        return 0;
@@ -1258,7 +1265,7 @@ static void pch_uart_set_termios(struct uart_port *port,
                stb = PCH_UART_HAL_STB1;
 
        if (termios->c_cflag & PARENB) {
-               if (!(termios->c_cflag & PARODD))
+               if (termios->c_cflag & PARODD)
                        parity = PCH_UART_HAL_PARITY_ODD;
                else
                        parity = PCH_UART_HAL_PARITY_EVEN;
@@ -1356,9 +1363,11 @@ static int pch_uart_verify_port(struct uart_port *port,
                        __func__);
                return -EOPNOTSUPP;
 #endif
-               priv->use_dma = 1;
                priv->use_dma_flag = 1;
                dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n");
+               if (!priv->use_dma)
+                       pch_request_dma(port);
+               priv->use_dma = 1;
        }
 
        return 0;
@@ -1438,6 +1447,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
        }
 
        pci_enable_msi(pdev);
+       pci_set_master(pdev);
 
        iobase = pci_resource_start(pdev, 0);
        mapbase = pci_resource_start(pdev, 1);