From patchwork Mon Oct 6 20:58:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 521 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=1759784375; bh=1FJqG7Y3UZtIVXIAhMlnQHau4CQqVN4ajBr/2W4U2D0=; 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=c12eBKJQaBNW4HvEtdeMoQas2yocLNSRcLhnjb0a4RKTWVlF2vpeoFZIzDrE7fkee dixxcH9wMOXZ5+ECh0snavwEQKjOsjXH5HZLIoMuAPpz82lCTvJzCADm/hZUr60oeq ADZ+KROaLWAIox6H1Ta0nqopbsEE3OG7oTMtXRj3y56aGXbOygMttbWURe3t8KoAdv Ja+5m0/U+/UQ7B0PapLA8NE0C8vH6MZuvXfKlSVrILBAkQ3mA2Y4nx/c7PAZc//0ps +RzzFV9xiBllHJ4zo5hwuxPbQWHtaYjSRnds/XHEKVHqzAkIGCvpn29jRZIUc3mb5v fWxgtIAHoPw8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BCE3067F8D for ; Mon, 6 Oct 2025 14:59:35 -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 GlWuyBFzWUhP for ; Mon, 6 Oct 2025 14:59:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784375; bh=1FJqG7Y3UZtIVXIAhMlnQHau4CQqVN4ajBr/2W4U2D0=; 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=c12eBKJQaBNW4HvEtdeMoQas2yocLNSRcLhnjb0a4RKTWVlF2vpeoFZIzDrE7fkee dixxcH9wMOXZ5+ECh0snavwEQKjOsjXH5HZLIoMuAPpz82lCTvJzCADm/hZUr60oeq ADZ+KROaLWAIox6H1Ta0nqopbsEE3OG7oTMtXRj3y56aGXbOygMttbWURe3t8KoAdv Ja+5m0/U+/UQ7B0PapLA8NE0C8vH6MZuvXfKlSVrILBAkQ3mA2Y4nx/c7PAZc//0ps +RzzFV9xiBllHJ4zo5hwuxPbQWHtaYjSRnds/XHEKVHqzAkIGCvpn29jRZIUc3mb5v fWxgtIAHoPw8w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A878A67F59 for ; Mon, 6 Oct 2025 14:59:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784373; bh=jguAawF30R+ybW25XnVCNlZs3KlFuE95WbX09rqyJjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vLtuOEJ9LEhU9txqtsER5zUbfNvYjxgRuRCrbCsXeqUFmsv0ZsCvgTBKvz0OSP5qD PDoY5wF/OF4YfcQaZRwf483gG81PG/Yc4mQd4DF0N7nGr25toAmvQ8SEOOUG4ieIGT 8KgmM8IcfrABV1Gyun54wxwnJZiUg1n5/neS7opVrLjKs2uJCUK8uC+98ZNIxXNqAc RGPQYLcnN4ke4pLF4gYp008qph3MKh0h3OMSgVnX+lM7KKU8e2WijHGpc9H7pvLX3s hNLv783Nn661y6Fh+s00yk+3Sz8m1PXa/eqBmB65gE2URyU58t3BOq0lHz+7dujFfM 5lHTudUDX8b3g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4A90067F03; Mon, 6 Oct 2025 14:59:33 -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 h8fyYXBAPKBv; Mon, 6 Oct 2025 14:59:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784367; bh=cxNzUbGNaReE37ArBv8x+nrBCTu7Zh5m/6ukaROMljI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lNs/RfUP1HIFAsRifrMxrO5deXfCUrQddLB6ZJ9uYXPzirUWZY7XgrhYV0FehDW6Y D4m16xYPs+F71yS1oMdf/VtUkVUsjDlbYIH9GYefJsQBawQlK+0obnPYc6wrKJyIVH xcrtg/Tl7bR97affmUNkqRSKUjKQnZIYSyvnLon5mK0qxonJ11PheT0R8zDwcuEAL5 hlDh0W2zrRqtHEy1s9of71rNlPUWSSjke+TnsArQViVQfI6Lk7uci4CRdCxH3i5ZLt lb2FYXrVoFnk7IJ4Y5++E+Os+LurwUZcWq4fL3gnTI0ZE9+hX/V6m3S679PE6MOSpD WBrxC+3KXAUgQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8B29F67EE4; Mon, 6 Oct 2025 14:59:27 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 6 Oct 2025 14:58:38 -0600 Message-ID: <20251006205856.2009292-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251006205856.2009292-1-sjg@u-boot.org> References: <20251006205856.2009292-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NBNNT33C6VDIUJSLV4G5YYEAVB5JWNGW X-Message-ID-Hash: NBNNT33C6VDIUJSLV4G5YYEAVB5JWNGW 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 , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/14] mouse: Add method to show/hide the system pointer 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 a new set_ptr_visible() method to the mouse uclass to allow hiding and showing the system mouse pointer. This is useful with sandbox when rendering a custom mouse pointer, such as in expo mode. The method is optional and returns -ENOSYS if not supported by the driver. Co-developed-by: Claude Signed-off-by: Simon Glass --- drivers/input/mouse-uclass.c | 10 ++++++++++ include/mouse.h | 24 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/drivers/input/mouse-uclass.c b/drivers/input/mouse-uclass.c index ee983397ef3..efb52d3377b 100644 --- a/drivers/input/mouse-uclass.c +++ b/drivers/input/mouse-uclass.c @@ -83,6 +83,16 @@ int mouse_get_pos(struct udevice *dev, struct vid_pos *pos) return 0; } +int mouse_set_ptr_visible(struct udevice *dev, bool visible) +{ + struct mouse_ops *ops = mouse_get_ops(dev); + + if (!ops->set_ptr_visible) + return -ENOSYS; + + return ops->set_ptr_visible(dev, visible); +} + UCLASS_DRIVER(mouse) = { .id = UCLASS_MOUSE, .name = "mouse", diff --git a/include/mouse.h b/include/mouse.h index 8212a1e89d4..98f54f73d88 100644 --- a/include/mouse.h +++ b/include/mouse.h @@ -99,6 +99,18 @@ struct mouse_ops { * supported */ int (*get_event)(struct udevice *dev, struct mouse_event *event); + + /** + * set_ptr_visible() - Show or hide the system mouse pointer + * + * This is used to hide the system pointer when expo is rendering its + * own custom mouse pointer. + * + * @dev: Mouse device + * @visible: true to show the pointer, false to hide it + * Returns: 0 if OK, -ENOSYS if not supported + */ + int (*set_ptr_visible)(struct udevice *dev, bool visible); }; #define mouse_get_ops(dev) ((struct mouse_ops *)(dev)->driver->ops) @@ -135,4 +147,16 @@ int mouse_get_click(struct udevice *dev, struct vid_pos *pos); */ int mouse_get_pos(struct udevice *dev, struct vid_pos *pos); +/** + * mouse_set_ptr_visible() - Show or hide the system mouse pointer + * + * This is used to hide the system pointer when rendering a custom mouse + * pointer (e.g., in expo mode). + * + * @dev: Mouse device + * @visible: true to show the pointer, false to hide it + * Returns: 0 if OK, -ENOSYS if not supported + */ +int mouse_set_ptr_visible(struct udevice *dev, bool visible); + #endif