]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OptionRomPkg/CirrusLogic5430Dxe/CirrusLogic5430.h
Fix the comments to follow UEFI Spec regarding how to check an EFI_HANDLE is valid...
[mirror_edk2.git] / OptionRomPkg / CirrusLogic5430Dxe / CirrusLogic5430.h
index b726d54099261f10a02a69448b1882897b2cce50..5080de578e6f4573861be47ea0e5d60770925219 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Cirrus Logic 5430 Controller Driver\r
 \r
-  Copyright (c) 2006 - 2007, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2006 - 2011, 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
   http://opensource.org/licenses/bsd-license.php\r
@@ -38,9 +38,9 @@
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/DevicePathLib.h>\r
-#include <Library/DxeI2cLib.h>\r
+#include <Library/TimerLib.h>\r
 \r
-#include <IndustryStandard/Pci22.h>\r
+#include <IndustryStandard/Pci.h>\r
 //\r
 // Cirrus Logic 5430 PCI Configuration Header values\r
 //\r
@@ -62,12 +62,30 @@ typedef struct {
   UINT32  RefreshRate;\r
 } CIRRUS_LOGIC_5430_MODE_DATA;\r
 \r
+#define PIXEL_RED_SHIFT   0\r
+#define PIXEL_GREEN_SHIFT 3\r
+#define PIXEL_BLUE_SHIFT  6\r
+\r
+#define PIXEL_RED_MASK    (BIT7 | BIT6 | BIT5)\r
+#define PIXEL_GREEN_MASK  (BIT4 | BIT3 | BIT2)\r
+#define PIXEL_BLUE_MASK   (BIT1 | BIT0)\r
+\r
+#define PIXEL_TO_COLOR_BYTE(pixel, mask, shift) ((UINT8) ((pixel & mask) << shift))\r
+#define PIXEL_TO_RED_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel, PIXEL_RED_MASK, PIXEL_RED_SHIFT)\r
+#define PIXEL_TO_GREEN_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel, PIXEL_GREEN_MASK, PIXEL_GREEN_SHIFT)\r
+#define PIXEL_TO_BLUE_BYTE(pixel) PIXEL_TO_COLOR_BYTE(pixel, PIXEL_BLUE_MASK, PIXEL_BLUE_SHIFT)\r
+\r
+#define RGB_BYTES_TO_PIXEL(Red, Green, Blue) \\r
+  (UINT8) ( (((Red) >> PIXEL_RED_SHIFT) & PIXEL_RED_MASK) | \\r
+            (((Green) >> PIXEL_GREEN_SHIFT) & PIXEL_GREEN_MASK) | \\r
+            (((Blue) >> PIXEL_BLUE_SHIFT) & PIXEL_BLUE_MASK) )\r
+\r
 #define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER  0xffff\r
 \r
 //\r
 // Cirrus Logic 5440 Private Data Structure\r
 //\r
-#define CIRRUS_LOGIC_5430_PRIVATE_DATA_SIGNATURE  EFI_SIGNATURE_32 ('C', 'L', '5', '4')\r
+#define CIRRUS_LOGIC_5430_PRIVATE_DATA_SIGNATURE  SIGNATURE_32 ('C', 'L', '5', '4')\r
 \r
 typedef struct {\r
   UINT64                                Signature;\r
@@ -249,7 +267,7 @@ CirrusLogic5430ControllerDriverStop (
                                 languages specified in SupportedLanguages. The\r
                                 number of languages supported by a driver is up\r
                                 to the driver writer. Language is specified\r
-                                in RFC 3066 or ISO 639-2 language code format.\r
+                                in RFC 4646 or ISO 639-2 language code format.\r
 \r
   @param  DriverName[out]       A pointer to the Unicode string to return.\r
                                 This Unicode string is the name of the\r
@@ -314,7 +332,7 @@ CirrusLogic5430ComponentNameGetDriverName (
                                 languages specified in SupportedLanguages. The\r
                                 number of languages supported by a driver is up\r
                                 to the driver writer. Language is specified in\r
-                                RFC 3066 or ISO 639-2 language code format.\r
+                                RFC 4646 or ISO 639-2 language code format.\r
 \r
   @param  ControllerName[out]   A pointer to the Unicode string to return.\r
                                 This Unicode string is the name of the\r
@@ -328,7 +346,7 @@ CirrusLogic5430ComponentNameGetDriverName (
                                 driver specified by This was returned in\r
                                 DriverName.\r
 \r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
 \r
   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
                                 EFI_HANDLE.\r