Page MenuHomeFreeBSD

rk_i2c bug fix
ClosedPublic

Authored by br on Nov 8 2020, 1:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 11:17 AM
Unknown Object (File)
Thu, Apr 4, 9:53 PM
Unknown Object (File)
Wed, Apr 3, 8:34 AM
Unknown Object (File)
Mar 13 2024, 12:49 PM
Unknown Object (File)
Mar 1 2024, 2:04 AM
Unknown Object (File)
Jan 22 2024, 11:34 PM
Unknown Object (File)
Jan 21 2024, 9:01 PM
Unknown Object (File)
Jan 14 2024, 5:04 AM
Subscribers

Details

Summary

o Support for transfers > 32 bytes
o Fix slave address setting

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

br requested review of this revision.Nov 8 2020, 1:26 PM
sys/arm64/rockchip/rk_i2c.c
535

Mhm, that should be | LSB I think.

sys/arm64/rockchip/rk_i2c.c
535

yes, but does not matter, since controller sets this bit internally depending on mode

sys/arm64/rockchip/rk_i2c.c
363

That will not work if the transfer is not for a multiple of 32.

sys/arm64/rockchip/rk_i2c.c
363

why?

sys/arm64/rockchip/rk_i2c.c
363

If I understand correctly if you try to do a transfer with a len of 48 bytes the first 32 bytes will be transmitted first (as it's the max length that this controller can support) but on the second transfer instead of setting TXCOUNT to 16 we will set it to 32 as you check sc->msg->len and not taking into account what have been transmitted already.

o Consider amount of bytes already transferred
o Add a small delay (not sure why it is needed, maybe another bug)

fix transfer_len for reading as well. I think eliminate a need of delay

sys/arm64/rockchip/rk_i2c.c
363

You are right, thanks!
I think driver works for me just fine now

This revision is now accepted and ready to land.May 26 2021, 7:11 AM