Skip to contentSkip to conversation

tpm_tis_i2c

PATCH Superseded Alexander Steffen 4 participants 10 messages May 25, 2022 – Jun 3, 2022

Subsystems (3)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v4 cover tpm_tis_i2c

Changelog:
* v4:
* Move changelog to cover letter
* Add compatibles to trivial-devices.yaml
* Split patch for CRC interface and implementation
* Add tpm_tis_i2c prefix to all functions
* Improve documentation for guard time and sanity check
* Use for loop instead of while for retries
* v3:
* Document address_to_register function
* Add tpm_tis_i2c prefix to address_to_register
* Add #ifdef CONFIG_OF to of_tis_i2c_match
* Fix typos
* v2:
* move CCs from copyright comment to commit message
* fix an unchecked return code

Alexander Steffen (3):
dt-bindings: trivial-devices: Add two I2C TPM devices
tpm: Add tpm_tis_verify_crc to the tpm_tis_phy_ops protocol layer
tpm: Add tpm_tis_i2c backend for tpm_tis_core

 .../devicetree/bindings/trivial-devices.yaml  |   4 +
 drivers/char/tpm/Kconfig                      |  12 +
 drivers/char/tpm/Makefile                     |   1 +
 drivers/char/tpm/tpm_tis_core.c               |  14 +
 drivers/char/tpm/tpm_tis_core.h               |  10 +
 drivers/char/tpm/tpm_tis_i2c.c                | 406 ++++++++++++++++++
 6 files changed, 447 insertions(+)
 create mode 100644 drivers/char/tpm/tpm_tis_i2c.c
Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 1/3 dt-bindings: trivial-devices: Add two I2C TPM devices

Both are supported by the upcoming tpm_tis_i2c driver.

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +4 -0
index 550a2e5c9e05..dc52822331dd 100644
@@ -135,6 +135,8 @@ properties:
           - infineon,slb9635tt
             # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
           - infineon,slb9645tt
+            # Infineon SLB9673 I2C TPM 2.0
+          - infineon,slb9673
             # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
           - infineon,tlv493d-a1b6
             # Infineon Multi-phase Digital VR Controller xdpe11280
@@ -323,6 +325,8 @@ properties:
           - st,24c256
             # Ambient Light Sensor with SMBUS/Two Wire Serial Interface
           - taos,tsl2550
+            # TCG TIS-compliant TPM with I2C interface
+          - tcg,tpm_tis-i2c
             # Temperature Monitoring and Fan Control
           - ti,amc6821
             # Temperature and humidity sensor with i2c interface
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH v4 1/3] dt-bindings: trivial-devices: Add two I2C TPM devices

Quoted 21 lines · Alexander Steffen

Both are supported by the upcoming tpm_tis_i2c driver.

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
index 550a2e5c9e05..dc52822331dd 100644
@@ -135,6 +135,8 @@ properties:
           - infineon,slb9635tt
             # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
           - infineon,slb9645tt
+            # Infineon SLB9673 I2C TPM 2.0
+          - infineon,slb9673
             # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
           - infineon,tlv493d-a1b6
             # Infineon Multi-phase Digital VR Controller xdpe11280

Documentation/devicetree/bindings/trivial-devices.yaml properties: · line 329

Quoted 5 lines
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
@@ -323,6 +325,8 @@ properties:
           - st,24c256
             # Ambient Light Sensor with SMBUS/Two Wire Serial Interface
           - taos,tsl2550
+            # TCG TIS-compliant TPM with I2C interface
+          - tcg,tpm_tis-i2c

One flavor uses tpm-tis, another tpm_tis... I guess it is too late to make it consistent, but let's stick to the one more reasonable, so:
"tpm-tis-i2c".

Best regards,
Krzysztof

maintainer
#3 lore raw

Re: [PATCH v4 1/3] dt-bindings: trivial-devices: Add two I2C TPM devices

Quoted 23 lines · Krzysztof Kozlowski
Quoted 22 lines · Alexander Steffen

Both are supported by the upcoming tpm_tis_i2c driver.

---
 Documentation/devicetree/bindings/trivial-devices.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
