Page MenuHomeFreeBSD

bcm2835_bsc: add I2C start/stop/read/write/reset methods
Needs ReviewPublic

Authored by bz on Jan 14 2023, 11:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 29 2024, 9:13 AM
Unknown Object (File)
Jan 14 2024, 11:10 AM
Unknown Object (File)
Dec 20 2023, 5:40 AM
Unknown Object (File)
Apr 28 2023, 4:01 AM
Unknown Object (File)
Feb 22 2023, 7:25 AM
Unknown Object (File)
Jan 15 2023, 6:03 PM
Unknown Object (File)
Jan 15 2023, 8:49 AM
Unknown Object (File)
Jan 14 2023, 11:15 PM
Subscribers

Details

Reviewers
None
Group Reviewers
ARM
arm64
Summary

While trying to port some software I found it a lot easier to use the
read/write interface; given it was missing for bcm2835_bsc I hacked it
up.

Start/stop mostly only deal with meta-data (address, timeout,
and initializing/dropping the flag). Start in addition will also
attempt to read a byte (not caring) so scanning (checking for any
device at the given I2C address) will work.
Read/Write will use the provided meta-data and do a full
single-transaction read/write.
Reset simply clears up all state.

I am still seeing occational spurious interrupts but I cannot say if
those are due to these changes or would have always been there.
I tested a 1-wire hat and a bme280 which seem happy.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 49106
Build 45995: arc lint + arc unit

Event Timeline

bz requested review of this revision.Jan 14 2023, 11:00 PM

In case anyone likes OWFS, here's a change along with this to make it work on FreeBSD https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268961

Looks ok on a cursory review

I sometimes see spurious interrupts; had no time to debug if it is due to this change or not.