tpm: refactor function names and macros for infineon v1.2 TPM

With the upcoming TPM2 API, some of the functions name are part of the new
header file.  So switch conflicting internal function names and defines.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff --git a/drivers/tpm/tpm_tis_infineon.c b/drivers/tpm/tpm_tis_infineon.c
index f414e56..525ad72 100644
--- a/drivers/tpm/tpm_tis_infineon.c
+++ b/drivers/tpm/tpm_tis_infineon.c
@@ -50,10 +50,10 @@
 	[UNKNOWN] = "unknown/fallback to slb9635",
 };
 
-#define	TPM_ACCESS(l)			(0x0000 | ((l) << 4))
-#define	TPM_STS(l)			(0x0001 | ((l) << 4))
-#define	TPM_DATA_FIFO(l)		(0x0005 | ((l) << 4))
-#define	TPM_DID_VID(l)			(0x0006 | ((l) << 4))
+#define	TPM_INFINEON_ACCESS(l)			(0x0000 | ((l) << 4))
+#define	TPM_INFINEON_STS(l)			(0x0001 | ((l) << 4))
+#define	TPM_INFINEON_DATA_FIFO(l)		(0x0005 | ((l) << 4))
+#define	TPM_INFINEON_DID_VID(l)			(0x0006 | ((l) << 4))
 
 /*
  * tpm_tis_i2c_read() - read from TPM register
@@ -197,7 +197,7 @@
 	u8 buf;
 	int rc;
 
-	rc = tpm_tis_i2c_read(dev, TPM_ACCESS(loc), &buf, 1);
+	rc = tpm_tis_i2c_read(dev, TPM_INFINEON_ACCESS(loc), &buf, 1);
 	if (rc < 0)
 		return rc;
 
@@ -215,12 +215,12 @@
 	const u8 mask = TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID;
 	u8 buf;
 
-	if (tpm_tis_i2c_read(dev, TPM_ACCESS(loc), &buf, 1) < 0)
+	if (tpm_tis_i2c_read(dev, TPM_INFINEON_ACCESS(loc), &buf, 1) < 0)
 		return;
 
 	if (force || (buf & mask) == mask) {
 		buf = TPM_ACCESS_ACTIVE_LOCALITY;
-		tpm_tis_i2c_write(dev, TPM_ACCESS(loc), &buf, 1);
+		tpm_tis_i2c_write(dev, TPM_INFINEON_ACCESS(loc), &buf, 1);
 	}
 }
 
@@ -240,7 +240,7 @@
 		return rc;
 	}
 
-	rc = tpm_tis_i2c_write(dev, TPM_ACCESS(loc), &buf, 1);
+	rc = tpm_tis_i2c_write(dev, TPM_INFINEON_ACCESS(loc), &buf, 1);
 	if (rc) {
 		debug("%s: Failed to write to TPM: %d\n", __func__, rc);
 		return rc;
@@ -271,7 +271,7 @@
 	/* NOTE: Since i2c read may fail, return 0 in this case --> time-out */
 	u8 buf;
 
-	if (tpm_tis_i2c_read(dev, TPM_STS(chip->locality), &buf, 1) < 0)
+	if (tpm_tis_i2c_read(dev, TPM_INFINEON_STS(chip->locality), &buf, 1) < 0)
 		return 0;
 	else
 		return buf;
@@ -286,7 +286,7 @@
 	u8 buf = TPM_STS_COMMAND_READY;
 
 	debug("%s\n", __func__);
-	rc = tpm_tis_i2c_write_long(dev, TPM_STS(chip->locality), &buf, 1);
+	rc = tpm_tis_i2c_write_long(dev, TPM_INFINEON_STS(chip->locality), &buf, 1);
 	if (rc)
 		debug("%s: rc=%d\n", __func__, rc);
 
@@ -306,7 +306,7 @@
 	stop = chip->timeout_d;
 	do {
 		/* Note: STS is little endian */
-		addr = TPM_STS(chip->locality) + 1;
+		addr = TPM_INFINEON_STS(chip->locality) + 1;
 		if (tpm_tis_i2c_read(dev, addr, buf, 3) < 0)
 			burstcnt = 0;
 		else
@@ -360,7 +360,7 @@
 		if (burstcnt > (count - size))
 			burstcnt = count - size;
 
-		rc = tpm_tis_i2c_read(dev, TPM_DATA_FIFO(chip->locality),
+		rc = tpm_tis_i2c_read(dev, TPM_INFINEON_DATA_FIFO(chip->locality),
 				      &(buf[size]), burstcnt);
 		if (rc == 0)
 			size += burstcnt;
@@ -462,7 +462,7 @@
 			burstcnt = CONFIG_TPM_TIS_I2C_BURST_LIMITATION_LEN;
 #endif /* CONFIG_TPM_TIS_I2C_BURST_LIMITATION */
 
-		rc = tpm_tis_i2c_write(dev, TPM_DATA_FIFO(chip->locality),
+		rc = tpm_tis_i2c_write(dev, TPM_INFINEON_DATA_FIFO(chip->locality),
 				       &(buf[count]), burstcnt);
 		if (rc == 0)
 			count += burstcnt;
@@ -482,7 +482,7 @@
 	}
 
 	/* Go and do it */
-	rc = tpm_tis_i2c_write(dev, TPM_STS(chip->locality), &sts, 1);
+	rc = tpm_tis_i2c_write(dev, TPM_INFINEON_STS(chip->locality), &sts, 1);
 	if (rc < 0)
 		return rc;
 	debug("%s: done, rc=%d\n", __func__, rc);
@@ -525,7 +525,7 @@
 		return rc;
 
 	/* Read four bytes from DID_VID register */
-	if (tpm_tis_i2c_read(dev, TPM_DID_VID(0), (uchar *)&vendor, 4) < 0) {
+	if (tpm_tis_i2c_read(dev, TPM_INFINEON_DID_VID(0), (uchar *)&vendor, 4) < 0) {
 		tpm_tis_i2c_release_locality(dev, 0, 1);
 		return -EIO;
 	}
@@ -583,7 +583,7 @@
 	return 0;
 }
 
-static int tpm_tis_get_desc(struct udevice *dev, char *buf, int size)
+static int tpm_tis_i2c_get_desc(struct udevice *dev, char *buf, int size)
 {
 	struct tpm_chip *chip = dev_get_priv(dev);
 
@@ -615,7 +615,7 @@
 static const struct tpm_ops tpm_tis_i2c_ops = {
 	.open		= tpm_tis_i2c_open,
 	.close		= tpm_tis_i2c_close,
-	.get_desc	= tpm_tis_get_desc,
+	.get_desc	= tpm_tis_i2c_get_desc,
 	.send		= tpm_tis_i2c_send,
 	.recv		= tpm_tis_i2c_recv,
 	.cleanup	= tpm_tis_i2c_cleanup,