public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Haojian Zhuang <haojian.zhuang@linaro.org>
Cc: edk2-devel@lists.01.org, Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH v2 1/1] EmbeddedPkg/Drivers: add virtual keyboard driver
Date: Mon, 30 Apr 2018 17:59:37 +0100	[thread overview]
Message-ID: <20180430165937.doc5z3zngmvl4pit@bivouac.eciton.net> (raw)
In-Reply-To: <1520516088-29994-2-git-send-email-haojian.zhuang@linaro.org>

On Thu, Mar 08, 2018 at 09:34:48PM +0800, Haojian Zhuang wrote:
> This driver is used to simulate a keyboard. For example, user
> could read GPIO setting or data from RAM address. If the value
> matches the expected pattern, it could trigger a key pressed
> event.
> 
> User needs to implement hooks of PLATFORM_VIRTUAL_KBD_PROTOCOL.
> There're 4 hooks in this protocol.
> Register(): Quote the interface that user needs. For example, user
> needs to locate GPIO protocol if he wants to simulate a GPIO value
> as a key.
> Reset(): Do the initialization before reading value.
> Query(): Read value. If the value matches the expected pattern,
> trigger a key pressed event.
> Clear(): Clean the value if necessary.
>
> Cc: Leif Lindholm <leif.lindholm@linaro.org>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
> ---
>  EmbeddedPkg/EmbeddedPkg.dec                                   |    1 +
>  EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboardDxe.inf |   60 +
>  EmbeddedPkg/Drivers/VirtualKeyboardDxe/ComponentName.h        |  154 +++
>  EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.h      |  544 +++++++++
>  EmbeddedPkg/Include/Protocol/PlatformVirtualKeyboard.h        |   65 ++
>  EmbeddedPkg/Drivers/VirtualKeyboardDxe/ComponentName.c        |  188 ++++
>  EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboard.c      | 1149 ++++++++++++++++++++
>  7 files changed, 2161 insertions(+)
> 
> diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec
> index e48ce2e95bf7..eb135340b173 100644
> --- a/EmbeddedPkg/EmbeddedPkg.dec
> +++ b/EmbeddedPkg/EmbeddedPkg.dec
> @@ -80,6 +80,7 @@ [Protocols.common]
>    gUsbDeviceProtocolGuid =  { 0x021bd2ca, 0x51d2, 0x11e3, {0x8e, 0x56, 0xb7, 0x54, 0x17, 0xc7,  0x0b, 0x44 }}
>    gPlatformGpioProtocolGuid = { 0x52ce9845, 0x5af4, 0x43e2, {0xba, 0xfd, 0x23, 0x08, 0x12, 0x54, 0x7a, 0xc2 }}
>    gAndroidBootImgProtocolGuid = { 0x9859bb19, 0x407c, 0x4f8b, {0xbc, 0xe1, 0xf8, 0xda, 0x65, 0x65, 0xf4, 0xa5 }}
> +  gPlatformVirtualKeyboardProtocolGuid = { 0x0e3606d2, 0x1dc3, 0x4e6f, { 0xbe, 0x65, 0x39, 0x49, 0x82, 0xa2, 0x65, 0x47 }}

I will move that line up one step before pushing.

>  
>  [Ppis]
>    gEdkiiEmbeddedGpioPpiGuid = { 0x21c3b115, 0x4e0b, 0x470c, { 0x85, 0xc7, 0xe1, 0x05, 0xa5, 0x75, 0xc9, 0x7b }}
> diff --git a/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboardDxe.inf b/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
> new file mode 100644
> index 000000000000..deb54dab6592
> --- /dev/null
> +++ b/EmbeddedPkg/Drivers/VirtualKeyboardDxe/VirtualKeyboardDxe.inf
> @@ -0,0 +1,60 @@
> +## @file
> +# Virtual Keyboard driver.
> +#
> +# Copyright (c) 2018, Linaro Ltd. All rights reserved.<BR>
> +#
> +# This program and the accompanying materials
> +# are licensed and made available under the terms and conditions
> +# of the BSD License which accompanies this distribution.  The
> +# full text of the license may be found at
> +# http://opensource.org/licenses/bsd-license.php
> +#
> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION                    = 0x00010019
> +  BASE_NAME                      = VirtualKeyboardDxe
> +  FILE_GUID                      = 88079b18-b42b-44aa-a6f2-b83911075e89
> +  MODULE_TYPE                    = UEFI_DRIVER
> +  VERSION_STRING                 = 1.0
> +  ENTRY_POINT                    = InitializeVirtualKeyboard
> +
> +#
> +# The following information is for reference only and not required by the build tools.
> +#
> +#  VALID_ARCHITECTURES           = IA32 X64 IPF ARM AARCH64
> +#
> +#  DRIVER_BINDING                = gVirtualKeyboardDriverBinding
> +#  COMPONENT_NAME                = gVirtualKeyboardComponentName
> +#
> +
> +[Sources.common]
> +  ComponentName.c
> +  VirtualKeyboard.c
> +
> +[Packages]
> +  EmbeddedPkg/EmbeddedPkg.dec
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec

MdeModulePkg before MdePkg.

> +
> +[LibraryClasses]
> +  BaseLib
> +  BaseMemoryLib
> +  DebugLib
> +  IoLib
> +  ReportStatusCodeLib
> +  UefiDriverEntryPoint
> +  UefiBootServicesTableLib

UefiBoot... before UefiDriver...

> +  UefiLib
> +
> +[Protocols]
> +  gEfiDriverBindingProtocolGuid
> +  gEfiSimpleTextInProtocolGuid
> +  gEfiSimpleTextInputExProtocolGuid
> +  gPlatformVirtualKeyboardProtocolGuid
> +
> +[Depex]
> +  TRUE

OK, so, I am reasonably convinced that this driver carries more across
from the Csm BiosKeyboard than is required (what about all of those
Stalls), and it still contains misleading comments about the 8042 (PC
keyboard controller). But I don't have time to go through it all with
a comb right now, and it sort of blocks some of the really nice
Arm BootManager improvements, and it is a useful addition ... so I am
going to push it for now (with the changes mentioned above
implemented).

I would appreciate if we could get back to this later in the year
though.

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Pushed as 1df5fb2d83

/
    Leif


  reply	other threads:[~2018-04-30 16:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 13:34 [PATCH v2 0/1] add virtual keyboard driver Haojian Zhuang
2018-03-08 13:34 ` [PATCH v2 1/1] EmbeddedPkg/Drivers: " Haojian Zhuang
2018-04-30 16:59   ` Leif Lindholm [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-08 13:28 Haojian Zhuang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180430165937.doc5z3zngmvl4pit@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox