Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
"Two more driver bugfixes"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: bcm2835: Clear current buffer pointers and counts after a transfer
i2c: cadence: Fix the hold bit setting

+19 -2
+12
drivers/i2c/busses/i2c-bcm2835.c
··· 183 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 196 * Note about I2C_C_CLEAR on error: 188 197 * The I2C_C_CLEAR on errors will take some time to resolve -- if you were in ··· 292 283 293 284 time_left = wait_for_completion_timeout(&i2c_dev->completion, 294 285 adap->timeout); 286 + 287 + bcm2835_i2c_finish_transfer(i2c_dev); 288 + 295 289 if (!time_left) { 296 290 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, 297 291 BCM2835_I2C_C_CLEAR);
+7 -2
drivers/i2c/busses/i2c-cadence.c
··· 382 382 * Check for the message size against FIFO depth and set the 383 383 * 'hold bus' bit if it is greater than FIFO depth. 384 384 */ 385 - if (id->recv_count > CDNS_I2C_FIFO_DEPTH) 385 + if ((id->recv_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag) 386 386 ctrl_reg |= CDNS_I2C_CR_HOLD; 387 + else 388 + ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD; 387 389 388 390 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET); 389 391 ··· 442 440 * Check for the message size against FIFO depth and set the 443 441 * 'hold bus' bit if it is greater than FIFO depth. 444 442 */ 445 - if (id->send_count > CDNS_I2C_FIFO_DEPTH) 443 + if ((id->send_count > CDNS_I2C_FIFO_DEPTH) || id->bus_hold_flag) 446 444 ctrl_reg |= CDNS_I2C_CR_HOLD; 445 + else 446 + ctrl_reg = ctrl_reg & ~CDNS_I2C_CR_HOLD; 447 + 447 448 cdns_i2c_writereg(ctrl_reg, CDNS_I2C_CR_OFFSET); 448 449 449 450 /* Clear the interrupts in interrupt status register. */