Subject: Re: iic(4) device discovery
To: Jason Thorpe <thorpej@shagadelic.org>
From: Jachym Holecek <freza@NetBSD.org>
List: tech-kern
Date: 10/20/2007 11:12:35
# Jason Thorpe 2007-10-20:
> On Oct 19, 2007, at 4:53 PM, Martin Husemann wrote:
> >IMHO (but it's late at night here, this is just a quick gut feeling) a
> >direct configured ofiic bus with tiny special attachments is the  
> >cleaner
> >solution.
> 
> I would much rather see a properties-based solution whereby a platform- 
> specific callback could provide an array of devices to be direct- 
> configured.

This could be implemented by providing an autoconf(9) API to register
new cfdata entries before device discovery is started. If the arch knows
the list of devices and their addresses, it would simply convert firmware
device table into cfdata dictionaries and indirect-search iic(4) would
then use it transparently.

The same could be done at runtime, via drvctl(8) ideally, for cases where
the machine itself doesn't have the knowledge, but the administrator does
and doesn't want to maintain a custom kernel config just to get devices
working. This assumes the bus in question provides ca_rescan hook.

My SoC contains some prerequisities for this to work, but I'm still busy
catching up with HEAD...

	-- Jachym