On Tue, Mar 20, 2001 at 04:50:09PM +0100, Willem van Engen wrote:
> I'm trying to write a module which should be a child of the smbus.
> When I make the driver a child of the isa bus, identify, probe, 
> and attach functions are properly called. I use the following
> code to do that:
>   DRIVER_MODULE(my, isa, my_driver, my_devclass, 0, 0);
> But when I put it on the smbus using
>   DRIVER_MODULE(my, smbus, my_driver, my_devclass, 0, 0);
> only identify is called. The identify function is as follows:
> 
>   static void
>   my_identify(driver_t *driver, device_t parent)
>   {
>       devclass_t dc;
>       device_t child;
> 
>       printf("my: my_identify called\n");
>       dc = devclass_find("my");
>       if (devclass_get_device(dc, 0)==NULL) {
>           child = BUS_ADD_CHILD(parent, 0, "my", -1);
>       }
>   }
> 
> The driver only uses smbus calls, so I think the best parent
> would be smbus.

I'm currently working on this.

> And when I do a smbus_request_bus, the call waits forever as
> it seems. That seems sensible to me, because it asks the
> parent for the bus and the isa bus can't grant requests for
> the smbus. So I think the driver has to be a child of the smbus.

requesting the smbus is needed when the smbus controller potentially
share resources on another bus (like lpbb(4) does on ppbus).

> Looking in the kernel sources, I see that the only smbus child
> I can find, smb, (if there are others, I'm certainly interested)
> is attached in the smbus code itself. So the next question rises:
> Is it possible to have an smbus child in a dynamically loadable
> module (I can't find smbus.ko in /modules, so loading the child
> first and then smbus isn't an option I guess) ?

Currently, smb is the only smbus child. This is due to the fact that
most people prefer programming their SMB chips from user space.

I have a patch and a complete modules/i2c tree for compiling smbus and
smb as modules. You must be interested... But I have to fix some issues
like identification and driver dynamic addition.

-- 
[EMAIL PROTECTED]
Alcôve - Open Source Software Engineer - http://www.alcove.com

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to