Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260951
b: refs/heads/master
c: 45baa1d
h: refs/heads/master
i:
  260949: ec8a95d
  260947: 22054f0
  260943: 68cbcd1
v: v3
  • Loading branch information
Stefan Berger authored and Rajiv Andrade committed Jul 12, 2011
1 parent 3ff87c9 commit 5c636bc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a79444f24cb169b79f0f346482a42ab28329bae
refs/heads/master: 45baa1d1fa3926510ead93c96e6b0baa5ad79bd3
30 changes: 30 additions & 0 deletions trunk/drivers/char/tpm/tpm_tis.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,36 @@ static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg)
return tpm_pm_suspend(&dev->dev, msg);
}

static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
{
u32 intmask;

/* reenable interrupts that device may have lost or
BIOS/firmware may have disabled */
iowrite8(chip->vendor.irq, chip->vendor.iobase +
TPM_INT_VECTOR(chip->vendor.locality));

intmask =
ioread32(chip->vendor.iobase +
TPM_INT_ENABLE(chip->vendor.locality));

intmask |= TPM_INTF_CMD_READY_INT
| TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
| TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE;

iowrite32(intmask,
chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
}


static int tpm_tis_pnp_resume(struct pnp_dev *dev)
{
struct tpm_chip *chip = pnp_get_drvdata(dev);
int ret;

if (chip->vendor.irq)
tpm_tis_reenable_interrupts(chip);

ret = tpm_pm_resume(&dev->dev);
if (!ret)
tpm_continue_selftest(chip);
Expand Down Expand Up @@ -706,6 +731,11 @@ static int tpm_tis_suspend(struct platform_device *dev, pm_message_t msg)

static int tpm_tis_resume(struct platform_device *dev)
{
struct tpm_chip *chip = dev_get_drvdata(&dev->dev);

if (chip->vendor.irq)
tpm_tis_reenable_interrupts(chip);

return tpm_pm_resume(&dev->dev);
}
static struct platform_driver tis_drv = {
Expand Down

0 comments on commit 5c636bc

Please sign in to comment.