Date: Wed, 21 Mar 2001 14:16:16 +0100 From: Willem van Engen <wvengen@stack.nl> To: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>, freebsd-hackers@freebsd.org Subject: Re: driver: probe not called when smbus child Message-ID: <3AB8A9A0.3A35227E@stack.nl> References: <200103210448.NAA57784@shidahara1.planet.sci.kobe-u.ac.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
Takanori Watanabe wrote:
>
> In message <3AB77C31.8213C158@stack.nl>, Willem van Engen さんいわく:
> >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);
> > }
> > }
>
> 'smbus' code do not have 'bus_add_child' method.So the BUS_ADD_CHILD
> call do not take effect.
> Call device_add_child(parent,"my",-1); or define bus_add_child method.
I'm now using the above device_add_child and it works. It gets attached
to smbus0 and the smbus_attach,detach,readw and writew commands work
(probabely others too, but I only use these).
Thanks!
>
> And you will need to know grandparent device name to bind the device
> collectly.(Or should we need a way to get device attribute such as
> Mother board, Video Capture BitBang,Video Capture Cooked,VGA Card and etc.)
I don't quite understand this; I guess I don't know enough about newbus
or so.
>
> Takanori Watanabe
> <a href="http://www.planet.sci.kobe-u.ac.jp/~takawata/key.html">
> Public Key</a>
> Key fingerprint = 2C 51 E2 78 2C E1 C5 2D 0F F1 20 A3 11 3A 62 2A
- Willem
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?3AB8A9A0.3A35227E>
