Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8947efc

Browse files
TaliPerrywsakernel
authored andcommitted
i2c: npcm7xx: Clear LAST bit after a failed transaction.
Due to a HW issue, in some scenarios the LAST bit might remain set.This will cause an unexpected NACK after reading 16 bytes on the nextread.Example: if user tries to read from a missing device, get a NACK,then if the next command is a long read ( > 16 bytes),the master will stop reading after 16 bytes.To solve this, if a command fails, check if LAST bit is stillset. If it does, reset the module.Fixes:56a1485 (i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver)Signed-off-by: Tali Perry <tali.perry1@gmail.com>Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parenta2bd970 commit8947efc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎drivers/i2c/busses/i2c-npcm7xx.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,6 +2163,15 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
21632163
if (bus->cmd_err==-EAGAIN)
21642164
ret=i2c_recover_bus(adap);
21652165

2166+
/*
2167+
* After any type of error, check if LAST bit is still set,
2168+
* due to a HW issue.
2169+
* It cannot be cleared without resetting the module.
2170+
*/
2171+
if (bus->cmd_err&&
2172+
(NPCM_I2CRXF_CTL_LAST_PEC&ioread8(bus->reg+NPCM_I2CRXF_CTL)))
2173+
npcm_i2c_reset(bus);
2174+
21662175
#ifIS_ENABLED(CONFIG_I2C_SLAVE)
21672176
/* reenable slave if it was enabled */
21682177
if (bus->slave)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp