More on hotplug issue w/HAL

Matthew Mastracci matt at aclaro.com
Sat Jan 10 20:47:48 EET 2004


On Fri, 2004-01-09 at 18:10, David Zeuthen wrote:

> 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.

I think I've now got this implemented in the attached class device
files.  

> 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].

I had to add a special case to visit_device that adds the appropriate
i2c class device when it finds it.  I couldn't figure out any other way
to ensure that the i2c adapters were added to the tree before their i2c
subdevices were scanned.  USB and PCI have it easy - the bridges for
those devices are on the same bus as the subdevices.  

The attached patch works without any special kernel patching.  Let me
know how it looks.

Thanks,
Matt

-- 
Matthew Mastracci <matt at aclaro.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux_class_i2c_adapter.c
Type: text/x-c
Size: 7140 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xdg/attachments/20040110/28703786/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux_class_i2c_adapter.h
Type: text/x-c-header
Size: 1468 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xdg/attachments/20040110/28703786/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-2.txt
Type: text/x-patch
Size: 5235 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/xdg/attachments/20040110/28703786/attachment-0002.bin 


More information about the xdg mailing list