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

Pull i2c fixes from Wolfram Sang:
 "A set of driver fixes for the I2C subsystem"

* 'i2c/for-current-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: s3c2410: Mark expected switch fall-through
  i2c: at91: fix clk_offset for sama5d2
  i2c: at91: disable TXRDY interrupt after sending data
  i2c: iproc: Fix i2c master read more than 63 bytes
  eeprom: at24: make spd world-readable again
This commit is contained in:
Linus Torvalds 2019-08-03 12:56:34 -07:00
commit cf6c8aef16
5 changed files with 14 additions and 10 deletions

View File

@ -142,7 +142,7 @@ static struct at91_twi_pdata sama5d4_config = {
static struct at91_twi_pdata sama5d2_config = { static struct at91_twi_pdata sama5d2_config = {
.clk_max_div = 7, .clk_max_div = 7,
.clk_offset = 4, .clk_offset = 3,
.has_unre_flag = true, .has_unre_flag = true,
.has_alt_cmd = true, .has_alt_cmd = true,
.has_hold_field = true, .has_hold_field = true,

View File

@ -122,9 +122,11 @@ static void at91_twi_write_next_byte(struct at91_twi_dev *dev)
writeb_relaxed(*dev->buf, dev->base + AT91_TWI_THR); writeb_relaxed(*dev->buf, dev->base + AT91_TWI_THR);
/* send stop when last byte has been written */ /* send stop when last byte has been written */
if (--dev->buf_len == 0) if (--dev->buf_len == 0) {
if (!dev->use_alt_cmd) if (!dev->use_alt_cmd)
at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP); at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
at91_twi_write(dev, AT91_TWI_IDR, AT91_TWI_TXRDY);
}
dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len); dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len);
@ -542,9 +544,8 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
} else { } else {
at91_twi_write_next_byte(dev); at91_twi_write_next_byte(dev);
at91_twi_write(dev, AT91_TWI_IER, at91_twi_write(dev, AT91_TWI_IER,
AT91_TWI_TXCOMP | AT91_TWI_TXCOMP | AT91_TWI_NACK |
AT91_TWI_NACK | (dev->buf_len ? AT91_TWI_TXRDY : 0));
AT91_TWI_TXRDY);
} }
} }

View File

@ -392,16 +392,18 @@ static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c,
static void bcm_iproc_i2c_read_valid_bytes(struct bcm_iproc_i2c_dev *iproc_i2c) static void bcm_iproc_i2c_read_valid_bytes(struct bcm_iproc_i2c_dev *iproc_i2c)
{ {
struct i2c_msg *msg = iproc_i2c->msg; struct i2c_msg *msg = iproc_i2c->msg;
uint32_t val;
/* Read valid data from RX FIFO */ /* Read valid data from RX FIFO */
while (iproc_i2c->rx_bytes < msg->len) { while (iproc_i2c->rx_bytes < msg->len) {
if (!((iproc_i2c_rd_reg(iproc_i2c, M_FIFO_CTRL_OFFSET) >> M_FIFO_RX_CNT_SHIFT) val = iproc_i2c_rd_reg(iproc_i2c, M_RX_OFFSET);
& M_FIFO_RX_CNT_MASK))
/* rx fifo empty */
if (!((val >> M_RX_STATUS_SHIFT) & M_RX_STATUS_MASK))
break; break;
msg->buf[iproc_i2c->rx_bytes] = msg->buf[iproc_i2c->rx_bytes] =
(iproc_i2c_rd_reg(iproc_i2c, M_RX_OFFSET) >> (val >> M_RX_DATA_SHIFT) & M_RX_DATA_MASK;
M_RX_DATA_SHIFT) & M_RX_DATA_MASK;
iproc_i2c->rx_bytes++; iproc_i2c->rx_bytes++;
} }
} }

View File

@ -435,6 +435,7 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
* fall through to the write state, as we will need to * fall through to the write state, as we will need to
* send a byte as well * send a byte as well
*/ */
/* Fall through */
case STATE_WRITE: case STATE_WRITE:
/* /*

View File

@ -685,7 +685,7 @@ static int at24_probe(struct i2c_client *client)
nvmem_config.name = dev_name(dev); nvmem_config.name = dev_name(dev);
nvmem_config.dev = dev; nvmem_config.dev = dev;
nvmem_config.read_only = !writable; nvmem_config.read_only = !writable;
nvmem_config.root_only = true; nvmem_config.root_only = !(flags & AT24_FLAG_IRUGO);
nvmem_config.owner = THIS_MODULE; nvmem_config.owner = THIS_MODULE;
nvmem_config.compat = true; nvmem_config.compat = true;
nvmem_config.base_dev = dev; nvmem_config.base_dev = dev;