From e67ffb5aa5ab03a89305f4575ad3142486f9a306 Mon Sep 17 00:00:00 2001 From: Sughosh Ganu Date: Fri, 22 Jul 2022 21:32:04 +0530 Subject: tpm: rng: Add driver model interface for TPM RNG device The TPM device has a builtin random number generator(RNG) functionality. Expose the RNG functions of the TPM device to the driver model so that they can be used by the EFI_RNG_PROTOCOL if the protocol is installed. Also change the function arguments and return type of the random number functions to comply with the driver model api. Signed-off-by: Sughosh Ganu Reviewed-by: Ilias Apalodimas Signed-off-by: Ilias Apalodimas --- lib/tpm_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/tpm_api.c') diff --git a/lib/tpm_api.c b/lib/tpm_api.c index 4ac4612c81e..032f383ca04 100644 --- a/lib/tpm_api.c +++ b/lib/tpm_api.c @@ -269,7 +269,7 @@ u32 tpm_get_random(struct udevice *dev, void *data, u32 count) if (tpm_is_v1(dev)) return tpm1_get_random(dev, data, count); else if (tpm_is_v2(dev)) - return -ENOSYS; /* not implemented yet */ - else - return -ENOSYS; + return tpm2_get_random(dev, data, count); + + return -ENOSYS; } -- cgit v1.2.3