/* EFI_SUCCESS - GPIO state returned in Value EFI_INVALID_PARAMETER - Value is NULL pointer or Gpio pin is out of range  */
EFI_STATUS EFIAPI Get(IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, OUT UINTN *Value)
/* EFI_SUCCESS - GPIO state returned in Value EFI_INVALID_PARAMETER - Value is NULL pointer or Gpio pin is out of range  */
EFI_STATUS EFIAPI Get(IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, OUT UINTN *Value)
{
  EFI_STATUS  Status;
  UINTN       Index, Offset, RegisterBase;
  Status = PL061Locate (Gpio, &Index, &Offset, &RegisterBase);
  ASSERT_EFI_ERROR (Status);
  if (Value == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  if (PL061GetPins (RegisterBase, GPIO_PIN_MASK (Offset)) != 0) {
    *Value = 1;
  } else {
    *Value = 0;
  }
  return EFI_SUCCESS;
}