diff options
Diffstat (limited to 'drivers/char/tpm/tpm.h')
-rw-r--r-- | drivers/char/tpm/tpm.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 373b41f6b46..159882ca69d 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h @@ -19,11 +19,11 @@ * */ #include <linux/module.h> -#include <linux/version.h> #include <linux/pci.h> #include <linux/delay.h> #include <linux/fs.h> #include <linux/miscdevice.h> +#include <linux/platform_device.h> enum tpm_timeout { TPM_TIMEOUT = 5, /* msecs */ @@ -50,17 +50,22 @@ struct tpm_vendor_specific { u8 req_complete_mask; u8 req_complete_val; u8 req_canceled; - u16 base; /* TPM base address */ + void __iomem *iobase; /* ioremapped address */ + unsigned long base; /* TPM base address */ + + int region_size; + int have_region; int (*recv) (struct tpm_chip *, u8 *, size_t); int (*send) (struct tpm_chip *, u8 *, size_t); void (*cancel) (struct tpm_chip *); + u8 (*status) (struct tpm_chip *); struct miscdevice miscdev; struct attribute_group *attr_group; }; struct tpm_chip { - struct pci_dev *pci_dev; /* PCI device stuff */ + struct device *dev; /* Device stuff */ int dev_num; /* /dev/tpm# */ int num_opens; /* only one allowed */ @@ -72,6 +77,7 @@ struct tpm_chip { struct semaphore buffer_mutex; struct timer_list user_read_timer; /* user needs to claim result */ + struct work_struct work; struct semaphore tpm_mutex; /* tpm is processing */ struct tpm_vendor_specific *vendor; @@ -91,13 +97,13 @@ static inline void tpm_write_index(int base, int index, int value) outb(value & 0xFF, base+1); } -extern int tpm_register_hardware(struct pci_dev *, +extern int tpm_register_hardware(struct device *, struct tpm_vendor_specific *); extern int tpm_open(struct inode *, struct file *); extern int tpm_release(struct inode *, struct file *); extern ssize_t tpm_write(struct file *, const char __user *, size_t, loff_t *); extern ssize_t tpm_read(struct file *, char __user *, size_t, loff_t *); -extern void __devexit tpm_remove(struct pci_dev *); -extern int tpm_pm_suspend(struct pci_dev *, pm_message_t); -extern int tpm_pm_resume(struct pci_dev *); +extern void tpm_remove_hardware(struct device *); +extern int tpm_pm_suspend(struct device *, pm_message_t); +extern int tpm_pm_resume(struct device *); |