Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Mar 2001 23:09:46 +0100
From:      Willem van Engen <wvengen@stack.nl>
To:        freebsd-hackers@freebsd.org
Subject:   Re: driver: probe not called when smbus child
Message-ID:  <3AB7D52A.3EBDD198@stack.nl>
References:  <3AB77C31.8213C158@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
It's currently working as an isa-child, but I'm still wondering
if it's the 'clean' way, since I only use smbus commands.

- Willem

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.
> 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.
> 
> 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) ?
> 
> - Willem van Engen
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3AB7D52A.3EBDD198>