diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index a84108cd932f..88de8fc41586 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -649,11 +649,36 @@ static int tpm_tis_pnp_suspend(struct pnp_dev *dev, pm_message_t msg) | |||
649 | return tpm_pm_suspend(&dev->dev, msg); | 649 | return tpm_pm_suspend(&dev->dev, msg); |
650 | } | 650 | } |
651 | 651 | ||
652 | static void tpm_tis_reenable_interrupts(struct tpm_chip *chip) | ||
653 | { | ||
654 | u32 intmask; | ||
655 | |||
656 | /* reenable interrupts that device may have lost or | ||
657 | BIOS/firmware may have disabled */ | ||
658 | iowrite8(chip->vendor.irq, chip->vendor.iobase + | ||
659 | TPM_INT_VECTOR(chip->vendor.locality)); | ||
660 | |||
661 | intmask = | ||
662 | ioread32(chip->vendor.iobase + | ||
663 | TPM_INT_ENABLE(chip->vendor.locality)); | ||
664 | |||
665 | intmask |= TPM_INTF_CMD_READY_INT | ||
666 | | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT | ||
667 | | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE; | ||
668 | |||
669 | iowrite32(intmask, | ||
670 | chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality)); | ||
671 | } | ||
672 | |||
673 | |||
652 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) | 674 | static int tpm_tis_pnp_resume(struct pnp_dev *dev) |
653 | { | 675 | { |
654 | struct tpm_chip *chip = pnp_get_drvdata(dev); | 676 | struct tpm_chip *chip = pnp_get_drvdata(dev); |
655 | int ret; | 677 | int ret; |
656 | 678 | ||
679 | if (chip->vendor.irq) | ||
680 | tpm_tis_reenable_interrupts(chip); | ||
681 | |||
657 | ret = tpm_pm_resume(&dev->dev); | 682 | ret = tpm_pm_resume(&dev->dev); |
658 | if (!ret) | 683 | if (!ret) |
659 | tpm_continue_selftest(chip); | 684 | tpm_continue_selftest(chip); |
@@ -706,6 +731,11 @@ static int tpm_tis_suspend(struct platform_device *dev, pm_message_t msg) | |||
706 | 731 | ||
707 | static int tpm_tis_resume(struct platform_device *dev) | 732 | static int tpm_tis_resume(struct platform_device *dev) |
708 | { | 733 | { |
734 | struct tpm_chip *chip = dev_get_drvdata(&dev->dev); | ||
735 | |||
736 | if (chip->vendor.irq) | ||
737 | tpm_tis_reenable_interrupts(chip); | ||
738 | |||
709 | return tpm_pm_resume(&dev->dev); | 739 | return tpm_pm_resume(&dev->dev); |
710 | } | 740 | } |
711 | static struct platform_driver tis_drv = { | 741 | static struct platform_driver tis_drv = { |