forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/char/tpm/tpm_tis.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2005, 2006 IBM Corporation
34 * Copyright (C) 2014, 2015 Intel Corporation
....@@ -13,11 +14,6 @@
1314 *
1415 * This device driver implements the TPM interface as defined in
1516 * the TCG TPM Interface Spec version 1.2, revision 1.0.
16
- *
17
- * This program is free software; you can redistribute it and/or
18
- * modify it under the terms of the GNU General Public License as
19
- * published by the Free Software Foundation, version 2 of the
20
- * License.
2117 */
2218 #include <linux/init.h>
2319 #include <linux/module.h>
....@@ -54,7 +50,7 @@
5450 return container_of(data, struct tpm_tis_tcg_phy, priv);
5551 }
5652
57
-#ifdef CONFIG_PREEMPT_RT_FULL
53
+#ifdef CONFIG_PREEMPT_RT
5854 /*
5955 * Flushes previous write operations to chip so that a subsequent
6056 * ioread*()s won't stall a cpu.
....@@ -289,6 +285,13 @@
289285 return tpm_tis_init(&pnp_dev->dev, &tpm_info);
290286 }
291287
288
+/*
289
+ * There is a known bug caused by 93e1b7d42e1e ("[PATCH] tpm: add HID module
290
+ * parameter"). This commit added IFX0102 device ID, which is also used by
291
+ * tpm_infineon but ignored to add quirks to probe which driver ought to be
292
+ * used.
293
+ */
294
+
292295 static struct pnp_device_id tpm_pnp_tbl[] = {
293296 {"PNP0C31", 0}, /* TPM */
294297 {"ATM1200", 0}, /* Atmel */
....@@ -340,7 +343,7 @@
340343 }
341344 tpm_info.res = *res;
342345
343
- tpm_info.irq = platform_get_irq(pdev, 0);
346
+ tpm_info.irq = platform_get_irq_optional(pdev, 0);
344347 if (tpm_info.irq <= 0) {
345348 if (pdev != force_pdev)
346349 tpm_info.irq = -1;