summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/I2c/I2cDxe
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Bus/I2c/I2cDxe')
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c68
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cBusDxeExtra.uni6
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.h16
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cDxeExtra.uni6
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c44
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cHostDxeExtra.uni6
6 files changed, 73 insertions, 73 deletions
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c
index cad5ad7d44..99d9208490 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c
@@ -1,8 +1,8 @@
/** @file
- This file implements I2C IO Protocol which enables the user to manipulate a single
+ This file implements I2C IO Protocol which enables the user to manipulate a single
I2C device independent of the host controller and I2C design.
- Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2013 - 2018, 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
which accompanies this distribution. The full text of the license may be found at
@@ -76,7 +76,7 @@ VENDOR_DEVICE_PATH gVendorDevicePathTemplate = {
};
//
-// Driver name table
+// Driver name table
//
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mI2cBusDriverNameTable[] = {
{ "eng;en", (CHAR16 *) L"I2C Bus Driver" },
@@ -241,12 +241,12 @@ I2cBusComponentNameGetControllerName (
/**
Check if the child of I2C controller has been created.
- @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
+ @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] Controller I2C controller handle.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path.
@param[in] RemainingHasControllerNode Indicate if RemainingDevicePath contains CONTROLLER_DEVICE_PATH.
@param[in] RemainingControllerNumber Controller number in CONTROLLER_DEVICE_PATH.
-
+
@retval EFI_SUCCESS The child of I2C controller is not created.
@retval Others The child of I2C controller has been created or other errors happen.
@@ -266,11 +266,11 @@ CheckRemainingDevicePath (
UINTN EntryCount;
UINTN Index;
BOOLEAN SystemHasControllerNode;
- UINT32 SystemControllerNumber;
+ UINT32 SystemControllerNumber;
SystemHasControllerNode = FALSE;
SystemControllerNumber = 0;
-
+
Status = gBS->OpenProtocolInformation (
Controller,
&gEfiI2cHostProtocolGuid,
@@ -280,7 +280,7 @@ CheckRemainingDevicePath (
if (EFI_ERROR (Status)) {
return Status;
}
-
+
for (Index = 0; Index < EntryCount; Index++) {
if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {
Status = gBS->OpenProtocol (
@@ -294,7 +294,7 @@ CheckRemainingDevicePath (
if (!EFI_ERROR (Status)) {
//
// Find vendor device path node and compare
- //
+ //
while (!IsDevicePathEnd (SystemDevicePath)) {
if ((DevicePathType (SystemDevicePath) == HARDWARE_DEVICE_PATH) &&
(DevicePathSubType (SystemDevicePath) == HW_VENDOR_DP)) {
@@ -469,7 +469,7 @@ I2cBusDriverSupported (
//
// Determine if the I2C Host Protocol is available
//
- Status = gBS->OpenProtocol (
+ Status = gBS->OpenProtocol (
Controller,
&gEfiI2cHostProtocolGuid,
(VOID **) &I2cHost,
@@ -489,7 +489,7 @@ I2cBusDriverSupported (
if (Status == EFI_ALREADY_STARTED) {
- if ((RemainingDevicePath == NULL) ||
+ if ((RemainingDevicePath == NULL) ||
((RemainingDevicePath != NULL) && IsDevicePathEnd (RemainingDevicePath))) {
//
// If RemainingDevicePath is NULL or is the End of Device Path Node, return EFI_SUCCESS.
@@ -498,7 +498,7 @@ I2cBusDriverSupported (
} else {
//
// Test if the child with the RemainingDevicePath has already been created.
- //
+ //
Status = CheckRemainingDevicePath (
This,
Controller,
@@ -647,7 +647,7 @@ I2cBusDriverStart (
Status = EFI_OUT_OF_RESOURCES;
goto Error;
}
-
+
/*
+----------------+
.->| I2C_BUS_CONTEXT|<----- This file Protocol (gEfiCallerIdGuid) installed on I2C Controller handle
@@ -660,7 +660,7 @@ I2cBusDriverStart (
| I2C IO Protocol Structure | <----- I2C IO Protocol
| |
+----------------------------+
-
+
*/
I2cBusContext->I2cHost = I2cHost;
I2cBusContext->I2cEnumerate = I2cEnumerate;
@@ -672,9 +672,9 @@ I2cBusDriverStart (
// Parent controller device path used to create children device path
//
I2cBusContext->ParentDevicePath = ParentDevicePath;
-
+
I2cBusContext->DriverBindingHandle = This->DriverBindingHandle;
-
+
Status = gBS->InstallMultipleProtocolInterfaces (
&Controller,
&gEfiCallerIdGuid,
@@ -698,7 +698,7 @@ Error:
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "I2cBus: Start() function failed, Status = %r\n", Status));
if (ParentDevicePath != NULL) {
- gBS->CloseProtocol (
+ gBS->CloseProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
@@ -716,14 +716,14 @@ Error:
}
if (I2cEnumerate != NULL) {
- gBS->CloseProtocol (
+ gBS->CloseProtocol (
Controller,
&gEfiI2cEnumerateProtocolGuid,
This->DriverBindingHandle,
Controller
);
}
-
+
if (I2cBusContext != NULL) {
Status = gBS->UninstallMultipleProtocolInterfaces (
&Controller,
@@ -783,7 +783,7 @@ I2cBusDriverStop (
UINTN Index;
if (NumberOfChildren == 0) {
- gBS->CloseProtocol (
+ gBS->CloseProtocol (
Controller,
&gEfiDevicePathProtocolGuid,
This->DriverBindingHandle,
@@ -880,14 +880,14 @@ RegisterI2cDevice (
// Default DeviceIndex
//
RemainingPathDeviceIndex = 0;
-
+
//
// Determine the controller number in Controller Node Device Path when RemainingDevicePath is not NULL.
//
if (RemainingDevicePath != NULL) {
//
// Check if there is a controller node appended after vendor node
- //
+ //
DevPathNode = NextDevicePathNode (RemainingDevicePath);
if ((DevicePathType (DevPathNode) == HARDWARE_DEVICE_PATH) &&
(DevicePathSubType(DevPathNode) == HW_CONTROLLER_DP)) {
@@ -965,7 +965,7 @@ RegisterI2cDevice (
//
if ((!CompareGuid (&((VENDOR_DEVICE_PATH *)RemainingDevicePath)->Guid, Device->DeviceGuid)) ||
(RemainingPathDeviceIndex != Device->DeviceIndex)) {
- continue;
+ continue;
}
}
@@ -1015,7 +1015,7 @@ RegisterI2cDevice (
ReleaseI2cDeviceContext (I2cDeviceContext);
continue;
}
-
+
//
// Create the child handle
//
@@ -1040,7 +1040,7 @@ RegisterI2cDevice (
// Free resources for this I2C device
//
ReleaseI2cDeviceContext (I2cDeviceContext);
- continue;
+ continue;
}
if (RemainingDevicePath != NULL) {
@@ -1074,7 +1074,7 @@ RegisterI2cDevice (
The upper layer driver writer provides the following to the platform
vendor:
-
+
1. Vendor specific GUID for the I2C part
2. Guidance on proper construction of the slave address array when the
I2C device uses more than one slave address. The I2C bus protocol
@@ -1192,7 +1192,7 @@ ReleaseI2cDeviceContext (
if (I2cDeviceContext == NULL) {
return;
}
-
+
if (I2cDeviceContext->DevicePath != NULL) {
FreePool (I2cDeviceContext->DevicePath);
}
@@ -1282,12 +1282,12 @@ UnRegisterI2cDevice (
);
return Status;
}
-
+
//
// Free resources for this I2C device
//
ReleaseI2cDeviceContext (I2cDeviceContext);
-
+
return EFI_SUCCESS;
}
@@ -1310,12 +1310,12 @@ I2cBusDevicePathAppend (
)
{
EFI_DEVICE_PATH_PROTOCOL *PreviousDevicePath;
-
+
PreviousDevicePath = NULL;
//
// Build vendor device path
- //
+ //
CopyMem (&gVendorDevicePathTemplate.Guid, I2cDeviceContext->I2cDevice->DeviceGuid, sizeof (EFI_GUID));
I2cDeviceContext->DevicePath = AppendDevicePathNode (
I2cDeviceContext->I2cBusContext->ParentDevicePath,
@@ -1325,13 +1325,13 @@ I2cBusDevicePathAppend (
if (I2cDeviceContext->DevicePath == NULL) {
return EFI_OUT_OF_RESOURCES;
}
-
+
if ((BuildControllerNode) && (I2cDeviceContext->DevicePath != NULL)) {
//
// Build the final I2C device path with controller node
//
PreviousDevicePath = I2cDeviceContext->DevicePath;
- gControllerDevicePathTemplate.ControllerNumber = I2cDeviceContext->I2cDevice->DeviceIndex;
+ gControllerDevicePathTemplate.ControllerNumber = I2cDeviceContext->I2cDevice->DeviceIndex;
I2cDeviceContext->DevicePath = AppendDevicePathNode (
I2cDeviceContext->DevicePath,
(EFI_DEVICE_PATH_PROTOCOL *) &gControllerDevicePathTemplate
@@ -1379,7 +1379,7 @@ InitializeI2cBus(
);
ASSERT_EFI_ERROR (Status);
-
+
return Status;
}
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBusDxeExtra.uni b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBusDxeExtra.uni
index 374debe440..e7e84fdfec 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBusDxeExtra.uni
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBusDxeExtra.uni
@@ -1,7 +1,7 @@
// /** @file
// I2cBusDxe Localized Strings and Content
//
-// Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2014 - 2018, 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
@@ -12,8 +12,8 @@
//
// **/
-#string STR_PROPERTIES_MODULE_NAME
-#language en-US
+#string STR_PROPERTIES_MODULE_NAME
+#language en-US
"I2C Bus DXE Driver"
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.h b/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.h
index 1490d4283a..005dd3e073 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.h
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.h
@@ -4,7 +4,7 @@
This file defines common data structures, macro definitions and some module
internal function header files.
- Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2013 - 2018, 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
which accompanies this distribution. The full text of the license may be found at
@@ -53,7 +53,7 @@ typedef struct {
EFI_I2C_HOST_PROTOCOL *I2cHost;
EFI_HANDLE Controller;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
- EFI_HANDLE DriverBindingHandle;
+ EFI_HANDLE DriverBindingHandle;
} I2C_BUS_CONTEXT;
//
@@ -102,7 +102,7 @@ typedef struct {
// Signature
//
UINT32 Signature;
-
+
//
// Next request in the pending request list
//
@@ -218,7 +218,7 @@ extern EFI_DRIVER_BINDING_PROTOCOL gI2cHostDriverBinding;
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path.
@retval EFI_SUCCESS Driver API properly initialized
-
+
**/
EFI_STATUS
RegisterI2cDevice (
@@ -285,7 +285,7 @@ I2cBusDevicePathAppend (
The upper layer driver writer provides the following to the platform
vendor:
-
+
1. Vendor specific GUID for the I2C part
2. Guidance on proper construction of the slave address array when the
I2C device uses more than one slave address. The I2C bus protocol
@@ -524,7 +524,7 @@ I2cBusComponentNameGetDriverName (
IN CHAR8 *Language,
OUT CHAR16 **DriverName
);
-
+
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
@@ -789,7 +789,7 @@ I2cHostDriverStart (
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
-
+
/**
Stops a device controller or a bus controller.
@@ -871,7 +871,7 @@ I2cHostComponentNameGetDriverName (
IN CHAR8 *Language,
OUT CHAR16 **DriverName
);
-
+
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxeExtra.uni b/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxeExtra.uni
index 1f27927531..17b0218584 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxeExtra.uni
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cDxeExtra.uni
@@ -1,7 +1,7 @@
// /** @file
// I2cDxe Localized Strings and Content
//
-// Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2014 - 2018, 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
@@ -12,8 +12,8 @@
//
// **/
-#string STR_PROPERTIES_MODULE_NAME
-#language en-US
+#string STR_PROPERTIES_MODULE_NAME
+#language en-US
"I2C DXE Driver"
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
index 68dd931887..d745b6df78 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
@@ -1,9 +1,9 @@
/** @file
- This file implements I2C Host Protocol which provides callers with the ability to
+ This file implements I2C Host Protocol which provides callers with the ability to
do I/O transactions to all of the devices on the I2C bus.
Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2013 - 2018, 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
which accompanies this distribution. The full text of the license may be found at
@@ -26,7 +26,7 @@ EFI_DRIVER_BINDING_PROTOCOL gI2cHostDriverBinding = {
};
//
-// Driver name table
+// Driver name table
//
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mI2cHostDriverNameTable[] = {
{ "eng;en", L"I2c Host Driver" },
@@ -356,7 +356,7 @@ I2cHostDriverStart (
//
// Locate I2C Master Protocol
//
- Status = gBS->OpenProtocol (
+ Status = gBS->OpenProtocol (
Controller,
&gEfiI2cMasterProtocolGuid,
(VOID **)&I2cMaster,
@@ -425,7 +425,7 @@ I2cHostDriverStart (
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "I2cHost: create bus available event error, Status = %r\n", Status));
goto Exit;
- }
+ }
//
// Build the I2C host protocol for the current I2C controller
@@ -451,9 +451,9 @@ Exit:
&gEfiI2cBusConfigurationManagementProtocolGuid,
This->DriverBindingHandle,
Controller
- );
+ );
}
-
+
if ((I2cHostContext != NULL) && (I2cHostContext->I2cEvent != NULL)) {
gBS->CloseEvent (I2cHostContext->I2cEvent);
I2cHostContext->I2cEvent = NULL;
@@ -513,7 +513,7 @@ I2cHostDriverStop (
IN EFI_HANDLE *ChildHandleBuffer
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
I2C_HOST_CONTEXT *I2cHostContext;
EFI_I2C_HOST_PROTOCOL *I2cHost;
EFI_TPL TplPrevious;
@@ -543,14 +543,14 @@ I2cHostDriverStop (
// Raise TPL for critical section
//
TplPrevious = gBS->RaiseTPL (TPL_I2C_SYNC);
-
+
//
// If there is pending request or pending bus configuration, do not stop
//
Status = EFI_DEVICE_ERROR;
if (( !I2cHostContext->I2cBusConfigurationManagementPending )
&& IsListEmpty (&I2cHostContext->RequestList)) {
-
+
//
// Remove the I2C host protocol
//
@@ -561,7 +561,7 @@ I2cHostDriverStop (
NULL
);
}
-
+
//
// Leave critical section
//
@@ -581,12 +581,12 @@ I2cHostDriverStop (
gBS->CloseEvent (I2cHostContext->I2cBusConfigurationEvent);
I2cHostContext->I2cBusConfigurationEvent = NULL;
}
-
+
if (I2cHostContext->I2cEvent != NULL) {
gBS->CloseEvent (I2cHostContext->I2cEvent);
I2cHostContext->I2cEvent = NULL;
}
-
+
FreePool (I2cHostContext);
}
@@ -644,7 +644,7 @@ I2cHostI2cBusConfigurationAvailable (
// Force next operation to enable the I2C bus configuration
//
I2cHostContext->I2cBusConfiguration = (UINTN) -1;
-
+
//
// Do not continue current I2C request
//
@@ -666,7 +666,7 @@ I2cHostI2cBusConfigurationAvailable (
//
// Start an I2C operation on the host, the status is returned by I2cHostContext->Status
//
- Status = I2cMaster->StartRequest (
+ Status = I2cMaster->StartRequest (
I2cMaster,
I2cRequest->SlaveAddress,
I2cRequest->RequestPacket,
@@ -734,7 +734,7 @@ I2cHostRequestComplete (
if(!IsListEmpty (EntryHeader)) {
I2cHostRequestEnable (I2cHostContext);
}
-
+
return Status;
}
@@ -942,7 +942,7 @@ I2cHostQueueRequest (
if (RequestPacket == NULL) {
return EFI_INVALID_PARAMETER;
}
-
+
if ((SlaveAddress & I2C_ADDRESSING_10_BIT) != 0) {
//
// 10-bit address, bits 0-9 are used for 10-bit I2C slave addresses,
@@ -970,7 +970,7 @@ I2cHostQueueRequest (
//
// For synchronous transaction, register an event used to wait for finishing synchronous transaction
//
- Status = gBS->CreateEvent (
+ Status = gBS->CreateEvent (
0,
TPL_I2C_SYNC,
NULL,
@@ -981,7 +981,7 @@ I2cHostQueueRequest (
return Status;
}
}
-
+
//
// TPL should be at or below TPL_NOTIFY.
// For synchronous requests this routine must be called at or below TPL_CALLBACK.
@@ -1022,9 +1022,9 @@ I2cHostQueueRequest (
// Synchronize with the other threads
//
gBS->RaiseTPL ( TPL_I2C_SYNC );
-
+
FirstRequest = IsListEmpty (&I2cHostContext->RequestList);
-
+
//
// Insert new I2C request in the list
//
@@ -1034,7 +1034,7 @@ I2cHostQueueRequest (
// Release the thread synchronization
//
gBS->RestoreTPL (TplPrevious);
-
+
if (FirstRequest) {
//
// Start the first I2C request, then the subsequent of I2C request will continue
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHostDxeExtra.uni b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHostDxeExtra.uni
index 816663884c..ed3b2d6e75 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHostDxeExtra.uni
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHostDxeExtra.uni
@@ -1,7 +1,7 @@
// /** @file
// I2cHostDxe Localized Strings and Content
//
-// Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2014 - 2018, 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
@@ -12,8 +12,8 @@
//
// **/
-#string STR_PROPERTIES_MODULE_NAME
-#language en-US
+#string STR_PROPERTIES_MODULE_NAME
+#language en-US
"I2C Host DXE Driver"