diff options
author | Shinya Kuribayashi <shinya.kuribayashi@necel.com> | 2009-11-06 07:48:33 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-12-08 19:19:11 -0500 |
commit | 21a89d4101ce338c2872401c82b66a7c155e24ab (patch) | |
tree | 6ca44511457f1b9bfb42f322cebc2a12dbc89c3d /drivers/i2c/busses | |
parent | 4cb6d1d6da471d795320cc4a933ce60f415dd1f6 (diff) |
i2c-designware: Enable RX_FULL interrupt
Enable RX_FULL interrupt mask by default, and hook it in the interrupt
handler. If requested amount of rx data (defined by IC_RX_TL) is not
available, we don't have to process i2c_dw_read().
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-designware.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-designware.c b/drivers/i2c/busses/i2c-designware.c index 0eea0dd35895..940bbf31bc8c 100644 --- a/drivers/i2c/busses/i2c-designware.c +++ b/drivers/i2c/busses/i2c-designware.c | |||
@@ -342,7 +342,7 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev) | |||
342 | u32 addr = msgs[dev->msg_write_idx].addr; | 342 | u32 addr = msgs[dev->msg_write_idx].addr; |
343 | u32 buf_len = dev->tx_buf_len; | 343 | u32 buf_len = dev->tx_buf_len; |
344 | 344 | ||
345 | intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT; | 345 | intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT | DW_IC_INTR_RX_FULL; |
346 | 346 | ||
347 | if (!(dev->status & STATUS_WRITE_IN_PROGRESS)) { | 347 | if (!(dev->status & STATUS_WRITE_IN_PROGRESS)) { |
348 | /* Disable the adapter */ | 348 | /* Disable the adapter */ |
@@ -593,10 +593,11 @@ static irqreturn_t i2c_dw_isr(int this_irq, void *dev_id) | |||
593 | dev->status = STATUS_IDLE; | 593 | dev->status = STATUS_IDLE; |
594 | } | 594 | } |
595 | 595 | ||
596 | if (stat & DW_IC_INTR_TX_EMPTY) { | 596 | if (stat & DW_IC_INTR_RX_FULL) |
597 | i2c_dw_read(dev); | 597 | i2c_dw_read(dev); |
598 | |||
599 | if (stat & DW_IC_INTR_TX_EMPTY) | ||
598 | i2c_dw_xfer_msg(dev); | 600 | i2c_dw_xfer_msg(dev); |
599 | } | ||
600 | 601 | ||
601 | /* | 602 | /* |
602 | * No need to modify or disable the interrupt mask here. | 603 | * No need to modify or disable the interrupt mask here. |