|
@@ -526,6 +526,18 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
|
|
|
return IRQ_HANDLED;
|
|
|
}
|
|
|
|
|
|
+static int tpm_tis_gen_interrupt(struct tpm_chip *chip)
|
|
|
+{
|
|
|
+ const char *desc = "attempting to generate an interrupt";
|
|
|
+ u32 cap2;
|
|
|
+ cap_t cap;
|
|
|
+
|
|
|
+ if (chip->flags & TPM_CHIP_FLAG_TPM2)
|
|
|
+ return tpm2_get_tpm_pt(chip, 0x100, &cap2, desc);
|
|
|
+ else
|
|
|
+ return tpm_getcap(chip, TPM_CAP_PROP_TIS_TIMEOUT, &cap, desc);
|
|
|
+}
|
|
|
+
|
|
|
/* Register the IRQ and issue a command that will cause an interrupt. If an
|
|
|
* irq is seen then leave the chip setup for IRQ operation, otherwise reverse
|
|
|
* everything and leave in polling mode. Returns 0 on success.
|
|
@@ -575,10 +587,9 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
|
|
|
/* Generate an interrupt by having the core call through to
|
|
|
* tpm_tis_send
|
|
|
*/
|
|
|
- if (chip->flags & TPM_CHIP_FLAG_TPM2)
|
|
|
- tpm2_gen_interrupt(chip);
|
|
|
- else
|
|
|
- tpm_gen_interrupt(chip);
|
|
|
+ rc = tpm_tis_gen_interrupt(chip);
|
|
|
+ if (rc < 0)
|
|
|
+ return rc;
|
|
|
|
|
|
/* tpm_tis_send will either confirm the interrupt is working or it
|
|
|
* will call disable_irq which undoes all of the above.
|