]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Omap35xxPkg/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
ShellPkg: add UefiShellAcpiViewCommandLib.inf to ShellPkg.dsc
[mirror_edk2.git] / Omap35xxPkg / LcdGraphicsOutputDxe / LcdGraphicsOutputDxe.c
index f7d247865dc0d6e6805da706e50a80da1693c0a5..4364dd71a02b91b0a1e98e0c44b0622d972b5461 100644 (file)
@@ -142,14 +142,14 @@ DssSetMode (
   )\r
 {\r
   // Make sure the interface clock is running\r
-  MmioWrite32 (CM_ICLKEN_DSS, EN_DSS);  \r
+  MmioWrite32 (CM_ICLKEN_DSS, EN_DSS);\r
 \r
   // Stop the functional clocks\r
   MmioAnd32 (CM_FCLKEN_DSS, ~(EN_DSS1 | EN_DSS2 | EN_TV));\r
 \r
   // Program the DSS clock divisor\r
   MmioWrite32 (CM_CLKSEL_DSS, 0x1000 | (LcdModes[ModeNumber].DssDivisor));\r
-  \r
+\r
   // Start the functional clocks\r
   MmioOr32 (CM_FCLKEN_DSS, (EN_DSS1 | EN_DSS2 | EN_TV));\r
 \r
@@ -159,10 +159,10 @@ DssSetMode (
   // Reset the subsystem\r
   MmioWrite32(DSS_SYSCONFIG, DSS_SOFTRESET);\r
   while (!(MmioRead32 (DSS_SYSSTATUS) & DSS_RESETDONE));\r
-  \r
+\r
   // Configure LCD parameters\r
   MmioWrite32 (DISPC_SIZE_LCD,\r
-               ((LcdModes[ModeNumber].HorizontalResolution - 1) \r
+               ((LcdModes[ModeNumber].HorizontalResolution - 1)\r
                | ((LcdModes[ModeNumber].VerticalResolution - 1) << 16))\r
               );\r
   MmioWrite32 (DISPC_TIMING_H,\r
@@ -187,7 +187,7 @@ DssSetMode (
   MmioWrite32 (DISPC_GFX_PRELD, 0x2D8);\r
   MmioWrite32 (DISPC_GFX_BA0, VramBaseAddress);\r
   MmioWrite32 (DISPC_GFX_SIZE,\r
-               ((LcdModes[ModeNumber].HorizontalResolution - 1) \r
+               ((LcdModes[ModeNumber].HorizontalResolution - 1)\r
                | ((LcdModes[ModeNumber].VerticalResolution - 1) << 16))\r
               );\r
 \r
@@ -213,7 +213,7 @@ HwInitializeDisplay (
 \r
   // Enable power lines used by TFP410\r
   Status = gBS->LocateProtocol (&gEmbeddedExternalDeviceProtocolGuid, NULL, (VOID **)&gTPS65950);\r
-  ASSERT_EFI_ERROR (Status);  \r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   OldTpl = gBS->RaiseTPL(TPL_NOTIFY);\r
   Data = VAUX_DEV_GRP_P1;\r
@@ -222,7 +222,7 @@ HwInitializeDisplay (
 \r
   Data = VAUX_DEDICATED_18V;\r
   Status = gTPS65950->Write (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID4, VPLL2_DEDICATED), 1, &Data);\r
-  ASSERT_EFI_ERROR (Status);  \r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   // Power up TFP410 (set GPIO2 on TPS - for BeagleBoard-xM)\r
   Status = gTPS65950->Read (gTPS65950, EXTERNAL_DEVICE_REGISTER(I2C_ADDR_GRP_ID2, GPIODATADIR1), 1, &Data);\r
@@ -239,7 +239,7 @@ HwInitializeDisplay (
 \r
   // Power up TFP410 (set GPIO 170 - for older BeagleBoards)\r
   MmioAnd32 (GPIO6_BASE + GPIO_OE, ~BIT10);\r
-  MmioOr32  (GPIO6_BASE + GPIO_SETDATAOUT, BIT10);  \r
+  MmioOr32  (GPIO6_BASE + GPIO_SETDATAOUT, BIT10);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -249,7 +249,7 @@ InitializeDisplay (
   IN LCD_INSTANCE* Instance\r
   )\r
 {\r
-  EFI_STATUS           Status; \r
+  EFI_STATUS           Status;\r
   UINTN                VramSize;\r
   EFI_PHYSICAL_ADDRESS VramBaseAddress;\r
 \r
@@ -273,24 +273,24 @@ EFI_STATUS
 EFIAPI\r
 LcdGraphicsQueryMode (\r
   IN EFI_GRAPHICS_OUTPUT_PROTOCOL            *This,\r
-       IN UINT32                                  ModeNumber,\r
-       OUT UINTN                                  *SizeOfInfo,\r
-       OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION   **Info\r
-       )\r
+  IN UINT32                                  ModeNumber,\r
+  OUT UINTN                                  *SizeOfInfo,\r
+  OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION   **Info\r
+  )\r
 {\r
-       LCD_INSTANCE  *Instance;\r
+  LCD_INSTANCE  *Instance;\r
 \r
-       Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
+  Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
 \r
   if (!mDisplayInitialized) {\r
     InitializeDisplay (Instance);\r
   }\r
 \r
   // Error checking\r
-       if ( (This == NULL) || (Info == NULL) || (SizeOfInfo == NULL) || (ModeNumber >= This->Mode->MaxMode) ) {\r
-         DEBUG((DEBUG_ERROR, "LcdGraphicsQueryMode: ERROR - For mode number %d : Invalid Parameter.\n", ModeNumber ));\r
-               return EFI_INVALID_PARAMETER;\r
-       }\r
+  if ( (This == NULL) || (Info == NULL) || (SizeOfInfo == NULL) || (ModeNumber >= This->Mode->MaxMode) ) {\r
+    DEBUG((DEBUG_ERROR, "LcdGraphicsQueryMode: ERROR - For mode number %d : Invalid Parameter.\n", ModeNumber ));\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
 \r
   *Info = AllocateCopyPool(sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION), &Instance->ModeInfo);\r
   if (*Info == NULL) {\r
@@ -311,12 +311,12 @@ EFI_STATUS
 EFIAPI\r
 LcdGraphicsSetMode (\r
   IN EFI_GRAPHICS_OUTPUT_PROTOCOL   *This,\r
-       IN UINT32                         ModeNumber\r
-       )\r
+  IN UINT32                         ModeNumber\r
+  )\r
 {\r
-       LCD_INSTANCE  *Instance;\r
+  LCD_INSTANCE  *Instance;\r
 \r
-       Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
+  Instance = LCD_INSTANCE_FROM_GOP_THIS(This);\r
 \r
   if (ModeNumber >= Instance->Mode.MaxMode) {\r
     return EFI_UNSUPPORTED;\r
@@ -350,51 +350,51 @@ LcdGraphicsOutputDxeInitialize (
     goto EXIT;\r
   }\r
 \r
-       // Install the Graphics Output Protocol and the Device Path\r
-       Status = gBS->InstallMultipleProtocolInterfaces(\r
-                       &Instance->Handle,\r
-                       &gEfiGraphicsOutputProtocolGuid, &Instance->Gop,\r
-                       &gEfiDevicePathProtocolGuid,     &Instance->DevicePath,\r
-                       NULL\r
-          );\r
+  // Install the Graphics Output Protocol and the Device Path\r
+  Status = gBS->InstallMultipleProtocolInterfaces(\r
+             &Instance->Handle,\r
+             &gEfiGraphicsOutputProtocolGuid, &Instance->Gop,\r
+             &gEfiDevicePathProtocolGuid,     &Instance->DevicePath,\r
+             NULL\r
+             );\r
 \r
-       if (EFI_ERROR(Status)) {\r
-         DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the protocol. Exit Status=%r\n", Status));\r
-               goto EXIT;\r
-       }\r
+  if (EFI_ERROR(Status)) {\r
+    DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the protocol. Exit Status=%r\n", Status));\r
+    goto EXIT;\r
+  }\r
 \r
   // Register for an ExitBootServicesEvent\r
-       // When ExitBootServices starts, this function here will make sure that the graphics driver will shut down properly,\r
-       // i.e. it will free up all allocated memory and perform any necessary hardware re-configuration.\r
-       /*Status = gBS->CreateEvent (\r
-           EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
-           TPL_NOTIFY,\r
-           LcdGraphicsExitBootServicesEvent, NULL,\r
-                       &Instance->ExitBootServicesEvent\r
-                       );\r
-\r
-       if (EFI_ERROR(Status)) {\r
-         DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the ExitBootServicesEvent handler. Exit Status=%r\n", Status));\r
-               goto EXIT_ERROR_UNINSTALL_PROTOCOL;\r
-       }*/\r
-\r
-       // To get here, everything must be fine, so just exit\r
-       goto EXIT;\r
+  // When ExitBootServices starts, this function here will make sure that the graphics driver will shut down properly,\r
+  // i.e. it will free up all allocated memory and perform any necessary hardware re-configuration.\r
+  /*Status = gBS->CreateEvent (\r
+               EVT_SIGNAL_EXIT_BOOT_SERVICES,\r
+               TPL_NOTIFY,\r
+               LcdGraphicsExitBootServicesEvent, NULL,\r
+               &Instance->ExitBootServicesEvent\r
+               );\r
+\r
+  if (EFI_ERROR(Status)) {\r
+    DEBUG((DEBUG_ERROR, "GraphicsOutputDxeInitialize: Can not install the ExitBootServicesEvent handler. Exit Status=%r\n", Status));\r
+    goto EXIT_ERROR_UNINSTALL_PROTOCOL;\r
+  }*/\r
+\r
+  // To get here, everything must be fine, so just exit\r
+  goto EXIT;\r
 \r
 //EXIT_ERROR_UNINSTALL_PROTOCOL:\r
-       /* The following function could return an error message,\r
-        * however, to get here something must have gone wrong already,\r
-        * so preserve the original error, i.e. don't change\r
-        * the Status variable, even it fails to uninstall the protocol.\r
-        */\r
-/*     gBS->UninstallMultipleProtocolInterfaces (\r
-           Instance->Handle,\r
-           &gEfiGraphicsOutputProtocolGuid, &Instance->Gop, // Uninstall Graphics Output protocol\r
-           &gEfiDevicePathProtocolGuid,     &Instance->DevicePath,     // Uninstall device path\r
-           NULL\r
-           );*/\r
+  /* The following function could return an error message,\r
+   * however, to get here something must have gone wrong already,\r
+   * so preserve the original error, i.e. don't change\r
+   * the Status variable, even it fails to uninstall the protocol.\r
+   */\r
+  /*  gBS->UninstallMultipleProtocolInterfaces (\r
+        Instance->Handle,\r
+        &gEfiGraphicsOutputProtocolGuid, &Instance->Gop, // Uninstall Graphics Output protocol\r
+        &gEfiDevicePathProtocolGuid,     &Instance->DevicePath,     // Uninstall device path\r
+        NULL\r
+        );*/\r
 \r
 EXIT:\r
-       return Status;\r
+  return Status;\r
 \r
 }\r