aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-08-03 15:56:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-08-03 15:56:34 -0400
commitcf6c8aef16cc0cd15e91a930befd8e312d5703f5 (patch)
tree1212f74a20826382a3d1fc33d020ec4b4fc95a1c
parent8b7fd679427c571c34f61d9eafed3562c52424ae (diff)
parent8eb9a2dff019055e4ff307bb7f8c64a7a20e79c8 (diff)
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
-rw-r--r--drivers/i2c/busses/i2c-at91-core.c2
-rw-r--r--drivers/i2c/busses/i2c-at91-master.c9
-rw-r--r--drivers/i2c/busses/i2c-bcm-iproc.c10
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c1
-rw-r--r--drivers/misc/eeprom/at24.c2
5 files changed, 14 insertions, 10 deletions
diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c
index 8d55cdd69ff4..435c7d7377a3 100644
--- a/drivers/i2c/busses/i2c-at91-core.c
+++ b/drivers/i2c/busses/i2c-at91-core.c
@@ -142,7 +142,7 @@ static struct at91_twi_pdata sama5d4_config = {
142 142
143static struct at91_twi_pdata sama5d2_config = { 143static struct at91_twi_pdata sama5d2_config = {
144 .clk_max_div = 7, 144 .clk_max_div = 7,
145 .clk_offset = 4, 145 .clk_offset = 3,
146 .has_unre_flag = true, 146 .has_unre_flag = true,
147 .has_alt_cmd = true, 147 .has_alt_cmd = true,
148 .has_hold_field = true, 148 .has_hold_field = true,
diff --git a/drivers/i2c/busses/i2c-at91-master.c b/drivers/i2c/busses/i2c-at91-master.c
index e87232f2e708..a3fcc35ffd3b 100644
--- a/drivers/i2c/busses/i2c-at91-master.c
+++ b/drivers/i2c/busses/i2c-at91-master.c
@@ -122,9 +122,11 @@ static void at91_twi_write_next_byte(struct at91_twi_dev *dev)
122 writeb_relaxed(*dev->buf, dev->base + AT91_TWI_THR); 122 writeb_relaxed(*dev->buf, dev->base + AT91_TWI_THR);
123 123
124 /* send stop when last byte has been written */ 124 /* send stop when last byte has been written */
125 if (--dev->buf_len == 0) 125 if (--dev->buf_len == 0) {
126 if (!dev->use_alt_cmd) 126 if (!dev->use_alt_cmd)
127 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP); 127 at91_twi_write(dev, AT91_TWI_CR, AT91_TWI_STOP);
128 at91_twi_write(dev, AT91_TWI_IDR, AT91_TWI_TXRDY);
129 }
128 130
129 dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len); 131 dev_dbg(dev->dev, "wrote 0x%x, to go %zu\n", *dev->buf, dev->buf_len);
130 132
@@ -542,9 +544,8 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
542 } else { 544 } else {
543 at91_twi_write_next_byte(dev); 545 at91_twi_write_next_byte(dev);
544 at91_twi_write(dev, AT91_TWI_IER, 546 at91_twi_write(dev, AT91_TWI_IER,
545 AT91_TWI_TXCOMP | 547 AT91_TWI_TXCOMP | AT91_TWI_NACK |
546 AT91_TWI_NACK | 548 (dev->buf_len ? AT91_TWI_TXRDY : 0));
547 AT91_TWI_TXRDY);
548 } 549 }
549 } 550 }
550 551
diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
index 2c7f145a036e..d7fd76baec92 100644
--- a/drivers/i2c/busses/i2c-bcm-iproc.c
+++ b/drivers/i2c/busses/i2c-bcm-iproc.c
@@ -392,16 +392,18 @@ static bool bcm_iproc_i2c_slave_isr(struct bcm_iproc_i2c_dev *iproc_i2c,
392static void bcm_iproc_i2c_read_valid_bytes(struct bcm_iproc_i2c_dev *iproc_i2c) 392static void bcm_iproc_i2c_read_valid_bytes(struct bcm_iproc_i2c_dev *iproc_i2c)
393{ 393{
394 struct i2c_msg *msg = iproc_i2c->msg; 394 struct i2c_msg *msg = iproc_i2c->msg;
395 uint32_t val;
395 396
396 /* Read valid data from RX FIFO */ 397 /* Read valid data from RX FIFO */
397 while (iproc_i2c->rx_bytes < msg->len) { 398 while (iproc_i2c->rx_bytes < msg->len) {
398 if (!((iproc_i2c_rd_reg(iproc_i2c, M_FIFO_CTRL_OFFSET) >> M_FIFO_RX_CNT_SHIFT) 399 val = iproc_i2c_rd_reg(iproc_i2c, M_RX_OFFSET);
399 & M_FIFO_RX_CNT_MASK)) 400
401 /* rx fifo empty */
402 if (!((val >> M_RX_STATUS_SHIFT) & M_RX_STATUS_MASK))
400 break; 403 break;
401 404
402 msg->buf[iproc_i2c->rx_bytes] = 405 msg->buf[iproc_i2c->rx_bytes] =
403 (iproc_i2c_rd_reg(iproc_i2c, M_RX_OFFSET) >> 406 (val >> M_RX_DATA_SHIFT) & M_RX_DATA_MASK;
404 M_RX_DATA_SHIFT) & M_RX_DATA_MASK;
405 iproc_i2c->rx_bytes++; 407 iproc_i2c->rx_bytes++;
406 } 408 }
407} 409}
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index d97fb857b0ea..c98ef4c4a0c9 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -435,6 +435,7 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
435 * fall through to the write state, as we will need to 435 * fall through to the write state, as we will need to
436 * send a byte as well 436 * send a byte as well
437 */ 437 */
438 /* Fall through */
438 439
439 case STATE_WRITE: 440 case STATE_WRITE:
440 /* 441 /*
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 35bf2477693d..518945b2f737 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -685,7 +685,7 @@ static int at24_probe(struct i2c_client *client)
685 nvmem_config.name = dev_name(dev); 685 nvmem_config.name = dev_name(dev);
686 nvmem_config.dev = dev; 686 nvmem_config.dev = dev;
687 nvmem_config.read_only = !writable; 687 nvmem_config.read_only = !writable;
688 nvmem_config.root_only = true; 688 nvmem_config.root_only = !(flags & AT24_FLAG_IRUGO);
689 nvmem_config.owner = THIS_MODULE; 689 nvmem_config.owner = THIS_MODULE;
690 nvmem_config.compat = true; 690 nvmem_config.compat = true;
691 nvmem_config.base_dev = dev; 691 nvmem_config.base_dev = dev;