index 550a2e5c9e05..dc52822331dd 100644
@@ -135,6 +135,8 @@ properties:
           - infineon,slb9635tt
             # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
           - infineon,slb9645tt
+            # Infineon SLB9673 I2C TPM 2.0
+          - infineon,slb9673
             # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
           - infineon,tlv493d-a1b6
             # Infineon Multi-phase Digital VR Controller xdpe11280
@@ -323,6 +325,8 @@ properties:
           - st,24c256
Quoted 8 lines

Documentation/devicetree/bindings/trivial-devices.yaml properties: · line 329

Quoted 4 lines
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
             # Ambient Light Sensor with SMBUS/Two Wire Serial Interface
           - taos,tsl2550
+            # TCG TIS-compliant TPM with I2C interface
+          - tcg,tpm_tis-i2c

One flavor uses tpm-tis, another tpm_tis... I guess it is too late to make it consistent, but let's stick to the one more reasonable, so:
"tpm-tis-i2c".

Neither should be used except perhaps as a fallback. Does 'TCG TIS-compliant TPM' encompass every property of a device? Power supplies, resets, interrupts, quirks, etc.?

Rob

#4 lore raw

Re: [PATCH v4 1/3] dt-bindings: trivial-devices: Add two I2C TPM devices

Quoted 33 lines · Rob Herring
Quoted 23 lines · Krzysztof Kozlowski
Quoted 22 lines · Alexander Steffen

Both are supported by the upcoming tpm_tis_i2c driver.

---
  Documentation/devicetree/bindings/trivial-devices.yaml | 4 ++++
  1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
index 550a2e5c9e05..dc52822331dd 100644
@@ -135,6 +135,8 @@ properties:
            - infineon,slb9635tt
              # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
            - infineon,slb9645tt
+            # Infineon SLB9673 I2C TPM 2.0
+          - infineon,slb9673
              # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
            - infineon,tlv493d-a1b6
              # Infineon Multi-phase Digital VR Controller xdpe11280
@@ -323,6 +325,8 @@ properties:
            - st,24c256
Quoted 8 lines

Documentation/devicetree/bindings/trivial-devices.yaml properties: · line 329

Quoted 4 lines
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
              # Ambient Light Sensor with SMBUS/Two Wire Serial Interface
            - taos,tsl2550
+            # TCG TIS-compliant TPM with I2C interface
+          - tcg,tpm_tis-i2c

One flavor uses tpm-tis, another tpm_tis... I guess it is too late to make it consistent, but let's stick to the one more reasonable, so:
"tpm-tis-i2c".

Quoted 1 line

Neither should be used except perhaps as a fallback.

That is the intention, yes.

Quoted 2 lines

Does 'TCG TIS-compliant TPM' encompass every property of a device? Power supplies, resets, interrupts, quirks, etc.?

In an ideal world, yes. In practice, of course implementations do have bugs that might require different workarounds. By selecting tcg,tpm-tis-i2c instead of anything more specific, you promise that the device is fully compliant to the TCG specification and does not require any such workarounds.

Alexander

maintainer
#5 lore raw

Re: [PATCH v4 1/3] dt-bindings: trivial-devices: Add two I2C TPM devices

Quoted 35 lines · Alexander Steffen
Quoted 33 lines · Rob Herring
Quoted 31 lines · Krzysztof Kozlowski
Quoted 21 lines · Alexander Steffen

Both are supported by the upcoming tpm_tis_i2c driver.

---
  Documentation/devicetree/bindings/trivial-devices.yaml | 4 ++++
  1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
index 550a2e5c9e05..dc52822331dd 100644
@@ -135,6 +135,8 @@ properties:
            - infineon,slb9635tt
              # Infineon SLB9645 I2C TPM (new protocol, max 400khz)
            - infineon,slb9645tt
+            # Infineon SLB9673 I2C TPM 2.0
+          - infineon,slb9673
              # Infineon TLV493D-A1B6 I2C 3D Magnetic Sensor
            - infineon,tlv493d-a1b6
              # Infineon Multi-phase Digital VR Controller xdpe11280

