forked from freebsd/freebsd-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Most importantly, send the STOP condition after any protocol error. If we don't finish the current transaction then either the controller or devices on the bus can get confused about the current protocol state. E.g., NACK from a slave does not imply by itself that the current transaction is aborted. To aid this change, a new function is introduced to handle all common actions for an error condition. Also, not only clear TWSI_CONTROL_ACK before a 1-byte read, but also set that control bit before a multi-byte read. Some KASSERTs are added to ensure that we never read or write beyond the end of a caller supplied data buffer. Support for diagnostic messages is always compiled in. The run-time behavior is controlled with a hew sysctl, hw.i2c.twsi_debug. If an interrupt arrives when no transfer is active then the interrupt is just acknowledged (and reported), but no other action is taken. Finally, some wording changes of the diagnostic messages.
- Loading branch information
Showing
1 changed file
with
85 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters