]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/Include/Protocol/I2cAcpi.h
Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
[mirror_edk2.git] / Vlv2TbltDevicePkg / Include / Protocol / I2cAcpi.h
1 /*++
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
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.
9
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.
12
13
14
15 **/
16
17 #ifndef __I2C_ACPI_H__
18 #define __I2C_ACPI_H__
19
20 #include <Protocol/DevicePath.h>
21
22 //
23 // I2C ACPI protocol
24 //
25 typedef struct _EFI_I2C_ACPI_PROTOCOL EFI_I2C_ACPI_PROTOCOL;
26
27 //
28 // I2C device description
29 //
30 // This structure provides the platform specific information which
31 // describes an I2C device.
32 //
33 typedef struct {
34 //
35 // Hardware revision - ACPI _HRV value
36 //
37 UINT32 HardwareRevision;
38
39 //
40 // Device path node for the I2C device.
41 //
42 CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;
43
44 //
45 // I2C bus configuration for the I2C device.
46 //
47 UINT32 I2cBusConfiguration;
48
49 //
50 // Number of slave addresses for the I2C device.
51 //
52 UINT32 SlaveAddressCount;
53
54 //
55 // Address of the array of slave addresses for the I2C device.
56 //
57 CONST UINT32 *SlaveAddressArray;
58 }EFI_I2C_DEVICE;
59
60
61 /**
62 Enumerate the I2C devices
63
64 This routine must be called at or below TPL_NOTIFY.
65
66 This function walks the platform specific data to enumerates the
67 I2C devices on an I2C bus.
68
69 @param[in] This Address of an EFI_I2C_ENUM_PROTOCOL
70 structure.
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.
77
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.
83
84 **/
85 typedef
86 EFI_STATUS
87 (EFIAPI *EFI_I2C_ACPI_ENUMERATE) (
88 IN CONST EFI_I2C_ACPI_PROTOCOL *This,
89 IN OUT CONST EFI_I2C_DEVICE **Device
90 );
91
92 //
93 // I2C device description
94 //
95 // This structure provides the platform specific information which
96 // describes an I2C device.
97 //
98 struct _EFI_I2C_ACPI_PROTOCOL {
99 //
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
102 // for this I2C bus.
103 //
104 EFI_I2C_ACPI_ENUMERATE Enumerate;
105 };
106
107 //
108 // Variable containing the GUID for the I2C device enumeration protocol
109 //
110 extern EFI_GUID gEfiI2cAcpiProtocolGuid;
111
112 #endif // __I2C_ACPI_H__