Skip to content

Commit

Permalink
add buttons (not functional for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicenteicc2008 committed Aug 14, 2024
1 parent e1af5b9 commit 2330689
Show file tree
Hide file tree
Showing 22 changed files with 2,824 additions and 3 deletions.
3 changes: 3 additions & 0 deletions MSM8909Pkg/CommonDsc.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@

ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf

# KeypadDeviceHelperLib|MSM8909Pkg/Library/KeypadDeviceHelperLib/KeypadDeviceHelperLib.inf
# KeypadDeviceImplLib|MSM8909Pkg/Library/KeypadDeviceImplLib/KeypadDeviceImplLib.inf

# ARM PL011 UART Driver
PL011UartClockLib|ArmPlatformPkg/Library/PL011UartClockLib/PL011UartClockLib.inf
PL011UartLib|ArmPlatformPkg/Library/PL011UartLib/PL011UartLib.inf
Expand Down
56 changes: 56 additions & 0 deletions MSM8909Pkg/Drivers/GenericKeypadDeviceDxe/GenericKeypadDevice.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#include <PiDxe.h>
#include <Protocol/KeypadDevice.h>
#include <Library/DebugLib.h>
#include <Library/KeypadDeviceImplLib.h>
#include <Library/UefiBootServicesTableLib.h>

typedef struct {
VENDOR_DEVICE_PATH Keypad;
EFI_DEVICE_PATH End;
} KEYPAD_DEVICE_PATH;

KEYPAD_DEVICE_PATH mInternalDevicePath = {
{
{
HARDWARE_DEVICE_PATH,
HW_VENDOR_DP,
{
(UINT8)(sizeof(VENDOR_DEVICE_PATH)),
(UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8),
},
},
EFI_CALLER_ID_GUID,
},
{
END_DEVICE_PATH_TYPE,
END_ENTIRE_DEVICE_PATH_SUBTYPE,
{ sizeof (EFI_DEVICE_PATH_PROTOCOL), 0 }
}
};

STATIC KEYPAD_DEVICE_PROTOCOL mInternalKeypadDevice = {
KeypadDeviceImplReset,
KeypadDeviceImplGetKeys,
};

EFI_STATUS
EFIAPI
KeypadDeviceDxeInitialize (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;

Status = gBS->InstallMultipleProtocolInterfaces(
&ImageHandle,
&gSc8830KeypadDeviceProtocolGuid,
&mInternalKeypadDevice,
&gEfiDevicePathProtocolGuid,
&mInternalDevicePath,
NULL
);
ASSERT_EFI_ERROR(Status);

return Status;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = GenericKeypadDeviceDxe
FILE_GUID = 39A24CF8-411E-48EB-8BEA-3ED07327F400
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0

ENTRY_POINT = KeypadDeviceDxeInitialize

[Sources.common]
GenericKeypadDevice.c

[Packages]
MdePkg/MdePkg.dec
ArmPkg/ArmPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MSM8909Pkg/MSM8909Pkg.dec

[LibraryClasses]
UefiDriverEntryPoint
MemoryAllocationLib
KeypadDeviceImplLib

[Protocols]
gSc8830KeypadDeviceProtocolGuid
gEfiDevicePathProtocolGuid

[Depex]
TRUE
Loading

0 comments on commit 2330689

Please sign in to comment.