3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef __I2C_ACPI_H__
13 #define __I2C_ACPI_H__
15 #include <Protocol/DevicePath.h>
20 typedef struct _EFI_I2C_ACPI_PROTOCOL EFI_I2C_ACPI_PROTOCOL
;
23 // I2C device description
25 // This structure provides the platform specific information which
26 // describes an I2C device.
30 // Hardware revision - ACPI _HRV value
32 UINT32 HardwareRevision
;
35 // Device path node for the I2C device.
37 CONST EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
40 // I2C bus configuration for the I2C device.
42 UINT32 I2cBusConfiguration
;
45 // Number of slave addresses for the I2C device.
47 UINT32 SlaveAddressCount
;
50 // Address of the array of slave addresses for the I2C device.
52 CONST UINT32
*SlaveAddressArray
;
57 Enumerate the I2C devices
59 This routine must be called at or below TPL_NOTIFY.
61 This function walks the platform specific data to enumerates the
62 I2C devices on an I2C bus.
64 @param[in] This Address of an EFI_I2C_ENUM_PROTOCOL
66 @param[in, out] Device Buffer containing the address of an
67 EFI_I2C_DEVICE structure. Enumeration
68 is started by setting the initial
69 EFI_I2C_DEVICE structure address to NULL.
70 The buffer receives an EFI_I2C_DEVICE
71 structure address for the next I2C device.
73 @retval EFI_SUCCESS The platform data for the next device
74 on the I2C bus was returned successfully.
75 @retval EFI_INVALID_PARAMETER NextDevice was NULL
76 @retval EFI_NO_MAPPING PreviousDevice does not point to a valid
77 EFI_I2C_DEVICE structure.
82 (EFIAPI
*EFI_I2C_ACPI_ENUMERATE
) (
83 IN CONST EFI_I2C_ACPI_PROTOCOL
*This
,
84 IN OUT CONST EFI_I2C_DEVICE
**Device
88 // I2C device description
90 // This structure provides the platform specific information which
91 // describes an I2C device.
93 struct _EFI_I2C_ACPI_PROTOCOL
{
95 // Walk the platform's list of I2C devices on the bus. This
96 // routine returns the next I2C device in the platform's list
99 EFI_I2C_ACPI_ENUMERATE Enumerate
;
103 // Variable containing the GUID for the I2C device enumeration protocol
105 extern EFI_GUID gEfiI2cAcpiProtocolGuid
;
107 #endif // __I2C_ACPI_H__