Documentation/devicetree/bindings/trivial-devices.yaml properties: · line 329

Quoted 5 lines
Documentation/devicetree/bindings/trivial-devices.yaml +2 -0
@@ -323,6 +325,8 @@ properties:
            - st,24c256
              # Ambient Light Sensor with SMBUS/Two Wire Serial Interface
            - taos,tsl2550
+            # TCG TIS-compliant TPM with I2C interface
+          - tcg,tpm_tis-i2c

One flavor uses tpm-tis, another tpm_tis... I guess it is too late to make it consistent, but let's stick to the one more reasonable, so:
"tpm-tis-i2c".

Quoted 3 lines
Quoted 1 line

Neither should be used except perhaps as a fallback.

That is the intention, yes.

Then it is not a trivial device as those don't have more than 1 compatible string.

Quoted 8 lines
Quoted 2 lines

Does 'TCG TIS-compliant TPM' encompass every property of a device? Power supplies, resets, interrupts, quirks, etc.?

In an ideal world, yes. In practice, of course implementations do have bugs that might require different workarounds. By selecting tcg,tpm-tis-i2c instead of anything more specific, you promise that the device is fully compliant to the TCG specification and does not require any such workarounds.

We don't want broken promises. The problem is you can't know up front whether you will need a work-around. Adding a compatible later is not ideal as that would require a DT update which may be in your firmware (separate from the OS).

Rob

#6 lore raw

PATCH v4 2/3 tpm: Add tpm_tis_verify_crc to the tpm_tis_phy_ops protocol layer

In reply to Alexander Steffen

Some TPMs, e.g. those implementing the I2C variant of TIS, can verify data transfers to/from the FIFO with a CRC. The CRC is calculated over the entirety of the FIFO register. Since the phy_ops layer is not aware when the core layer is done reading/writing the FIFO, CRC verification must be triggered from the core layer. To this end, add an optional phy_ops API call.

---
 drivers/char/tpm/tpm_tis_core.c | 14 ++++++++++++++
 drivers/char/tpm/tpm_tis_core.h | 10 ++++++++++
 2 files changed, 24 insertions(+)
drivers/char/tpm/tpm_tis_core.c +14 -0
index dc56b976d816..757623bacfd5 100644
@@ -289,6 +289,7 @@ static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 	int size = 0;
 	int status;
 	u32 expected;
+	int rc;
 
 	if (count < TPM_HEADER_SIZE) {
 		size = -EIO;
@@ -328,6 +329,13 @@ static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 		goto out;
 	}
 
+	rc = tpm_tis_verify_crc(priv, (size_t)size, buf);
+	if (rc < 0) {
+		dev_err(&chip->dev, "CRC mismatch for response.\n");
+		size = rc;
+		goto out;
+	}
+
 out:
 	tpm_tis_ready(chip);
 	return size;
@@ -443,6 +451,12 @@ static int tpm_tis_send_main(struct tpm_chip *chip, const u8 *buf, size_t len)
 	if (rc < 0)
 		return rc;
 
+	rc = tpm_tis_verify_crc(priv, len, buf);
+	if (rc < 0) {
+		dev_err(&chip->dev, "CRC mismatch for command.\n");
+		return rc;
+	}
+
 	/* go and do it */
 	rc = tpm_tis_write8(priv, TPM_STS(priv->locality), TPM_STS_GO);
 	if (rc < 0)
drivers/char/tpm/tpm_tis_core.h +10 -0
index 6c203f36b8a1..66a5a13cd1df 100644
@@ -121,6 +121,8 @@ struct tpm_tis_phy_ops {
 			  u8 *result, enum tpm_tis_io_mode mode);
 	int (*write_bytes)(struct tpm_tis_data *data, u32 addr, u16 len,
 			   const u8 *value, enum tpm_tis_io_mode mode);
