3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #ifndef __I2C_ACPI_H__
18 #define __I2C_ACPI_H__
20 #include <Protocol/DevicePath.h>
25 typedef struct _EFI_I2C_ACPI_PROTOCOL EFI_I2C_ACPI_PROTOCOL
;
28 // I2C device description
30 // This structure provides the platform specific information which
31 // describes an I2C device.
35 // Hardware revision - ACPI _HRV value
37 UINT32 HardwareRevision
;
40 // Device path node for the I2C device.
42 CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
45 // I2C bus configuration for the I2C device.
47 UINT32 I2cBusConfiguration
;
50 // Number of slave addresses for the I2C device.
52 UINT32 SlaveAddressCount
;
55 // Address of the array of slave addresses for the I2C device.
57 CONST UINT32
*SlaveAddressArray
;
62 Enumerate the I2C devices
64 This routine must be called at or below TPL_NOTIFY.
66 This function walks the platform specific data to enumerates the
67 I2C devices on an I2C bus.
69 @param[in] This Address of an EFI_I2C_ENUM_PROTOCOL
71 @param[in, out] Device Buffer containing the address of an
72 EFI_I2C_DEVICE structure. Enumeration
73 is started by setting the initial
74 EFI_I2C_DEVICE structure address to NULL.
75 The buffer receives an EFI_I2C_DEVICE
76 structure address for the next I2C device.
78 @retval EFI_SUCCESS The platform data for the next device
79 on the I2C bus was returned successfully.
80 @retval EFI_INVALID_PARAMETER NextDevice was NULL
81 @retval EFI_NO_MAPPING PreviousDevice does not point to a valid
82 EFI_I2C_DEVICE structure.
87 (EFIAPI
*EFI_I2C_ACPI_ENUMERATE
) (
88 IN CONST EFI_I2C_ACPI_PROTOCOL
*This
,
89 IN OUT CONST EFI_I2C_DEVICE
**Device
93 // I2C device description
95 // This structure provides the platform specific information which
96 // describes an I2C device.
98 struct _EFI_I2C_ACPI_PROTOCOL
{
100 // Walk the platform's list of I2C devices on the bus. This
101 // routine returns the next I2C device in the platform's list
104 EFI_I2C_ACPI_ENUMERATE Enumerate
;
108 // Variable containing the GUID for the I2C device enumeration protocol
110 extern EFI_GUID gEfiI2cAcpiProtocolGuid
;
112 #endif // __I2C_ACPI_H__