Re: [PATCH 1/1] driver: Tpm hardware enablement

Kylene Hall
2004-12-10T15:28:32Z

On Fri, 2004-12-10 at 04:56, Ian Campbell wrote:
> Hi,
>
> On Thu, 2004-12-09 at 09:25 -0600, Kylene Hall wrote:
> > + /* Determine chip type */
> > + if (tpm_nsc_init(chip) == 0) {
> > + chip->recv = tpm_nsc_recv;
> > + chip->send = tpm_nsc_send;
> > + chip->cancel = tpm_nsc_cancel;
> > + chip->req_complete_mask = NSC_STATUS_OBF;
> > + chip->req_complete_val = NSC_STATUS_OBF;
> > + } else if (tpm_atml_init(chip) == 0) {
> > + chip->recv = tpm_atml_recv;
> > + chip->send = tpm_atml_send;
> > + chip->cancel = tpm_atml_cancel;
> > + chip->req_complete_mask =
> > + ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL;
> > + chip->req_complete_val = ATML_STATUS_DATA_AVAIL;
> > + } else {
> > + rc = -ENODEV;
> > + goto out_release;
> > + }
>
> The atmel part at least also comes as an I2C variant.
>
> We could continue to add to the ifelse here but perhaps it might be
> beneficial to split the individual chip specific stuff into separate
> files now and perhaps register them via some sort of
> register_tpm_hardware(struct tpm_chip_ops *) type interface?
>
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.

Thanks,
Kylene

> Ian.