static irqreturn_t rk30_i2c_irq(int irq, void *dev_id) { struct rk30_i2c *i2c = dev_id; unsigned int ipd; spin_lock(&i2c->lock); ipd = i2c_readl(i2c->regs + I2C_IPD); if(i2c->state == STATE_IDLE){ dev_info(i2c->dev, "Addr[0x%02x] irq in STATE_IDLE, ipd = 0x%x\n", i2c->addr, ipd); i2c_writel(I2C_IPD_ALL_CLEAN, i2c->regs + I2C_IPD); goto out; } #if defined(CONFIG_MFD_TRS65910) //for trs65910 Trsilicon peter if(ipd & I2C_NAKRCVIPD && i2c->addr == 0x2d){ i2c_writel(I2C_NAKRCVIPD, i2c->regs + I2C_IPD); goto out; }else if(ipd & I2C_NAKRCVIPD){ i2c_writel(I2C_NAKRCVIPD, i2c->regs + I2C_IPD); i2c->error = -EAGAIN; goto out; } #else if(ipd & I2C_NAKRCVIPD){ i2c_writel(I2C_NAKRCVIPD, i2c->regs + I2C_IPD); i2c->error = -EAGAIN; goto out; } #endif rk30_i2c_irq_nextblock(i2c, ipd); out: spin_unlock(&i2c->lock); return IRQ_HANDLED; }
static irqreturn_t rk30_i2c_irq(int irq, void *dev_id) { struct rk30_i2c *i2c = dev_id; unsigned int ipd; spin_lock(&i2c->lock); ipd = i2c_readl(i2c->regs + I2C_IPD); if(i2c->state == STATE_IDLE) { dev_info(i2c->dev, "Addr[0x%02x] irq in STATE_IDLE, ipd = 0x%x\n", i2c->addr, ipd); i2c_writel(I2C_IPD_ALL_CLEAN, i2c->regs + I2C_IPD); goto out; } if(ipd & I2C_NAKRCVIPD) { i2c_writel(I2C_NAKRCVIPD, i2c->regs + I2C_IPD); i2c->error = -EAGAIN; goto out; } rk30_i2c_irq_nextblock(i2c, ipd); out: spin_unlock(&i2c->lock); return IRQ_HANDLED; }