diff options
Diffstat (limited to 'drivers/char/tpm/tpm_tis.c')
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 1030f8420137..3e1f2bbeec11 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <linux/wait.h> | 27 | #include <linux/wait.h> |
28 | #include <linux/acpi.h> | ||
28 | #include "tpm.h" | 29 | #include "tpm.h" |
29 | 30 | ||
30 | #define TPM_HEADER_SIZE 10 | 31 | #define TPM_HEADER_SIZE 10 |
@@ -78,6 +79,26 @@ enum tis_defaults { | |||
78 | static LIST_HEAD(tis_chips); | 79 | static LIST_HEAD(tis_chips); |
79 | static DEFINE_SPINLOCK(tis_lock); | 80 | static DEFINE_SPINLOCK(tis_lock); |
80 | 81 | ||
82 | #ifdef CONFIG_ACPI | ||
83 | static int is_itpm(struct pnp_dev *dev) | ||
84 | { | ||
85 | struct acpi_device *acpi = pnp_acpi_device(dev); | ||
86 | struct acpi_hardware_id *id; | ||
87 | |||
88 | list_for_each_entry(id, &acpi->pnp.ids, list) { | ||
89 | if (!strcmp("INTC0102", id->id)) | ||
90 | return 1; | ||
91 | } | ||
92 | |||
93 | return 0; | ||
94 | } | ||
95 | #else | ||
96 | static int is_itpm(struct pnp_dev *dev) | ||
97 | { | ||
98 | return 0; | ||
99 | } | ||
100 | #endif | ||
101 | |||
81 | static int check_locality(struct tpm_chip *chip, int l) | 102 | static int check_locality(struct tpm_chip *chip, int l) |
82 | { | 103 | { |
83 | if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) & | 104 | if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) & |
@@ -355,6 +376,7 @@ static DEVICE_ATTR(temp_deactivated, S_IRUGO, tpm_show_temp_deactivated, | |||
355 | NULL); | 376 | NULL); |
356 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); | 377 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); |
357 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); | 378 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); |
379 | static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL); | ||
358 | 380 | ||
359 | static struct attribute *tis_attrs[] = { | 381 | static struct attribute *tis_attrs[] = { |
360 | &dev_attr_pubek.attr, | 382 | &dev_attr_pubek.attr, |
@@ -364,7 +386,8 @@ static struct attribute *tis_attrs[] = { | |||
364 | &dev_attr_owned.attr, | 386 | &dev_attr_owned.attr, |
365 | &dev_attr_temp_deactivated.attr, | 387 | &dev_attr_temp_deactivated.attr, |
366 | &dev_attr_caps.attr, | 388 | &dev_attr_caps.attr, |
367 | &dev_attr_cancel.attr, NULL, | 389 | &dev_attr_cancel.attr, |
390 | &dev_attr_timeouts.attr, NULL, | ||
368 | }; | 391 | }; |
369 | 392 | ||
370 | static struct attribute_group tis_attr_grp = { | 393 | static struct attribute_group tis_attr_grp = { |
@@ -472,6 +495,9 @@ static int tpm_tis_init(struct device *dev, resource_size_t start, | |||
472 | "1.2 TPM (device-id 0x%X, rev-id %d)\n", | 495 | "1.2 TPM (device-id 0x%X, rev-id %d)\n", |
473 | vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); | 496 | vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); |
474 | 497 | ||
498 | if (is_itpm(to_pnp_dev(dev))) | ||
499 | itpm = 1; | ||
500 | |||
475 | if (itpm) | 501 | if (itpm) |
476 | dev_info(dev, "Intel iTPM workaround enabled\n"); | 502 | dev_info(dev, "Intel iTPM workaround enabled\n"); |
477 | 503 | ||