mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
i2c: busses: rk3x: Sync with i2c->msg with idle state
Ensure that the I2C->msg is synchronized with the idle state, and the I2C->msg may still be used in the stop phase, need to wait until the I2C transfer is completed, and then set I2C->msg to be null. Signed-off-by: David Wu <david.wu@rock-chips.com> Change-Id: I8a8e8c1e72f28cf4c95fe4efb559177056f483d1
This commit is contained in:
@@ -387,7 +387,6 @@ static void rk3x_i2c_stop(struct rk3x_i2c *i2c, int error)
|
||||
unsigned int ctrl;
|
||||
|
||||
i2c->processed = 0;
|
||||
i2c->msg = NULL;
|
||||
i2c->error = error;
|
||||
|
||||
if (i2c->is_last_msg) {
|
||||
@@ -404,6 +403,7 @@ static void rk3x_i2c_stop(struct rk3x_i2c *i2c, int error)
|
||||
/* Signal rk3x_i2c_xfer to start the next message. */
|
||||
i2c->busy = false;
|
||||
i2c->state = STATE_IDLE;
|
||||
i2c->msg = NULL;
|
||||
|
||||
/*
|
||||
* The HW is actually not capable of REPEATED START. But we can
|
||||
@@ -572,7 +572,6 @@ static void rk3x_i2c_handle_stop(struct rk3x_i2c *i2c, unsigned int ipd)
|
||||
}
|
||||
|
||||
i2c->processed = 0;
|
||||
i2c->msg = NULL;
|
||||
}
|
||||
|
||||
/* ack interrupt */
|
||||
@@ -587,6 +586,7 @@ static void rk3x_i2c_handle_stop(struct rk3x_i2c *i2c, unsigned int ipd)
|
||||
|
||||
i2c->busy = false;
|
||||
i2c->state = STATE_IDLE;
|
||||
i2c->msg = NULL;
|
||||
|
||||
/* signal rk3x_i2c_xfer that we are finished */
|
||||
rk3x_i2c_wake_up(i2c);
|
||||
|
||||
Reference in New Issue
Block a user