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
F103257944: D8173.diff
Fri, Nov 22, 5:41 PM
Unknown Object (File)
Mon, Oct 28, 11:30 PM
Unknown Object (File)
Sat, Oct 26, 8:49 AM
Unknown Object (File)
Fri, Oct 25, 9:28 PM
Unknown Object (File)
Thu, Oct 24, 6:32 AM
Unknown Object (File)
Oct 22 2024, 11:18 PM
Unknown Object (File)
Oct 16 2024, 7:15 PM
Unknown Object (File)
Sep 22 2024, 2:10 PM
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.