]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Bus / I2c / I2cDxe / I2cHost.c
index 319507cfa2cefde9628c13b1640b488c847597a0..d745b6df7896661ece73be1ef65e5afe564d0662 100644 (file)
@@ -1,9 +1,9 @@
 /** @file\r
-  This file implements I2C Host Protocol which provides callers with the ability to \r
+  This file implements I2C Host Protocol which provides callers with the ability to\r
   do I/O transactions to all of the devices on the I2C bus.\r
 \r
   Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>\r
-  Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -26,7 +26,7 @@ EFI_DRIVER_BINDING_PROTOCOL gI2cHostDriverBinding = {
 };\r
 \r
 //\r
-// Driver name table \r
+// Driver name table\r
 //\r
 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mI2cHostDriverNameTable[] = {\r
   { "eng;en", L"I2c Host Driver" },\r
@@ -356,7 +356,7 @@ I2cHostDriverStart (
   //\r
   // Locate I2C Master Protocol\r
   //\r
-  Status = gBS->OpenProtocol ( \r
+  Status = gBS->OpenProtocol (\r
                   Controller,\r
                   &gEfiI2cMasterProtocolGuid,\r
                   (VOID **)&I2cMaster,\r
@@ -425,7 +425,7 @@ I2cHostDriverStart (
   if (EFI_ERROR (Status)) {\r
     DEBUG ((EFI_D_ERROR, "I2cHost: create bus available event error, Status = %r\n", Status));\r
     goto Exit;\r
-  }  \r
+  }\r
 \r
   //\r
   // Build the I2C host protocol for the current I2C controller\r
@@ -451,9 +451,9 @@ Exit:
                       &gEfiI2cBusConfigurationManagementProtocolGuid,\r
                       This->DriverBindingHandle,\r
                       Controller\r
-                      );      \r
+                      );\r
     }\r
-    \r
+\r
     if ((I2cHostContext != NULL) && (I2cHostContext->I2cEvent != NULL)) {\r
       gBS->CloseEvent (I2cHostContext->I2cEvent);\r
       I2cHostContext->I2cEvent = NULL;\r
@@ -513,7 +513,7 @@ I2cHostDriverStop (
   IN  EFI_HANDLE                        *ChildHandleBuffer\r
   )\r
 {\r
-  EFI_STATUS                  Status;  \r
+  EFI_STATUS                  Status;\r
   I2C_HOST_CONTEXT            *I2cHostContext;\r
   EFI_I2C_HOST_PROTOCOL       *I2cHost;\r
   EFI_TPL                     TplPrevious;\r
@@ -543,14 +543,14 @@ I2cHostDriverStop (
   // Raise TPL for critical section\r
   //\r
   TplPrevious = gBS->RaiseTPL (TPL_I2C_SYNC);\r
-  \r
+\r
   //\r
   // If there is pending request or pending bus configuration, do not stop\r
   //\r
   Status = EFI_DEVICE_ERROR;\r
   if (( !I2cHostContext->I2cBusConfigurationManagementPending )\r
     && IsListEmpty (&I2cHostContext->RequestList)) {\r
-    \r
+\r
     //\r
     //  Remove the I2C host protocol\r
     //\r
@@ -561,7 +561,7 @@ I2cHostDriverStop (
                     NULL\r
                     );\r
   }\r
-  \r
+\r
   //\r
   // Leave critical section\r
   //\r
@@ -581,12 +581,12 @@ I2cHostDriverStop (
       gBS->CloseEvent (I2cHostContext->I2cBusConfigurationEvent);\r
       I2cHostContext->I2cBusConfigurationEvent = NULL;\r
     }\r
-    \r
+\r
     if (I2cHostContext->I2cEvent != NULL) {\r
       gBS->CloseEvent (I2cHostContext->I2cEvent);\r
       I2cHostContext->I2cEvent = NULL;\r
     }\r
-    \r
+\r
     FreePool (I2cHostContext);\r
   }\r
 \r
@@ -644,7 +644,7 @@ I2cHostI2cBusConfigurationAvailable (
     // Force next operation to enable the I2C bus configuration\r
     //\r
     I2cHostContext->I2cBusConfiguration = (UINTN) -1;\r
-    \r
+\r
     //\r
     // Do not continue current I2C request\r
     //\r
@@ -666,7 +666,7 @@ I2cHostI2cBusConfigurationAvailable (
   //\r
   // Start an I2C operation on the host, the status is returned by I2cHostContext->Status\r
   //\r
-  Status = I2cMaster->StartRequest ( \r
+  Status = I2cMaster->StartRequest (\r
                         I2cMaster,\r
                         I2cRequest->SlaveAddress,\r
                         I2cRequest->RequestPacket,\r
@@ -734,7 +734,7 @@ I2cHostRequestComplete (
   if(!IsListEmpty (EntryHeader)) {\r
     I2cHostRequestEnable (I2cHostContext);\r
   }\r
-  \r
+\r
   return Status;\r
 }\r
 \r
@@ -896,8 +896,6 @@ I2cHostRequestEnable (
                               completion status\r
 \r
   @retval EFI_SUCCESS           The operation completed successfully.\r
-  @retval EFI_ABORTED           The request did not complete because the driver\r
-                                was shutdown.\r
   @retval EFI_BAD_BUFFER_SIZE   The WriteBytes or ReadBytes buffer size is too large.\r
   @retval EFI_DEVICE_ERROR      There was an I2C error (NACK) during the operation.\r
                                 This could indicate the slave device is not present.\r
@@ -944,7 +942,7 @@ I2cHostQueueRequest (
   if (RequestPacket == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   if ((SlaveAddress & I2C_ADDRESSING_10_BIT) != 0) {\r
     //\r
     // 10-bit address, bits 0-9 are used for 10-bit I2C slave addresses,\r
@@ -972,7 +970,7 @@ I2cHostQueueRequest (
     //\r
     // For synchronous transaction, register an event used to wait for finishing synchronous transaction\r
     //\r
-    Status = gBS->CreateEvent ( \r
+    Status = gBS->CreateEvent (\r
                 0,\r
                 TPL_I2C_SYNC,\r
                 NULL,\r
@@ -983,7 +981,7 @@ I2cHostQueueRequest (
       return Status;\r
     }\r
   }\r
\r
+\r
   //\r
   // TPL should be at or below TPL_NOTIFY.\r
   // For synchronous requests this routine must be called at or below TPL_CALLBACK.\r
@@ -1024,9 +1022,9 @@ I2cHostQueueRequest (
   // Synchronize with the other threads\r
   //\r
   gBS->RaiseTPL ( TPL_I2C_SYNC );\r
-  \r
+\r
   FirstRequest = IsListEmpty (&I2cHostContext->RequestList);\r
-  \r
+\r
   //\r
   // Insert new I2C request in the list\r
   //\r
@@ -1036,7 +1034,7 @@ I2cHostQueueRequest (
   // Release the thread synchronization\r
   //\r
   gBS->RestoreTPL (TplPrevious);\r
-  \r
+\r
   if (FirstRequest) {\r
     //\r
     // Start the first I2C request, then the subsequent of I2C request will continue\r