aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm
diff options
context:
space:
mode:
authorRajiv Andrade <srajiv@linux.vnet.ibm.com>2010-05-13 16:37:54 -0400
committerJames Morris <jmorris@namei.org>2010-05-16 19:08:18 -0400
commit7f2ab000c6f2ae46070807a3bf645c45d8639460 (patch)
treee6488635d01b71d4e469e89f9035efe501b1d56d /drivers/char/tpm
parentb3139bbc52762268769e7af842aade0e64372433 (diff)
TPM: ACPI/PNP dependency removal
This patch pushes the ACPI dependency into the device driver code itself. Now, even without ACPI/PNP enabled, the device can be registered using the TIS specified memory space. This will however result in the lack of access to the BIOS event log, being the only implication of such ACPI removal. Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com> Acked-by: Mimi Zohar <zohar@linux.vnet.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'drivers/char/tpm')
-rw-r--r--drivers/char/tpm/Kconfig6
-rw-r--r--drivers/char/tpm/tpm_tis.c40
2 files changed, 25 insertions, 21 deletions
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
index f5fc64f89c5c..4dc338f3d1aa 100644
--- a/drivers/char/tpm/Kconfig
+++ b/drivers/char/tpm/Kconfig
@@ -17,14 +17,16 @@ menuconfig TCG_TPM
17 obtained at: <http://sourceforge.net/projects/trousers>. To 17 obtained at: <http://sourceforge.net/projects/trousers>. To
18 compile this driver as a module, choose M here; the module 18 compile this driver as a module, choose M here; the module
19 will be called tpm. If unsure, say N. 19 will be called tpm. If unsure, say N.
20 Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI 20 Notes:
21 1) For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI
21 and CONFIG_PNPACPI. 22 and CONFIG_PNPACPI.
23 2) Without ACPI enabled, the BIOS event log won't be accessible,
24 which is required to validate the PCR 0-7 values.
22 25
23if TCG_TPM 26if TCG_TPM
24 27
25config TCG_TIS 28config TCG_TIS
26 tristate "TPM Interface Specification 1.2 Interface" 29 tristate "TPM Interface Specification 1.2 Interface"
27 depends on PNP
28 ---help--- 30 ---help---
29 If you have a TPM security chip that is compliant with the 31 If you have a TPM security chip that is compliant with the
30 TCG TIS 1.2 TPM specification say Yes and it will be accessible 32 TCG TIS 1.2 TPM specification say Yes and it will be accessible
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 94345994f8a6..24314a9cffe8 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -598,7 +598,7 @@ out_err:
598 tpm_remove_hardware(chip->dev); 598 tpm_remove_hardware(chip->dev);
599 return rc; 599 return rc;
600} 600}
601 601#ifdef CONFIG_PNP
602static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, 602static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
603 const struct pnp_device_id *pnp_id) 603 const struct pnp_device_id *pnp_id)
604{ 604{
@@ -663,7 +663,7 @@ static struct pnp_driver tis_pnp_driver = {
663module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id, 663module_param_string(hid, tpm_pnp_tbl[TIS_HID_USR_IDX].id,
664 sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444); 664 sizeof(tpm_pnp_tbl[TIS_HID_USR_IDX].id), 0444);
665MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe"); 665MODULE_PARM_DESC(hid, "Set additional specific HID for this driver to probe");
666 666#endif
667static int tpm_tis_suspend(struct platform_device *dev, pm_message_t msg) 667static int tpm_tis_suspend(struct platform_device *dev, pm_message_t msg)
668{ 668{
669 return tpm_pm_suspend(&dev->dev, msg); 669 return tpm_pm_suspend(&dev->dev, msg);
@@ -690,21 +690,21 @@ MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry");
690static int __init init_tis(void) 690static int __init init_tis(void)
691{ 691{
692 int rc; 692 int rc;
693#ifdef CONFIG_PNP
694 if (!force)
695 return pnp_register_driver(&tis_pnp_driver);
696#endif
693 697
694 if (force) { 698 rc = platform_driver_register(&tis_drv);
695 rc = platform_driver_register(&tis_drv); 699 if (rc < 0)
696 if (rc < 0)
697 return rc;
698 if (IS_ERR(pdev=platform_device_register_simple("tpm_tis", -1, NULL, 0)))
699 return PTR_ERR(pdev);
700 if((rc=tpm_tis_init(&pdev->dev, TIS_MEM_BASE, TIS_MEM_LEN, 0)) != 0) {
701 platform_device_unregister(pdev);
702 platform_driver_unregister(&tis_drv);
703 }
704 return rc; 700 return rc;
701 if (IS_ERR(pdev=platform_device_register_simple("tpm_tis", -1, NULL, 0)))
702 return PTR_ERR(pdev);
703 if((rc=tpm_tis_init(&pdev->dev, TIS_MEM_BASE, TIS_MEM_LEN, 0)) != 0) {
704 platform_device_unregister(pdev);
705 platform_driver_unregister(&tis_drv);
705 } 706 }
706 707 return rc;
707 return pnp_register_driver(&tis_pnp_driver);
708} 708}
709 709
710static void __exit cleanup_tis(void) 710static void __exit cleanup_tis(void)
@@ -728,12 +728,14 @@ static void __exit cleanup_tis(void)
728 list_del(&i->list); 728 list_del(&i->list);
729 } 729 }
730 spin_unlock(&tis_lock); 730 spin_unlock(&tis_lock);
731 731#ifdef CONFIG_PNP
732 if (force) { 732 if (!force) {
733 platform_device_unregister(pdev);
734 platform_driver_unregister(&tis_drv);
735 } else
736 pnp_unregister_driver(&tis_pnp_driver); 733 pnp_unregister_driver(&tis_pnp_driver);
734 return;
735 }
736#endif
737 platform_device_unregister(pdev);
738 platform_driver_unregister(&tis_drv);
737} 739}
738 740
739module_init(init_tis); 741module_init(init_tis);