More on hotplug issue w/HAL

David Zeuthen david at fubar.dk
Sat Jan 10 03:10:59 EET 2004


On Sat, 2004-01-10 at 00:56, Matthew Mastracci wrote:
> David Zeuthen wrote:
> 
> > Many thanks, I've just committed the code with a change in linux_osspec
> > to check if the device->bus_id starts with i2c instead of checking that
> > device->bus equals i2c. The latter was 'unknown' on my box - might be a
> > kernel or libsysfs issue.
> 
> I forgot to mention this - I'm discussing a kernel change with gregkh 
> w/r/t the i2c-n adapters not appearing in the /sys/bus/i2c directory. 
> Since they don't appear in this bus directory, libsysfs assign the 
> adapters to the "unknown" bus.  My patch registers these on the i2c bus 
> to fix this, but Greg isn't certain this is the correct approach.
> 
> I can't consider myself an authority on this, so I'm not certain if this 
> is even the correct way to do things.  I've CC'd you on my other message 
> to greg and the sensors list - perhaps you might offer more insight.
> 
> If the patch isn't accepted, it might be necessary for libsysfs to 
> enumerate the /sys/bus/class/i2c-adapter to place the i2c-n adapters 
> correctly on the i2c bus.  I don't know what the correct solution is in 
> this case.
> 

Ok, the conclusion seemed to be that i2c_adapter class devices bridges
between the PCI and i2c bus (much like PCI devices that USB
controllers), so we should probably change how HAL handles i2c_adaptors
to it corresponds to how other other bridge devices are handled.

Basically, since they are class devices they should just merge
properties into the PCI device (the silicon) they belong to. This would
amount to adding the capability i2c_adapter to that device and setting
the property i2c_adaptor.name to the name we get from sysfs.

This is completely analogue to what the properties merged into the PCI
device being a USB controller, see

 http://freedesktop.org/~david/hal-pci-usb.png

note that this PCI device got the capability serial_controller.usb. This
would conclude handling of i2c_adapter devices. You would probably put
this in files linux_class_i2c_adaptor.[ch]

In addition, we should check for i2c devices (which are physical
devices) and attach them to the proper parent i2c_adaptor. Do you have
any i2c devices in your sysfs tree? I don't have any :-/ (need to find
my tv tuner card). This could go in existing files linux_i2c.[ch].

Seems doable?

Thanks,
David





More information about the xdg mailing list