Skip to content

Commit

Permalink
Revert "i2c: bcm2835: Handle untimely DONE signal"
Browse files Browse the repository at this point in the history
This reverts commit 431ac1d.

Reverting this patch because it appears to have caused a regression
when used with an MPU-9250 IMU.

See: Hexxeh/rpi-firmware#261

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
  • Loading branch information
pelwell committed Mar 17, 2021
1 parent 16991af commit 13c4388
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions drivers/i2c/busses/i2c-bcm2835.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,6 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data)
u32 val, err;

val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S);
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_S,
BCM2835_I2C_S_CLKT |
BCM2835_I2C_S_ERR |
BCM2835_I2C_S_DONE);
bcm2835_debug_add(i2c_dev, val);

err = val & (BCM2835_I2C_S_CLKT | BCM2835_I2C_S_ERR);
Expand All @@ -386,20 +382,14 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data)
}

if (val & BCM2835_I2C_S_DONE) {
if (val & BCM2835_I2C_S_TA)
return IRQ_HANDLED;

if (!i2c_dev->curr_msg) {
dev_err(i2c_dev->dev, "Got unexpected interrupt (from firmware?)\n");
} else if (i2c_dev->curr_msg->flags & I2C_M_RD) {
bcm2835_drain_rxfifo(i2c_dev);
val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S);
}

if (i2c_dev->msg_buf_remaining)
return IRQ_HANDLED;

if (val & BCM2835_I2C_S_RXD)
if ((val & BCM2835_I2C_S_RXD) || i2c_dev->msg_buf_remaining)
i2c_dev->msg_err = BCM2835_I2C_S_LEN;
else
i2c_dev->msg_err = 0;
Expand Down Expand Up @@ -436,6 +426,8 @@ static irqreturn_t bcm2835_i2c_isr(int this_irq, void *data)

complete:
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR);
bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_S, BCM2835_I2C_S_CLKT |
BCM2835_I2C_S_ERR | BCM2835_I2C_S_DONE);
complete(&i2c_dev->completion);

return IRQ_HANDLED;
Expand Down

0 comments on commit 13c4388

Please sign in to comment.