From 42c8ec56c531c99e2a346358a12ba5b69481f9de Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 22 Aug 2015 18:31:30 -0600 Subject: 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 Acked-by: Christophe Ricard Reviewed-by: Heiko Schocher --- drivers/tpm/tpm_tis_i2c.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'drivers/tpm/tpm_tis_i2c.h') 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 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 -- cgit v1.1