Re: [tpmdd-devel] Re: [PATCH 1/1] driver: Tpm hardware enablement

Kylene Hall
2004-12-10T18:39:15Z

On Fri, 2004-12-10 at 09:41, Ian Campbell wrote:
> On Fri, 2004-12-10 at 09:28 -0600, Kylene Hall wrote:
> > Good point. Splitting this out (esp. because there will be more in the
> > future) is a good idea. What is the usual way to do this? For example,
> > what function in the chip specific file would call
> > register_tpm_hardware, how do I make sure that gets called etc.
>
> I guess you could have multiple modules, one providing the generic code
> and the dev interface etc (tpm.ko) and then one per hardware chip
> (tmp-nsc.ko, tpm-atmel.ko, tpm-atmel-i2c.ko).
>
> The hardware modules can then call tpm_register_hardware() in their
> module_init function.
>
I have begun to implement it this but the problem I have now is that
this setup makes tpm_atmel and tpm_nsc dependent on tpm. Since tpm
calls pci_register_driver in its init (which has to happen before
tpm_<specific> init) probe is called before the "interfaces" are
registered and thus the tpm_probe fails to find the device. Do I move
the pci_register? If so what is the proper place to register it? When
one interface registers? If so then I think devices for the second and
subsequent interfaces would never be discovered for the same reason as I
am currently experiencing. Do I need to move the current tpm probe
logic to the hw specific drivers?

Thanks,
Kylene

> Ian.