Skip to content

Commit

Permalink
i2c: riic: fix restart condition
Browse files Browse the repository at this point in the history
While modifying the driver to use the STOP interrupt, the completion of the
intermediate transfers need to wake the driver back up in order to initiate
the next transfer (restart condition). Otherwise you get never ending
interrupts and only the first transfer sent.

Fixes: 71ccea0 ("i2c: riic: correctly finish transfers")
Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Tested-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Chris Brandt authored and Wolfram Sang committed Mar 8, 2017
1 parent c1ae3cf commit 2501c1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/i2c/busses/i2c-riic.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,12 @@ static irqreturn_t riic_tend_isr(int irq, void *data)
}

if (riic->is_last || riic->err) {
riic_clear_set_bit(riic, 0, ICIER_SPIE, RIIC_ICIER);
riic_clear_set_bit(riic, ICIER_TEIE, ICIER_SPIE, RIIC_ICIER);
writeb(ICCR2_SP, riic->base + RIIC_ICCR2);
} else {
/* Transfer is complete, but do not send STOP */
riic_clear_set_bit(riic, ICIER_TEIE, 0, RIIC_ICIER);
complete(&riic->msg_done);
}

return IRQ_HANDLED;
Expand Down

0 comments on commit 2501c1b

Please sign in to comment.