Skip to content

Commit f84fdff

Browse files
Xiaoyan ZhangKent Yoder
authored andcommitted
driver: add PPI support in tpm driver
The Physical Presence Interface enables the OS and the BIOS to cooperate and provides a simple and straightforward platform user experience for administering the TPM without sacrificing security. V2: separate the patch out in a separate source file, add #ifdef CONFIG_ACPI so it compiles out on ppc, use standard error instead of ACPI error as return code of show/store fns. V3: move #ifdef CONFIG_ACPI from .c file to .h file. V4: move tpm_ppi code from tpm module to tpm_bios module. V5: modify sys_add_ppi() so that ppi_attr_grp doesn't need to be exported Signed-off-by: Xiaoyan Zhang <xiaoyan.zhang@intel.com> Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
1 parent 1f862f0 commit f84fdff

4 files changed

Lines changed: 475 additions & 1 deletion

File tree

‎drivers/char/tpm/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
obj-$(CONFIG_TCG_TPM) += tpm.o
55
ifdef CONFIG_ACPI
66
obj-$(CONFIG_TCG_TPM) += tpm_bios.o
7-
tpm_bios-objs += tpm_eventlog.o tpm_acpi.o
7+
tpm_bios-objs += tpm_eventlog.o tpm_acpi.o tpm_ppi.o
88
else
99
ifdef CONFIG_TCG_IBMVTPM
1010
obj-$(CONFIG_TCG_TPM) += tpm_bios.o

‎drivers/char/tpm/tpm.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,11 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
14761476
goto put_device;
14771477
}
14781478

1479+
if (sys_add_ppi(&dev->kobj)) {
1480+
misc_deregister(&chip->vendor.miscdev);
1481+
goto put_device;
1482+
}
1483+
14791484
chip->bios_dir = tpm_bios_log_setup(devname);
14801485

14811486
/* Make chip available */

‎drivers/char/tpm/tpm.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,3 +327,12 @@ extern int tpm_pm_suspend(struct device *);
327327
extern int tpm_pm_resume(struct device *);
328328
extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
329329
wait_queue_head_t *);
330+
331+
#ifdef CONFIG_ACPI
332+
extern ssize_t sys_add_ppi(struct kobject *parent);
333+
#else
334+
static inline ssize_t sys_add_ppi(struct kobject *parent)
335+
{
336+
return 0;
337+
}
338+
#endif

0 commit comments

Comments
 (0)