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