Page MenuHomeFreeBSD

smbus: allow child devices to be added via hints
ClosedPublic

Authored by avg on Oct 7 2016, 7:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 7, 2:03 AM
Unknown Object (File)
Tue, Nov 26, 6:53 PM
Unknown Object (File)
Tue, Nov 26, 12:14 PM
Unknown Object (File)
Nov 22 2024, 5:41 PM
Unknown Object (File)
Oct 28 2024, 11:30 PM
Unknown Object (File)
Oct 26 2024, 8:49 AM
Unknown Object (File)
Oct 25 2024, 9:28 PM
Unknown Object (File)
Oct 24 2024, 6:32 AM
Subscribers
None

Details

Summary

This will allow to add slave drivers in the same fashion as for iicbus.

Also, allow other code to add a child device and set its 'addr' ivar.
The ivar can only be set if it's unset, it can not be changed.
That could be used, for example, by a platform driver that has
a precise description of the hardware and, thus, knows what drivers
can handle what slaves.

The slave auto-probing code is unsafe and broken because it uses
7-bit slave addresses. It's going to be removed.

Note: internally the driver uses address of zero as an unset address
while smbus_get_addr() returns it as -1 for compatibility reasons.
The address is expected to be unset only for children that do not
work with slaves like, for example, smb(4).

Test Plan

Tested with jedec_ts driver (coming).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avg retitled this revision from to smbus: allow child devices to be added via hints.
avg updated this object.
avg edited the test plan for this revision. (Show Details)
avg added reviewers: imp, jhb.
jhb edited edge metadata.
jhb added inline comments.
sys/dev/smbus/smbus.c
117 ↗(On Diff #21135)

Technically bus_pass_order aren't for the device orders but for the pass set in EARLY_DRIVER_MODULE(). You could define your own constants though (which is what ACPI does) for DEVICE_ORDER_HINTED and DEVICE_ORDER_PROBED or some such.

221 ↗(On Diff #21135)

s/no/not/

This revision is now accepted and ready to land.Oct 7 2016, 4:57 PM
This revision was automatically updated to reflect the committed changes.