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

Ian Campbell
2004-12-10T10:56:25Z

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?

Ian.

--
Ian Campbell, Senior Design Engineer
Web: http://www.arcom.com
Arcom, Clifton Road, Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom Phone: +44 (0)1223 411 200