summaryrefslogtreecommitdiff
path: root/drivers/char/tpm/tpm_tis_spi.c
diff options
context:
space:
mode:
authorJames Morris <james.morris@microsoft.com>2018-07-30 19:30:19 +0300
committerJames Morris <james.morris@microsoft.com>2018-07-30 19:30:19 +0300
commit5da08f7d01693433ff6bea0c3462a5173d577540 (patch)
treea2a302177adbd31edcba2f9cd254f963853711e2 /drivers/char/tpm/tpm_tis_spi.c
parent87ea58433208d17295e200d56be5e2a4fe4ce7d6 (diff)
parentec403d8ed08c8272cfeeeea154fdebcd289988c8 (diff)
downloadlinux-5da08f7d01693433ff6bea0c3462a5173d577540.tar.xz
Merge tag 'tpmdd-next-20180728' of git://git.infradead.org/users/jjs/linux-tpmdd into next-tpm
tpmdd updates for Linux 4.19 From Jarkko: * Migrated away from PM runtime as explicit cmdReady/goIdle trasactions for every command is a spec requirement. PM runtime adds only a layer of complexity on our case. * tpm_tis drivers can now specify the hwrng quality. * TPM 2.0 code uses now tpm_buf for constructing messages. I think Tomas Winkler has done the same for TPM 1.2. I'll start digging those changes from the patchwork in the near future. * Bug fixes and clean ups.
Diffstat (limited to 'drivers/char/tpm/tpm_tis_spi.c')
-rw-r--r--drivers/char/tpm/tpm_tis_spi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
index 424ff2fde1f2..9914f6973463 100644
--- a/drivers/char/tpm/tpm_tis_spi.c
+++ b/drivers/char/tpm/tpm_tis_spi.c
@@ -199,6 +199,7 @@ static const struct tpm_tis_phy_ops tpm_spi_phy_ops = {
static int tpm_tis_spi_probe(struct spi_device *dev)
{
struct tpm_tis_spi_phy *phy;
+ int irq;
phy = devm_kzalloc(&dev->dev, sizeof(struct tpm_tis_spi_phy),
GFP_KERNEL);
@@ -211,7 +212,13 @@ static int tpm_tis_spi_probe(struct spi_device *dev)
if (!phy->iobuf)
return -ENOMEM;
- return tpm_tis_core_init(&dev->dev, &phy->priv, -1, &tpm_spi_phy_ops,
+ /* If the SPI device has an IRQ then use that */
+ if (dev->irq > 0)
+ irq = dev->irq;
+ else
+ irq = -1;
+
+ return tpm_tis_core_init(&dev->dev, &phy->priv, irq, &tpm_spi_phy_ops,
NULL);
}