+	int (*verify_crc)(struct tpm_tis_data *data, size_t len,
+			  const u8 *value);
 };
 
 static inline int tpm_tis_read_bytes(struct tpm_tis_data *data, u32 addr,
@@ -188,6 +190,14 @@ static inline int tpm_tis_write32(struct tpm_tis_data *data, u32 addr,
 	return rc;
 }
 
+static inline int tpm_tis_verify_crc(struct tpm_tis_data *data, size_t len,
+				     const u8 *value)
+{
+	if (!data->phy_ops->verify_crc)
+		return 0;
+	return data->phy_ops->verify_crc(data, len, value);
+}
+
 static inline bool is_bsw(void)
 {
 #ifdef CONFIG_X86
Signature · 1 line
2.25.1
maintainer Reviewed-by on v4 2/3
#7 lore raw

Re: [PATCH v4 2/3] tpm: Add tpm_tis_verify_crc to the tpm_tis_phy_ops protocol layer

Quoted 79 lines · Alexander Steffen

Some TPMs, e.g. those implementing the I2C variant of TIS, can verify data transfers to/from the FIFO with a CRC. The CRC is calculated over the entirety of the FIFO register. Since the phy_ops layer is not aware when the core layer is done reading/writing the FIFO, CRC verification must be triggered from the core layer. To this end, add an optional phy_ops API call.

---
 drivers/char/tpm/tpm_tis_core.c | 14 ++++++++++++++ drivers/char/tpm/tpm_tis_core.h | 10 ++++++++++

 2 files changed, 24 insertions(+)
drivers/char/tpm/tpm_tis_core.c +1 -0
index dc56b976d816..757623bacfd5 100644
@@ -289,6 +289,7 @@ static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
         int size = 0;
         int status;
         u32 expected;
+       int rc;


        if (count < TPM_HEADER_SIZE) {
                size = -EIO;

drivers/char/tpm/tpm_tis_core.c +0 -0
@@ -328,6 +329,13 @@ static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
                 goto out;
         }


+       rc = tpm_tis_verify_crc(priv, (size_t)size, buf); +       if (rc < 0) {
+               dev_err(&chip->dev, "CRC mismatch for response.\n"); +               size = rc;
+               goto out;
+       }
+
 out:
        tpm_tis_ready(chip);
        return size;

drivers/char/tpm/tpm_tis_core.c +0 -0
@@ -443,6 +451,12 @@ static int tpm_tis_send_main(struct tpm_chip *chip, const u8 *buf, size_t len)
         if (rc < 0)
                 return rc;


+       rc = tpm_tis_verify_crc(priv, len, buf);
+       if (rc < 0) {
+               dev_err(&chip->dev, "CRC mismatch for command.\n"); +               return rc;
+       }
+
        /* go and do it */
        rc = tpm_tis_write8(priv, TPM_STS(priv->locality), TPM_STS_GO); if (rc < 0)

drivers/char/tpm/tpm_tis_core.h +2 -0
index 6c203f36b8a1..66a5a13cd1df 100644
@@ -121,6 +121,8 @@ struct tpm_tis_phy_ops {
                           u8 *result, enum tpm_tis_io_mode mode);
         int (*write_bytes)(struct tpm_tis_data *data, u32 addr, u16 len,
                            const u8 *value, enum tpm_tis_io_mode mode);
+       int (*verify_crc)(struct tpm_tis_data *data, size_t len,
+                         const u8 *value);
  };


 static inline int tpm_tis_read_bytes(struct tpm_tis_data *data, u32 addr,

drivers/char/tpm/tpm_tis_core.h +0 -0
@@ -188,6 +190,14 @@ static inline int tpm_tis_write32(struct tpm_tis_data *data, u32 addr,
         return rc;
  }

drivers/char/tpm/tpm_tis_core.h +8 -0
+static inline int tpm_tis_verify_crc(struct tpm_tis_data *data, size_t len,
+                                    const u8 *value)
+{
+       if (!data->phy_ops->verify_crc)
+               return 0;
+       return data->phy_ops->verify_crc(data, len, value);
+}
+
Quoted 3 lines

 static inline bool is_bsw(void)
 {
 #ifdef CONFIG_X86

BR, Jarkko

#8 lore raw

PATCH v4 3/3 tpm: Add tpm_tis_i2c backend for tpm_tis_core

In reply to Alexander Steffen

Implement the TCG I2C Interface driver, as specified in the TCG PC Client Platform TPM Profile (PTP) specification for TPM 2.0 v1.04 revision 14, section 8, I2C Interface Definition.

This driver supports Guard Times. That is, if required by the TPM, the driver has to wait by a vendor-specific time after each I2C read/write. The specific time is read from the TPM_I2C_INTERFACE_CAPABILITY register.

Unfortunately, the TCG specified almost but not quite compatible register addresses. Therefore, the TIS register addresses need to be mapped to I2C ones. The locality is stripped because for now, only locality 0 is supported.

Add a sanity check to I2C reads of e.g. TPM_ACCESS and TPM_STS. This is to detect communication errors and issues due to non-standard behaviour (E.g. the clock stretching quirk in the BCM2835, see 4dbfb5f4401f). In case the sanity check fails, attempt a retry.

---
 drivers/char/tpm/Kconfig       |  12 +
 drivers/char/tpm/Makefile      |   1 +
 drivers/char/tpm/tpm_tis_i2c.c | 406 +++++++++++++++++++++++++++++++++
 3 files changed, 419 insertions(+)
 create mode 100644 drivers/char/tpm/tpm_tis_i2c.c
drivers/char/tpm/Kconfig +12 -0
index 4a5516406c22..927088b2c3d3 100644
@@ -74,6 +74,18 @@ config TCG_TIS_SPI_CR50
 	  If you have a H1 secure module running Cr50 firmware on SPI bus,
 	  say Yes and it will be accessible from within Linux.
 
+config TCG_TIS_I2C
+	tristate "TPM Interface Specification 1.3 Interface / TPM 2.0 FIFO Interface - (I2C - generic)"
+	depends on I2C
+	select CRC_CCITT
+	select TCG_TIS_CORE
+	help
+	  If you have a TPM security chip, compliant with the TCG TPM PTP
+	  (I2C interface) specification and connected to an I2C bus master,
+	  say Yes and it will be accessible from within Linux.
+	  To compile this driver as a module, choose M here;
+	  the module will be called tpm_tis_i2c.
+
 config TCG_TIS_SYNQUACER
 	tristate "TPM Interface Specification 1.2 Interface / TPM 2.0 FIFO Interface (MMIO - SynQuacer)"
 	depends on ARCH_SYNQUACER || COMPILE_TEST
drivers/char/tpm/Makefile +1 -0
index 66d39ea6bd10..0222b1ddb310 100644
@@ -29,6 +29,7 @@ tpm_tis_spi-$(CONFIG_TCG_TIS_SPI_CR50) += tpm_tis_spi_cr50.o
 
 obj-$(CONFIG_TCG_TIS_I2C_CR50) += tpm_tis_i2c_cr50.o
 
+obj-$(CONFIG_TCG_TIS_I2C) += tpm_tis_i2c.o
 obj-$(CONFIG_TCG_TIS_I2C_ATMEL) += tpm_i2c_atmel.o
 obj-$(CONFIG_TCG_TIS_I2C_INFINEON) += tpm_i2c_infineon.o
 obj-$(CONFIG_TCG_TIS_I2C_NUVOTON) += tpm_i2c_nuvoton.o
drivers/char/tpm/tpm_tis_i2c.c new file +406 -0

406 lines not on this page · raw message

Signature · 1 line
2.25.1
#9 lore raw

Re: [PATCH v4 3/3] tpm: Add tpm_tis_i2c backend for tpm_tis_core

Quoted 78 lines · Alexander Steffen

Implement the TCG I2C Interface driver, as specified in the TCG PC Client Platform TPM Profile (PTP) specification for TPM 2.0 v1.04 revision 14, section 8, I2C Interface Definition.

This driver supports Guard Times. That is, if required by the TPM, the driver has to wait by a vendor-specific time after each I2C read/write. The specific time is read from the TPM_I2C_INTERFACE_CAPABILITY register.

Unfortunately, the TCG specified almost but not quite compatible register addresses. Therefore, the TIS register addresses need to be mapped to I2C ones. The locality is stripped because for now, only locality 0 is supported.

Add a sanity check to I2C reads of e.g. TPM_ACCESS and TPM_STS. This is to detect communication errors and issues due to non-standard behaviour (E.g. the clock stretching quirk in the BCM2835, see 4dbfb5f4401f). In case the sanity check fails, attempt a retry.

---
 drivers/char/tpm/Kconfig       |  12 +
 drivers/char/tpm/Makefile      |   1 +
 drivers/char/tpm/tpm_tis_i2c.c | 406 +++++++++++++++++++++++++++++++++
 3 files changed, 419 insertions(+)
 create mode 100644 drivers/char/tpm/tpm_tis_i2c.c
drivers/char/tpm/Kconfig +12 -0
index 4a5516406c22..927088b2c3d3 100644
@@ -74,6 +74,18 @@ config TCG_TIS_SPI_CR50
 	  If you have a H1 secure module running Cr50 firmware on SPI bus,
 	  say Yes and it will be accessible from within Linux.
 
+config TCG_TIS_I2C
+	tristate "TPM Interface Specification 1.3 Interface / TPM 2.0 FIFO Interface - (I2C - generic)"
+	depends on I2C
+	select CRC_CCITT
+	select TCG_TIS_CORE
+	help
+	  If you have a TPM security chip, compliant with the TCG TPM PTP
+	  (I2C interface) specification and connected to an I2C bus master,
+	  say Yes and it will be accessible from within Linux.
+	  To compile this driver as a module, choose M here;
+	  the module will be called tpm_tis_i2c.
+
 config TCG_TIS_SYNQUACER
 	tristate "TPM Interface Specification 1.2 Interface / TPM 2.0 FIFO Interface (MMIO - SynQuacer)"
 	depends on ARCH_SYNQUACER || COMPILE_TEST
drivers/char/tpm/Makefile +1 -0
index 66d39ea6bd10..0222b1ddb310 100644
@@ -29,6 +29,7 @@ tpm_tis_spi-$(CONFIG_TCG_TIS_SPI_CR50) += tpm_tis_spi_cr50.o
 
 obj-$(CONFIG_TCG_TIS_I2C_CR50) += tpm_tis_i2c_cr50.o
 
+obj-$(CONFIG_TCG_TIS_I2C) += tpm_tis_i2c.o
 obj-$(CONFIG_TCG_TIS_I2C_ATMEL) += tpm_i2c_atmel.o
 obj-$(CONFIG_TCG_TIS_I2C_INFINEON) += tpm_i2c_infineon.o
 obj-$(CONFIG_TCG_TIS_I2C_NUVOTON) += tpm_i2c_nuvoton.o
drivers/char/tpm/tpm_tis_i2c.c new file +7 -0
new file mode 100644
index 000000000000..8b9218e5405f
@@ -0,0 +1,406 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2014-2021 Nuvoton Technology corporation
+ * Copyright (C) 2019-2022 Infineon Technologies AG
+ *
+ * This device driver implements the TPM interface as defined in the TCG PC
+ * Client Platform TPM Profile (PTP) Specification for TPM 2.0 v1.04

drivers/char/tpm/tpm_tis_i2c.c line 17

Quoted 10 lines
drivers/char/tpm/tpm_tis_i2c.c new file +10 -0
+ * Revision 14.
+ *
+ * It is based on the tpm_tis_spi device driver.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>

Is it used?

drivers/char/tpm/tpm_tis_i2c.c line 19

Quoted 2 lines
drivers/char/tpm/tpm_tis_i2c.c new file +2 -0
+#include <linux/wait.h>
+#include <linux/acpi.h>

Is it used?

drivers/char/tpm/tpm_tis_i2c.c line 20

Quoted 1 line
drivers/char/tpm/tpm_tis_i2c.c new file +1 -0
+#include <linux/freezer.h>

Is it used?

drivers/char/tpm/tpm_tis_i2c.c line 26

Quoted 7 lines
drivers/char/tpm/tpm_tis_i2c.c new file +6 -0
+
+#include <linux/module.h>
+#include <linux/i2c.h>
 
+#include <linux/gpio.h>
+#include <linux/of_irq.h>
+#include <linux/of_gpio.h>

The same for these three.

Best regards,
Krzysztof