aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Brandewie <dirk.brandewie@gmail.com>2011-10-06 14:26:33 -0400
committerBen Dooks <ben-linux@fluff.org>2011-10-29 06:03:51 -0400
commitaf06cf6c8cb600803951ddabe6fb034126752488 (patch)
tree7928cc0a166fe93155afe539b3283e3f6e25de36
parente18563fc560aba0d95a5a73145812a081fb38fac (diff)
i2c-designware: Support multiple cores using same ISR
Add check to make sure that the core is enabled and has outstanding interrupts. The activity bit is masked due to the fact that it will stay active even after the controller has been disabled until the contoller internal state machines have settled. Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r--drivers/i2c/busses/i2c-designware-core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 6195df3c1c2..e8b83d9029e 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -521,10 +521,16 @@ static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev)
521irqreturn_t i2c_dw_isr(int this_irq, void *dev_id) 521irqreturn_t i2c_dw_isr(int this_irq, void *dev_id)
522{ 522{
523 struct dw_i2c_dev *dev = dev_id; 523 struct dw_i2c_dev *dev = dev_id;
524 u32 stat; 524 u32 stat, enabled;
525
526 enabled = dw_readl(dev, DW_IC_ENABLE);
527 stat = dw_readl(dev, DW_IC_RAW_INTR_STAT);
528 dev_dbg(dev->dev, "%s: %s enabled= 0x%x stat=0x%x\n", __func__,
529 dev->adapter.name, enabled, stat);
530 if (!enabled || !(stat & ~DW_IC_INTR_ACTIVITY))
531 return IRQ_NONE;
525 532
526 stat = i2c_dw_read_clear_intrbits(dev); 533 stat = i2c_dw_read_clear_intrbits(dev);
527 dev_dbg(dev->dev, "%s: stat=0x%x\n", __func__, stat);
528 534
529 if (stat & DW_IC_INTR_TX_ABRT) { 535 if (stat & DW_IC_INTR_TX_ABRT) {
530 dev->cmd_err |= DW_IC_ERR_TX_ABRT; 536 dev->cmd_err |= DW_IC_ERR_TX_ABRT;