summaryrefslogtreecommitdiff
path: root/Vlv2TbltDevicePkg/Include/Protocol/I2cAcpi.h
blob: 14a0b7079e52dbea5765fdf30e2d7b61b4445035 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*++

  Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>
                                                                                   

  This program and the accompanying materials are licensed and made available under

  the terms and conditions of the BSD License that accompanies this distribution.  

  The full text of the license may be found at                                     

  http://opensource.org/licenses/bsd-license.php.                                  

                                                                                   

  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,            

  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.    

                                                                                   



**/

#ifndef __I2C_ACPI_H__
#define __I2C_ACPI_H__

#include <Protocol/DevicePath.h>

//
// I2C ACPI protocol
//
typedef struct _EFI_I2C_ACPI_PROTOCOL   EFI_I2C_ACPI_PROTOCOL;

//
// I2C device description
//
// This structure provides the platform specific information which
// describes an I2C device.
//
typedef struct {
  //
  // Hardware revision - ACPI _HRV value
  //
  UINT32 HardwareRevision;

  //
  // Device path node for the I2C device.
  //
  CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;

  //
  // I2C bus configuration for the I2C device.
  //
  UINT32 I2cBusConfiguration;

  //
  // Number of slave addresses for the I2C device.
  //
  UINT32 SlaveAddressCount;

  //
  // Address of the array of slave addresses for the I2C device.
  //
  CONST UINT32 *SlaveAddressArray;
}EFI_I2C_DEVICE;


/**
  Enumerate the I2C devices

  This routine must be called at or below TPL_NOTIFY.

  This function walks the platform specific data to enumerates the
  I2C devices on an I2C bus.

  @param[in]  This              Address of an EFI_I2C_ENUM_PROTOCOL
                                structure.
  @param[in, out] Device        Buffer containing the address of an
                                EFI_I2C_DEVICE structure.  Enumeration
                                is started by setting the initial
                                EFI_I2C_DEVICE structure address to NULL.
                                The buffer receives an EFI_I2C_DEVICE
                                structure address for the next I2C device.

  @retval EFI_SUCCESS           The platform data for the next device
                                on the I2C bus was returned successfully.
  @retval EFI_INVALID_PARAMETER NextDevice was NULL
  @retval EFI_NO_MAPPING        PreviousDevice does not point to a valid
                                EFI_I2C_DEVICE structure.

**/
typedef
EFI_STATUS
(EFIAPI *EFI_I2C_ACPI_ENUMERATE) (
  IN CONST EFI_I2C_ACPI_PROTOCOL *This,
  IN OUT CONST EFI_I2C_DEVICE **Device
  );

//
// I2C device description
//
// This structure provides the platform specific information which
// describes an I2C device.
//
struct _EFI_I2C_ACPI_PROTOCOL {
  //
  // Walk the platform's list of I2C devices on the bus.  This
  // routine returns the next I2C device in the platform's list
  // for this I2C bus.
  //
  EFI_I2C_ACPI_ENUMERATE Enumerate;
};

//
// Variable containing the GUID for the I2C device enumeration protocol
//
extern EFI_GUID gEfiI2cAcpiProtocolGuid;

#endif  //  __I2C_ACPI_H__