From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 45ACC203B8C1A for ; Mon, 30 Apr 2018 09:59:41 -0700 (PDT) Received: by mail-wm0-x242.google.com with SMTP id x12so12099995wmc.0 for ; Mon, 30 Apr 2018 09:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EKk6alJw10rE9qo8QPhaihnkCn1GyFxnwJuh6CNMShM=; b=FyN2BuBByY9Ed9OmBNKsOUevFySeZzhF2rffzSyYYzAkiVbpSWlltOE10VqOsacHZX iTT3Tiv4/0AEW6YeIj5WhqG79D29AZVGn+ZE4ERSJErtLO081zLwJFD+F3AW3xdW4BV/ 9rP2oyh+WsMPPHOkuXDp++EFxTpSS93Y+3F6w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=EKk6alJw10rE9qo8QPhaihnkCn1GyFxnwJuh6CNMShM=; b=rPLGt9UwWYFnqeOQGzGLWgdjUzeO2jULlgGAJje7+WKjjNqCKNe4iKhW+oqjEAPXGf NC3401pPYeV83ZW/4ltaK5ElIvV6bHmt61aHpYCeCChcSa7Rn93XJKNGz4UV0hH5gYBf xqfvKi7MR1ppEse2zUinUCQd6J+dArbJy0T3DRuE2FCVdsRj+S7W6osLy7oR1d3mkb9A QN4BhUH2LNM9MyWj1bhyreSXGh0hYqJGQXq3qIAX87VFfSZJ+zenBCXPRc6Sa4BHqig0 YDCO0cnZy+vQaq4K6Y4o9G23FjNGZQUV/YudrBa/5MLy2GrlfZ9mcwkW7t0I9smTrGuM SpQA== X-Gm-Message-State: ALQs6tArcWTin4DPPEP/qIiA+aDbD9ZLhrOdyVwtow8si9DBitnlEPrU RHQmMQhWlUw6ZYjz6nJ04+c8DA== X-Google-Smtp-Source: AB8JxZpwuy/MoAZ/+Z2LzqH+GTKLWJfR0h9E2NeSx5p6fUukRskuVaRCGIqva5x/52e62VrmSMI+DA== X-Received: by 10.28.21.195 with SMTP id 186mr8831702wmv.39.1525107579653; Mon, 30 Apr 2018 09:59:39 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id m64sm1514737wmb.12.2018.04.30.09.59.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 09:59:38 -0700 (PDT) Date: Mon, 30 Apr 2018 17:59:37 +0100 From: Leif Lindholm To: Haojian Zhuang Cc: edk2-devel@lists.01.org, Ard Biesheuvel Message-ID: <20180430165937.doc5z3zngmvl4pit@bivouac.eciton.net> References: <1520516088-29994-1-git-send-email-haojian.zhuang@linaro.org> <1520516088-29994-2-git-send-email-haojian.zhuang@linaro.org> MIME-Version: 1.0 In-Reply-To: <1520516088-29994-2-git-send-email-haojian.zhuang@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH v2 1/1] EmbeddedPkg/Drivers: add virtual keyboard driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 16:59:41 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > Cc: Ard Biesheuvel > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Haojian Zhuang > --- > 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.
> +# > +# 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 Pushed as 1df5fb2d83 / Leif