aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-06-08 03:09:07 -0400
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2018-07-28 10:03:11 -0400
commit1a339b658d9dbe1471f67b78237cf8fa08bbbeb5 (patch)
treea6760d632e23190489b343114bc6413b714890ba
parentce63c05b664e491b4cc79c713c68d8170bd0f581 (diff)
tpm_tis_spi: Pass the SPI IRQ down to the driver
An SPI TPM device managed directly on an embedded board using the SPI bus and some GPIO or similar line as IRQ handler will pass the IRQn from the TPM device associated with the SPI device. This is already handled by the SPI core, so make sure to pass this down to the core as well. (The TPM core habit of using -1 to signal no IRQ is dubious (as IRQ 0 is NO_IRQ) but I do not want to mess with that semantic in this patch.) Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
-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 = {
199static int tpm_tis_spi_probe(struct spi_device *dev) 199static int tpm_tis_spi_probe(struct spi_device *dev)
200{ 200{
201 struct tpm_tis_spi_phy *phy; 201 struct tpm_tis_spi_phy *phy;
202 int irq;
202 203
203 phy = devm_kzalloc(&dev->dev, sizeof(struct tpm_tis_spi_phy), 204 phy = devm_kzalloc(&dev->dev, sizeof(struct tpm_tis_spi_phy),
204 GFP_KERNEL); 205 GFP_KERNEL);
@@ -211,7 +212,13 @@ static int tpm_tis_spi_probe(struct spi_device *dev)
211 if (!phy->iobuf) 212 if (!phy->iobuf)
212 return -ENOMEM; 213 return -ENOMEM;
213 214
214 return tpm_tis_core_init(&dev->dev, &phy->priv, -1, &tpm_spi_phy_ops, 215 /* If the SPI device has an IRQ then use that */
216 if (dev->irq > 0)
217 irq = dev->irq;
218 else
219 irq = -1;
220
221 return tpm_tis_core_init(&dev->dev, &phy->priv, irq, &tpm_spi_phy_ops,
215 NULL); 222 NULL);
216} 223}
217 224