]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Vlv2TbltDevicePkg/Include/Protocol/I2cAcpi.h
Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
[mirror_edk2.git] / Vlv2TbltDevicePkg / Include / Protocol / I2cAcpi.h
diff --git a/Vlv2TbltDevicePkg/Include/Protocol/I2cAcpi.h b/Vlv2TbltDevicePkg/Include/Protocol/I2cAcpi.h
new file mode 100644 (file)
index 0000000..14a0b70
--- /dev/null
@@ -0,0 +1,112 @@
+/*++\r
+\r
+  Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>\r
+                                                                                   \r\r
+  This program and the accompanying materials are licensed and made available under\r\r
+  the terms and conditions of the BSD License that accompanies this distribution.  \r\r
+  The full text of the license may be found at                                     \r\r
+  http://opensource.org/licenses/bsd-license.php.                                  \r\r
+                                                                                   \r\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,            \r\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.    \r\r
+                                                                                   \r\r
+\r
+\r
+**/\r
+\r
+#ifndef __I2C_ACPI_H__\r
+#define __I2C_ACPI_H__\r
+\r
+#include <Protocol/DevicePath.h>\r
+\r
+//\r
+// I2C ACPI protocol\r
+//\r
+typedef struct _EFI_I2C_ACPI_PROTOCOL   EFI_I2C_ACPI_PROTOCOL;\r
+\r
+//\r
+// I2C device description\r
+//\r
+// This structure provides the platform specific information which\r
+// describes an I2C device.\r
+//\r
+typedef struct {\r
+  //\r
+  // Hardware revision - ACPI _HRV value\r
+  //\r
+  UINT32 HardwareRevision;\r
+\r
+  //\r
+  // Device path node for the I2C device.\r
+  //\r
+  CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
+\r
+  //\r
+  // I2C bus configuration for the I2C device.\r
+  //\r
+  UINT32 I2cBusConfiguration;\r
+\r
+  //\r
+  // Number of slave addresses for the I2C device.\r
+  //\r
+  UINT32 SlaveAddressCount;\r
+\r
+  //\r
+  // Address of the array of slave addresses for the I2C device.\r
+  //\r
+  CONST UINT32 *SlaveAddressArray;\r
+}EFI_I2C_DEVICE;\r
+\r
+\r
+/**\r
+  Enumerate the I2C devices\r
+\r
+  This routine must be called at or below TPL_NOTIFY.\r
+\r
+  This function walks the platform specific data to enumerates the\r
+  I2C devices on an I2C bus.\r
+\r
+  @param[in]  This              Address of an EFI_I2C_ENUM_PROTOCOL\r
+                                structure.\r
+  @param[in, out] Device        Buffer containing the address of an\r
+                                EFI_I2C_DEVICE structure.  Enumeration\r
+                                is started by setting the initial\r
+                                EFI_I2C_DEVICE structure address to NULL.\r
+                                The buffer receives an EFI_I2C_DEVICE\r
+                                structure address for the next I2C device.\r
+\r
+  @retval EFI_SUCCESS           The platform data for the next device\r
+                                on the I2C bus was returned successfully.\r
+  @retval EFI_INVALID_PARAMETER NextDevice was NULL\r
+  @retval EFI_NO_MAPPING        PreviousDevice does not point to a valid\r
+                                EFI_I2C_DEVICE structure.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_I2C_ACPI_ENUMERATE) (\r
+  IN CONST EFI_I2C_ACPI_PROTOCOL *This,\r
+  IN OUT CONST EFI_I2C_DEVICE **Device\r
+  );\r
+\r
+//\r
+// I2C device description\r
+//\r
+// This structure provides the platform specific information which\r
+// describes an I2C device.\r
+//\r
+struct _EFI_I2C_ACPI_PROTOCOL {\r
+  //\r
+  // Walk the platform's list of I2C devices on the bus.  This\r
+  // routine returns the next I2C device in the platform's list\r
+  // for this I2C bus.\r
+  //\r
+  EFI_I2C_ACPI_ENUMERATE Enumerate;\r
+};\r
+\r
+//\r
+// Variable containing the GUID for the I2C device enumeration protocol\r
+//\r
+extern EFI_GUID gEfiI2cAcpiProtocolGuid;\r
+\r
+#endif  //  __I2C_ACPI_H__\r