summaryrefslogtreecommitdiff
path: root/drivers/tpm/tpm_tis_i2c.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-08-22 18:31:30 -0600
committerSimon Glass <sjg@chromium.org>2015-08-31 07:57:28 -0600
commit42c8ec56c531c99e2a346358a12ba5b69481f9de (patch)
tree16724c554c6682c1290323b6236894219d33b6c2 /drivers/tpm/tpm_tis_i2c.h
parente56e20eb860cadc4cc28d275f025fc8977b306ce (diff)
downloadu-boot-imx-42c8ec56c531c99e2a346358a12ba5b69481f9de.zip
u-boot-imx-42c8ec56c531c99e2a346358a12ba5b69481f9de.tar.gz
u-boot-imx-42c8ec56c531c99e2a346358a12ba5b69481f9de.tar.bz2
tpm: tpm_tis_i2c: Tidy up delays
Use a _US suffix for microseconds and a _MS suffic for milliseconds. Move all timeouts and delays into one place. Use mdelay() instead of udelay() where appropriate. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Christophe Ricard <christophe-h.ricard@st.com> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'drivers/tpm/tpm_tis_i2c.h')
-rw-r--r--drivers/tpm/tpm_tis_i2c.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/tpm/tpm_tis_i2c.h b/drivers/tpm/tpm_tis_i2c.h
index db99200..ecdaf0c 100644
--- a/drivers/tpm/tpm_tis_i2c.h
+++ b/drivers/tpm/tpm_tis_i2c.h
@@ -23,7 +23,11 @@
#include <linux/types.h>
enum tpm_timeout {
- TPM_TIMEOUT = 5, /* msecs */
+ TPM_TIMEOUT_MS = 5,
+ TIS_SHORT_TIMEOUT_MS = 750,
+ TIS_LONG_TIMEOUT_MS = 2000,
+ SLEEP_DURATION_US = 60,
+ SLEEP_DURATION_LONG_US = 210,
};
/* Size of external transmit buffer (used in tpm_transmit)*/
@@ -125,9 +129,6 @@ struct tpm_cmd_t {
*/
#define MAX_COUNT_LONG 50
-#define SLEEP_DURATION 60 /* in usec */
-#define SLEEP_DURATION_LONG 210 /* in usec */
-
#define TPM_HEADER_SIZE 10
enum tis_access {
@@ -145,11 +146,6 @@ enum tis_status {
TPM_STS_DATA_EXPECT = 0x08,
};
-enum tis_defaults {
- TIS_SHORT_TIMEOUT = 750, /* ms */
- TIS_LONG_TIMEOUT = 2000, /* ms */
-};
-
/* expected value for DIDVID register */
#define TPM_TIS_I2C_DID_VID_9635 0x000b15d1L
#define TPM_TIS_I2C_DID_VID_9645 0x001a15d1L
@@ -169,7 +165,7 @@ enum tpm_duration {
/* Extended error numbers from linux (see errno.h) */
#define ECANCELED 125 /* Operation Canceled */
-/* Timer frequency. Corresponds to msec timer resolution*/
+/* Timer frequency. Corresponds to msec timer resolution */
#define HZ 1000
#define TPM_MAX_ORDINAL 243