From patchwork Mon Sep 15 10:46:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 311 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933279; bh=9x69h7EqA7wDpct//Zr+T8ocOWRlVlH5aWEQmBrj2jg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=IlXOyIFZQMZE3HhSOVnfTAxtcMa4jKf25wqJFm9WfolK/rbQ8nSChynupz3IEAGh7 i0YWNLJUAfXGWnAh7Fljl3AzTosULxGST+JXvmTb4qAOQU0XQThVLvhwdwAjG9ZSqI /NgrHdfKcA72CX/WUw6o5ge0zTsOncDMSEv9uMz+oxWvsMI5ipZpL8p9mItUxLrz8B CS4VTqM2AB4nJ1sKrWJGIIwPWcWgfDbOmU/pO2pXeq44v3zKfOuYuUgEUBBaIDaDRB 6Ujt/kXVV1YV61JU6dLYovi/Us9ndtX+PXmqGninpHwRbhTqHyk7q6LLATpu7sjYzA iUxHlGfH/xEUA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BB08D67B04 for ; Mon, 15 Sep 2025 04:47:59 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id KQUg_yROBOB3 for ; Mon, 15 Sep 2025 04:47:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933279; bh=9x69h7EqA7wDpct//Zr+T8ocOWRlVlH5aWEQmBrj2jg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=IlXOyIFZQMZE3HhSOVnfTAxtcMa4jKf25wqJFm9WfolK/rbQ8nSChynupz3IEAGh7 i0YWNLJUAfXGWnAh7Fljl3AzTosULxGST+JXvmTb4qAOQU0XQThVLvhwdwAjG9ZSqI /NgrHdfKcA72CX/WUw6o5ge0zTsOncDMSEv9uMz+oxWvsMI5ipZpL8p9mItUxLrz8B CS4VTqM2AB4nJ1sKrWJGIIwPWcWgfDbOmU/pO2pXeq44v3zKfOuYuUgEUBBaIDaDRB 6Ujt/kXVV1YV61JU6dLYovi/Us9ndtX+PXmqGninpHwRbhTqHyk7q6LLATpu7sjYzA iUxHlGfH/xEUA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2388B67B44 for ; Mon, 15 Sep 2025 04:47:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933276; bh=Eee2rJsLdPhUjY3yj1WqJw/HmOkAXUmrctK11y1FWIE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tO8kDICFTfCTgcOc/cCpxY0KUR1R8kbMoB9rWOD5ePxnPt+yWQISPW4c+QkO+HcV+ y8prHhOwD+twVaz1KdPL3rKbaNnF/JJoAHySMEgN5pcj/wHzH+wJuqPzvluZctsxCx ULznSxPkfmycsC23zsWuFW66R1qSLhCx/q/6/1HZaLMzbvmFH922RWIAKrnmfgSI2R +OmkY5VusVY5xUL3TVi82Yc2axVRz2+c3uDV/7kFNG+NuBkvjkTRe3fZ9C8LL0C2Ek Q3j0BOEKZCOnVdbgG8w6hbeKFhDqmdHUO+RnDCPZe3/+fpZK2XQdAqnbNauEb04KPU e3vVKdtJApb5g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D130567B22; Mon, 15 Sep 2025 04:47:56 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id SmvVaIsXZeIg; Mon, 15 Sep 2025 04:47:56 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757933275; bh=tpLG9OSNf9xPc6ybeUMK3nCUUcGl7QykDRfOoDlXGLY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V1xt31rekPXUy7kiGkC60ssTl3NANMYexRi4pp9PDigsjGDbW/MTyIQNNObIYm52J Loe0dfg9aPkbYB5/pM6lxMixKBNlf6p6QZsufuNauBp0YsYJlKDFcfWgciNoR0sBJZ jp0vy/SycbxEE0VHlLhkkGtyCC6CYxS6EJy5SIrSgkVYodYAmSJBfLr4IBAM6OhOXc 3P9OY8TSaTGv1g5g5LpOhJq26q/hsePMaBZcz0RtCZiwu0C0DrW57X5Jfjwpx7zILG 6L4edoEJpgyqwEeexxPBrhMP7JUs8XmGfJAU6Hjd9Z0Rt44QXMtjzETUeSiOBX+pCi BY2wFxtXbO5Gw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1F46F67A99; Mon, 15 Sep 2025 04:47:55 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 15 Sep 2025 04:46:53 -0600 Message-ID: <20250915104705.937780-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250915104705.937780-1-sjg@u-boot.org> References: <20250915104705.937780-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TAS67MAZMPRRF2KIZVX2FCGCZOE64TR4 X-Message-ID-Hash: TAS67MAZMPRRF2KIZVX2FCGCZOE64TR4 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/17] efi: Add the simple-pointer protocol List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add definitions for the simple-pointer protocol so that it can be used in drivers. Signed-off-by: Simon Glass --- include/efi.h | 1 + include/efi_api.h | 29 +++++++++++++++++++++++++++++ lib/efi/device_path.c | 1 + 3 files changed, 31 insertions(+) diff --git a/include/efi.h b/include/efi.h index e9ca4840352..52f3a014f1d 100644 --- a/include/efi.h +++ b/include/efi.h @@ -176,6 +176,7 @@ extern const efi_guid_t efi_guid_loaded_image_device_path; extern const efi_guid_t efi_guid_device_path; extern const efi_guid_t efi_simple_file_system_protocol_guid; +extern const efi_guid_t efi_guid_simple_pointer; /* Generic EFI table header */ struct efi_table_hdr { diff --git a/include/efi_api.h b/include/efi_api.h index 00a9d29b8fe..70e24cb5fc9 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -977,6 +977,35 @@ struct efi_simple_text_input_protocol { struct efi_event *wait_for_key; }; +#define EFI_SIMPLE_POINTER_PROTOCOL_GUID \ + EFI_GUID(0x31878c87, 0x0b75, 0x11d5, \ + 0x9a, 0x4f, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) + +struct efi_simple_pointer_mode { + u64 resolution_x; + u64 resolution_y; + u64 resolution_z; + bool left_button; + bool right_button; +}; + +struct efi_simple_pointer_state { + s32 relative_movement_x; + s32 relative_movement_y; + s32 relative_movement_z; + bool left_button; + bool right_button; +}; + +struct efi_simple_pointer_protocol { + efi_status_t (EFIAPI *reset)(struct efi_simple_pointer_protocol *this, + bool extended_verification); + efi_status_t (EFIAPI *get_state)(struct efi_simple_pointer_protocol *this, + struct efi_simple_pointer_state *state); + struct efi_event *wait_for_input; + struct efi_simple_pointer_mode *mode; +}; + #define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \ EFI_GUID(0x8b843e20, 0x8132, 0x4852, \ 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c) diff --git a/lib/efi/device_path.c b/lib/efi/device_path.c index b09ea030341..939bf5a0679 100644 --- a/lib/efi/device_path.c +++ b/lib/efi/device_path.c @@ -27,6 +27,7 @@ const efi_guid_t efi_global_variable_guid = EFI_GLOBAL_VARIABLE_GUID; const efi_guid_t efi_guid_device_path = EFI_DEVICE_PATH_PROTOCOL_GUID; const efi_guid_t efi_guid_loaded_image = EFI_LOADED_IMAGE_PROTOCOL_GUID; +const efi_guid_t efi_guid_simple_pointer = EFI_SIMPLE_POINTER_PROTOCOL_GUID; const efi_guid_t efi_guid_loaded_image_device_path = EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID; const efi_guid_t efi_simple_file_system_protocol_guid =