Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: refactoring



Andrew de Quincey wrote:

On Wednesday 06 Oct 2004 21:42, Holger Waechtler wrote:


wouldn't be init() the better place for firmware uploads? Since this is
called at wakeup after sleep it will also work for USB devices which get
completely powered-down. It should always be possible to determine on
the register/device state whether a firmware reload in init() is
required, not? Is anything serious done in the detach() functions?

Now that I've removed the i2c_driver stuff, the only thing done in the _detach() functions is dvb_unregister_adapter(). The only reason this is hidden in a separate function for the moment is because you have to pass a pointer to the internal ioctl() function to it. When we move to a function pointer interface, it can be removed.

The attach() functions basically do the following:

* check if adapter is really there

hmmm, as soon the card driver does probing there is nothing left to check, isn't it?

* setup state (optionally)
* load firmware (optionally)
* register frontend.

This could be done in the card driver after probing as well. As soon we did this we have a completely passive and dumb frontend interface which does not relies anymore on kernel APIs. This means that frontend drivers can get easily hooked into userspace mockups and you can easily prototype your frontend driver in userspace...

Holger





Home | Main Index | Thread Index