diff options
author | Tomoya MORINAGA <tomoya.rohm@gmail.com> | 2012-03-26 01:43:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-09 15:08:42 -0400 |
commit | 5181fb3d51d2d886ec9b2fed13a9ad9d5d67ec1f (patch) | |
tree | e424bb7629bb7a2c411a5a6dc81545c7320a81cb /drivers/tty | |
parent | b23954a3f73a68a80f260bd3569a81ccc6d13670 (diff) |
pch_uart: Support modem status interrupt
Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/pch_uart.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index d035f8ff913..d11096c8ca8 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c | |||
@@ -1043,10 +1043,15 @@ static irqreturn_t pch_uart_interrupt(int irq, void *dev_id) | |||
1043 | int ret = 0; | 1043 | int ret = 0; |
1044 | unsigned char iid; | 1044 | unsigned char iid; |
1045 | unsigned long flags; | 1045 | unsigned long flags; |
1046 | int next = 1; | ||
1047 | u8 msr; | ||
1046 | 1048 | ||
1047 | spin_lock_irqsave(&priv->port.lock, flags); | 1049 | spin_lock_irqsave(&priv->port.lock, flags); |
1048 | handled = 0; | 1050 | handled = 0; |
1049 | while ((iid = pch_uart_hal_get_iid(priv)) > 1) { | 1051 | while (next) { |
1052 | iid = pch_uart_hal_get_iid(priv); | ||
1053 | if (iid & PCH_UART_IIR_IP) /* No Interrupt */ | ||
1054 | break; | ||
1050 | switch (iid) { | 1055 | switch (iid) { |
1051 | case PCH_UART_IID_RLS: /* Receiver Line Status */ | 1056 | case PCH_UART_IID_RLS: /* Receiver Line Status */ |
1052 | lsr = pch_uart_hal_get_line_status(priv); | 1057 | lsr = pch_uart_hal_get_line_status(priv); |
@@ -1080,12 +1085,18 @@ static irqreturn_t pch_uart_interrupt(int irq, void *dev_id) | |||
1080 | ret = handle_tx(priv); | 1085 | ret = handle_tx(priv); |
1081 | break; | 1086 | break; |
1082 | case PCH_UART_IID_MS: /* Modem Status */ | 1087 | case PCH_UART_IID_MS: /* Modem Status */ |
1083 | ret = PCH_UART_HANDLED_MS_INT; | 1088 | msr = pch_uart_hal_get_modem(priv); |
1089 | next = 0; /* MS ir prioirty is the lowest. So, MS ir | ||
1090 | means final interrupt */ | ||
1091 | if ((msr & UART_MSR_ANY_DELTA) == 0) | ||
1092 | break; | ||
1093 | ret |= PCH_UART_HANDLED_MS_INT; | ||
1084 | break; | 1094 | break; |
1085 | default: /* Never junp to this label */ | 1095 | default: /* Never junp to this label */ |
1086 | dev_err(priv->port.dev, "%s:iid=%02x (%lu)\n", __func__, | 1096 | dev_err(priv->port.dev, "%s:iid=%02x (%lu)\n", __func__, |
1087 | iid, jiffies); | 1097 | iid, jiffies); |
1088 | ret = -1; | 1098 | ret = -1; |
1099 | next = 0; | ||
1089 | break; | 1100 | break; |
1090 | } | 1101 | } |
1091 | handled |= (unsigned int)ret; | 1102 | handled |= (unsigned int)ret; |