Skip to content

Commit

Permalink
fix missing i2c stop after last message (#51)
Browse files Browse the repository at this point in the history
the boolean flag used to denote the last i2c message wasn't being
set to true and as a result, the i2c stop call wasn't issuing a
stop sequence.
jeffglaum authored Jan 28, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b7252d6 commit 1a73913
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/i2c/rk3xi2c/rockchipi2c.c
Original file line number Diff line number Diff line change
@@ -186,8 +186,10 @@ static void rk3x_i2c_handle_write(PRK3XI2C_CONTEXT pDevice, unsigned int ipd)
write32(pDevice, REG_IPD, REG_INT_MBTF);

/* are we finished? */
if (pDevice->processed >= pDevice->currentDescriptor.TransferLength)
if (pDevice->processed >= pDevice->currentDescriptor.TransferLength) {
pDevice->isLastMsg = TRUE;
rk3x_i2c_stop(pDevice, pDevice->transactionStatus);
}
else
rk3x_i2c_fill_transmit_buf(pDevice);
}
@@ -227,8 +229,10 @@ static void rk3x_i2c_handle_read(PRK3XI2C_CONTEXT pDevice, unsigned int ipd)
}

/* are we finished? */
if (pDevice->processed >= pDevice->currentDescriptor.TransferLength)
if (pDevice->processed >= pDevice->currentDescriptor.TransferLength) {
pDevice->isLastMsg = TRUE;
rk3x_i2c_stop(pDevice, pDevice->transactionStatus);
}
else
rk3x_i2c_prepare_read(pDevice);
}

0 comments on commit 1a73913

Please sign in to comment.