diff options
Diffstat (limited to 'drivers/i2c/busses/i2c-bcm2835.c')
| -rw-r--r-- | drivers/i2c/busses/i2c-bcm2835.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-bcm2835.c b/drivers/i2c/busses/i2c-bcm2835.c index ec6e69aa3a8e..d2fbb4bb4a43 100644 --- a/drivers/i2c/busses/i2c-bcm2835.c +++ b/drivers/i2c/busses/i2c-bcm2835.c | |||
| @@ -183,6 +183,15 @@ static void bcm2835_i2c_start_transfer(struct bcm2835_i2c_dev *i2c_dev) | |||
| 183 | bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, c); | 183 | bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, c); |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | static void bcm2835_i2c_finish_transfer(struct bcm2835_i2c_dev *i2c_dev) | ||
| 187 | { | ||
| 188 | i2c_dev->curr_msg = NULL; | ||
| 189 | i2c_dev->num_msgs = 0; | ||
| 190 | |||
| 191 | i2c_dev->msg_buf = NULL; | ||
| 192 | i2c_dev->msg_buf_remaining = 0; | ||
| 193 | } | ||
| 194 | |||
| 186 | /* | 195 | /* |
| 187 | * Note about I2C_C_CLEAR on error: | 196 | * Note about I2C_C_CLEAR on error: |
| 188 | * The I2C_C_CLEAR on errors will take some time to resolve -- if you were in | 197 | * The I2C_C_CLEAR on errors will take some time to resolve -- if you were in |
| @@ -283,6 +292,9 @@ static int bcm2835_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], | |||
| 283 | 292 | ||
| 284 | time_left = wait_for_completion_timeout(&i2c_dev->completion, | 293 | time_left = wait_for_completion_timeout(&i2c_dev->completion, |
| 285 | adap->timeout); | 294 | adap->timeout); |
| 295 | |||
| 296 | bcm2835_i2c_finish_transfer(i2c_dev); | ||
| 297 | |||
| 286 | if (!time_left) { | 298 | if (!time_left) { |
| 287 | bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, | 299 | bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, |
| 288 | BCM2835_I2C_C_CLEAR); | 300 | BCM2835_I2C_C_CLEAR); |
