]>
Commit | Line | Data |
---|---|---|
3cbfba02 DW |
1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r | |
4 | \r\r | |
5 | This program and the accompanying materials are licensed and made available under\r\r | |
6 | the terms and conditions of the BSD License that accompanies this distribution. \r\r | |
7 | The full text of the license may be found at \r\r | |
8 | http://opensource.org/licenses/bsd-license.php. \r\r | |
9 | \r\r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r\r | |
12 | \r\r | |
13 | \r | |
14 | \r | |
15 | **/\r | |
16 | \r | |
17 | #ifndef __I2C_ACPI_H__\r | |
18 | #define __I2C_ACPI_H__\r | |
19 | \r | |
20 | #include <Protocol/DevicePath.h>\r | |
21 | \r | |
22 | //\r | |
23 | // I2C ACPI protocol\r | |
24 | //\r | |
25 | typedef struct _EFI_I2C_ACPI_PROTOCOL EFI_I2C_ACPI_PROTOCOL;\r | |
26 | \r | |
27 | //\r | |
28 | // I2C device description\r | |
29 | //\r | |
30 | // This structure provides the platform specific information which\r | |
31 | // describes an I2C device.\r | |
32 | //\r | |
33 | typedef struct {\r | |
34 | //\r | |
35 | // Hardware revision - ACPI _HRV value\r | |
36 | //\r | |
37 | UINT32 HardwareRevision;\r | |
38 | \r | |
39 | //\r | |
40 | // Device path node for the I2C device.\r | |
41 | //\r | |
42 | CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
43 | \r | |
44 | //\r | |
45 | // I2C bus configuration for the I2C device.\r | |
46 | //\r | |
47 | UINT32 I2cBusConfiguration;\r | |
48 | \r | |
49 | //\r | |
50 | // Number of slave addresses for the I2C device.\r | |
51 | //\r | |
52 | UINT32 SlaveAddressCount;\r | |
53 | \r | |
54 | //\r | |
55 | // Address of the array of slave addresses for the I2C device.\r | |
56 | //\r | |
57 | CONST UINT32 *SlaveAddressArray;\r | |
58 | }EFI_I2C_DEVICE;\r | |
59 | \r | |
60 | \r | |
61 | /**\r | |
62 | Enumerate the I2C devices\r | |
63 | \r | |
64 | This routine must be called at or below TPL_NOTIFY.\r | |
65 | \r | |
66 | This function walks the platform specific data to enumerates the\r | |
67 | I2C devices on an I2C bus.\r | |
68 | \r | |
69 | @param[in] This Address of an EFI_I2C_ENUM_PROTOCOL\r | |
70 | structure.\r | |
71 | @param[in, out] Device Buffer containing the address of an\r | |
72 | EFI_I2C_DEVICE structure. Enumeration\r | |
73 | is started by setting the initial\r | |
74 | EFI_I2C_DEVICE structure address to NULL.\r | |
75 | The buffer receives an EFI_I2C_DEVICE\r | |
76 | structure address for the next I2C device.\r | |
77 | \r | |
78 | @retval EFI_SUCCESS The platform data for the next device\r | |
79 | on the I2C bus was returned successfully.\r | |
80 | @retval EFI_INVALID_PARAMETER NextDevice was NULL\r | |
81 | @retval EFI_NO_MAPPING PreviousDevice does not point to a valid\r | |
82 | EFI_I2C_DEVICE structure.\r | |
83 | \r | |
84 | **/\r | |
85 | typedef\r | |
86 | EFI_STATUS\r | |
87 | (EFIAPI *EFI_I2C_ACPI_ENUMERATE) (\r | |
88 | IN CONST EFI_I2C_ACPI_PROTOCOL *This,\r | |
89 | IN OUT CONST EFI_I2C_DEVICE **Device\r | |
90 | );\r | |
91 | \r | |
92 | //\r | |
93 | // I2C device description\r | |
94 | //\r | |
95 | // This structure provides the platform specific information which\r | |
96 | // describes an I2C device.\r | |
97 | //\r | |
98 | struct _EFI_I2C_ACPI_PROTOCOL {\r | |
99 | //\r | |
100 | // Walk the platform's list of I2C devices on the bus. This\r | |
101 | // routine returns the next I2C device in the platform's list\r | |
102 | // for this I2C bus.\r | |
103 | //\r | |
104 | EFI_I2C_ACPI_ENUMERATE Enumerate;\r | |
105 | };\r | |
106 | \r | |
107 | //\r | |
108 | // Variable containing the GUID for the I2C device enumeration protocol\r | |
109 | //\r | |
110 | extern EFI_GUID gEfiI2cAcpiProtocolGuid;\r | |
111 | \r | |
112 | #endif // __I2C_ACPI_H__\r |