diff options
| author | Simon Glass <[email protected]> | 2022-07-22 21:32:02 +0530 |
|---|---|---|
| committer | Ilias Apalodimas <[email protected]> | 2022-08-02 23:50:02 +0300 |
| commit | 5e5937822a50224631963402ff3c033d2524a55f (patch) | |
| tree | 12120b81a8a4d8d5e5c3943f8f74d33437d2407c /include/tpm_api.h | |
| parent | 707b17f64e71fad1615ea25082f2e928f712e366 (diff) | |
tpm: Export the TPM-version functions
These functions should really be available outside the TPM code, so that
other callers can find out which version the TPM is. Rename them to have
a tpm_ prefix() and add them to the header file.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'include/tpm_api.h')
| -rw-r--r-- | include/tpm_api.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/tpm_api.h b/include/tpm_api.h index ef45b43a8fb..11aa14eb793 100644 --- a/include/tpm_api.h +++ b/include/tpm_api.h @@ -319,4 +319,14 @@ u32 tpm_write_lock(struct udevice *dev, u32 index); */ u32 tpm_resume(struct udevice *dev); +static inline bool tpm_is_v1(struct udevice *dev) +{ + return IS_ENABLED(CONFIG_TPM_V1) && tpm_get_version(dev) == TPM_V1; +} + +static inline bool tpm_is_v2(struct udevice *dev) +{ + return IS_ENABLED(CONFIG_TPM_V2) && tpm_get_version(dev) == TPM_V2; +} + #endif /* __TPM_API_H */ |
