Skip to content

Commit

Permalink
driver: add PPI support in tpm driver
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Kent Yoder <[email protected]>
  • Loading branch information
Xiaoyan Zhang authored and Kent Yoder committed Aug 22, 2012
1 parent 1f862f0 commit f84fdff
Show file tree
Hide file tree
Showing 4 changed files with 475 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/tpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
obj-$(CONFIG_TCG_TPM) += tpm.o
ifdef CONFIG_ACPI
obj-$(CONFIG_TCG_TPM) += tpm_bios.o
tpm_bios-objs += tpm_eventlog.o tpm_acpi.o
tpm_bios-objs += tpm_eventlog.o tpm_acpi.o tpm_ppi.o
else
ifdef CONFIG_TCG_IBMVTPM
obj-$(CONFIG_TCG_TPM) += tpm_bios.o
Expand Down
5 changes: 5 additions & 0 deletions drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,11 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
goto put_device;
}

if (sys_add_ppi(&dev->kobj)) {
misc_deregister(&chip->vendor.miscdev);
goto put_device;
}

chip->bios_dir = tpm_bios_log_setup(devname);

/* Make chip available */
Expand Down
9 changes: 9 additions & 0 deletions drivers/char/tpm/tpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,3 +327,12 @@ extern int tpm_pm_suspend(struct device *);
extern int tpm_pm_resume(struct device *);
extern int wait_for_tpm_stat(struct tpm_chip *, u8, unsigned long,
wait_queue_head_t *);

#ifdef CONFIG_ACPI
extern ssize_t sys_add_ppi(struct kobject *parent);
#else
static inline ssize_t sys_add_ppi(struct kobject *parent)
{
return 0;
}
#endif
Loading

0 comments on commit f84fdff

Please sign in to comment.