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)
Tue, Oct 14, 3:24 AM
Unknown Object (File)
Fri, Oct 3, 8:25 PM
Unknown Object (File)
Sep 3 2025, 12:33 PM
Unknown Object (File)
Aug 14 2025, 9:51 PM
Unknown Object (File)
Jul 8 2025, 3:56 PM
Unknown Object (File)
Jul 6 2025, 4:40 PM
Unknown Object (File)
Jul 6 2025, 12:02 AM
Unknown Object (File)
Jul 3 2025, 1:39 AM
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.