Skip to content

Commit 0bf58eb

Browse files
TaliPerrywsakernel
authored andcommitted
i2c: npcm: Add tx complete counter
tx_complete counter is used to indicate successful transaction count. Similar counters for failed tx were previously added. Signed-off-by: Tali Perry <[email protected]> Signed-off-by: Tyrone Ting <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 288b204 commit 0bf58eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/i2c/busses/i2c-npcm7xx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ struct npcm_i2c {
314314
u64 rec_fail_cnt;
315315
u64 nack_cnt;
316316
u64 timeout_cnt;
317+
u64 tx_complete_cnt;
317318
};
318319

319320
static inline void npcm_i2c_select_bank(struct npcm_i2c *bus,
@@ -684,6 +685,8 @@ static void npcm_i2c_callback(struct npcm_i2c *bus,
684685
switch (op_status) {
685686
case I2C_MASTER_DONE_IND:
686687
bus->cmd_err = bus->msgs_num;
688+
if (bus->tx_complete_cnt < ULLONG_MAX)
689+
bus->tx_complete_cnt++;
687690
fallthrough;
688691
case I2C_BLOCK_BYTES_ERR_IND:
689692
/* Master tx finished and all transmit bytes were sent */
@@ -2223,6 +2226,7 @@ static void npcm_i2c_init_debugfs(struct platform_device *pdev,
22232226
debugfs_create_u64("rec_succ_cnt", 0444, d, &bus->rec_succ_cnt);
22242227
debugfs_create_u64("rec_fail_cnt", 0444, d, &bus->rec_fail_cnt);
22252228
debugfs_create_u64("timeout_cnt", 0444, d, &bus->timeout_cnt);
2229+
debugfs_create_u64("tx_complete_cnt", 0444, d, &bus->tx_complete_cnt);
22262230

22272231
bus->debugfs = d;
22282232
}

0 commit comments

Comments
 (0)