Skip to content

Commit 4a1dcf7

Browse files
committed
Merge tag 'i2c-for-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "Two driver bugfixes and a typo fix" * tag 'i2c-for-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: cadence: Change large transfer count reset logic to be unconditional i2c: imx: fix typo in comment i2c: mlxcpld: Fix register setting for 400KHz frequency
2 parents 6f8e4e1 + 4ca8ca8 commit 4a1dcf7

File tree

3 files changed

+7
-27
lines changed

3 files changed

+7
-27
lines changed

drivers/i2c/busses/i2c-cadence.c

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,9 @@ static irqreturn_t cdns_i2c_slave_isr(void *ptr)
388388
*/
389389
static irqreturn_t cdns_i2c_master_isr(void *ptr)
390390
{
391-
unsigned int isr_status, avail_bytes, updatetx;
391+
unsigned int isr_status, avail_bytes;
392392
unsigned int bytes_to_send;
393-
bool hold_quirk;
393+
bool updatetx;
394394
struct cdns_i2c *id = ptr;
395395
/* Signal completion only after everything is updated */
396396
int done_flag = 0;
@@ -410,11 +410,7 @@ static irqreturn_t cdns_i2c_master_isr(void *ptr)
410410
* Check if transfer size register needs to be updated again for a
411411
* large data receive operation.
412412
*/
413-
updatetx = 0;
414-
if (id->recv_count > id->curr_recv_count)
415-
updatetx = 1;
416-
417-
hold_quirk = (id->quirks & CDNS_I2C_BROKEN_HOLD_BIT) && updatetx;
413+
updatetx = id->recv_count > id->curr_recv_count;
418414

419415
/* When receiving, handle data interrupt and completion interrupt */
420416
if (id->p_recv_buf &&
@@ -445,7 +441,7 @@ static irqreturn_t cdns_i2c_master_isr(void *ptr)
445441
break;
446442
}
447443

448-
if (cdns_is_holdquirk(id, hold_quirk))
444+
if (cdns_is_holdquirk(id, updatetx))
449445
break;
450446
}
451447

@@ -456,7 +452,7 @@ static irqreturn_t cdns_i2c_master_isr(void *ptr)
456452
* maintain transfer size non-zero while performing a large
457453
* receive operation.
458454
*/
459-
if (cdns_is_holdquirk(id, hold_quirk)) {
455+
if (cdns_is_holdquirk(id, updatetx)) {
460456
/* wait while fifo is full */
461457
while (cdns_i2c_readreg(CDNS_I2C_XFER_SIZE_OFFSET) !=
462458
(id->curr_recv_count - CDNS_I2C_FIFO_DEPTH))
@@ -478,22 +474,6 @@ static irqreturn_t cdns_i2c_master_isr(void *ptr)
478474
CDNS_I2C_XFER_SIZE_OFFSET);
479475
id->curr_recv_count = id->recv_count;
480476
}
481-
} else if (id->recv_count && !hold_quirk &&
482-
!id->curr_recv_count) {
483-
484-
/* Set the slave address in address register*/
485-
cdns_i2c_writereg(id->p_msg->addr & CDNS_I2C_ADDR_MASK,
486-
CDNS_I2C_ADDR_OFFSET);
487-
488-
if (id->recv_count > CDNS_I2C_TRANSFER_SIZE) {
489-
cdns_i2c_writereg(CDNS_I2C_TRANSFER_SIZE,
490-
CDNS_I2C_XFER_SIZE_OFFSET);
491-
id->curr_recv_count = CDNS_I2C_TRANSFER_SIZE;
492-
} else {
493-
cdns_i2c_writereg(id->recv_count,
494-
CDNS_I2C_XFER_SIZE_OFFSET);
495-
id->curr_recv_count = id->recv_count;
496-
}
497477
}
498478

499479
/* Clear hold (if not repeated start) and signal completion */

drivers/i2c/busses/i2c-imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
/* IMX I2C registers:
6868
* the I2C register offset is different between SoCs,
69-
* to provid support for all these chips, split the
69+
* to provide support for all these chips, split the
7070
* register offset into a fixed base address and a
7171
* variable shift value, then the full register offset
7272
* will be calculated by

drivers/i2c/busses/i2c-mlxcpld.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
#define MLXCPLD_LPCI2C_NACK_IND 2
5050

5151
#define MLXCPLD_I2C_FREQ_1000KHZ_SET 0x04
52-
#define MLXCPLD_I2C_FREQ_400KHZ_SET 0x0c
52+
#define MLXCPLD_I2C_FREQ_400KHZ_SET 0x0e
5353
#define MLXCPLD_I2C_FREQ_100KHZ_SET 0x42
5454

5555
enum mlxcpld_i2c_frequency {

0 commit comments

Comments
 (0)