/** @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
- 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
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
#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
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
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
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
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