/* The common function cache current active TpmInterfaceType when needed. */
EFI_STATUS InternalTpm2DeviceLibDTpmCommonConstructor(VOID)
/* The common function cache current active TpmInterfaceType when needed. */
EFI_STATUS InternalTpm2DeviceLibDTpmCommonConstructor(VOID)
{
  TPM2_PTP_INTERFACE_TYPE  PtpInterface;
  UINT8                    IdleByPass;
  if (PcdGet8 (PcdActiveTpmInterfaceType) == 0xFF) {
    PtpInterface = Tpm2GetPtpInterface ((VOID *)(UINTN)PcdGet64 (PcdTpmBaseAddress));
    PcdSet8S (PcdActiveTpmInterfaceType, PtpInterface);
  }
  if ((PcdGet8 (PcdActiveTpmInterfaceType) == Tpm2PtpInterfaceCrb) && (PcdGet8 (PcdCRBIdleByPass) == 0xFF)) {
    IdleByPass = Tpm2GetIdleByPass ((VOID *)(UINTN)PcdGet64 (PcdTpmBaseAddress));
    PcdSet8S (PcdCRBIdleByPass, IdleByPass);
  }
  return EFI_SUCCESS;
}