From patchwork Sat Jan 17 00:56:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1550 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=1768611474; bh=e4/XdvKX4+qgiSVT2I4FsKxmAPNaHm9bCQuJbTC7wmA=; 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=lEr94TBE3ZLgw1UrL58sEaegiJOCGsFfNIyT8yrco9pYjIrG0lrI7RwWf9ZhUDwdT vLofKZZnmdGNzH7kgXNrQ8i7NroqxlwlqlcFyPZs17GMvf1Hv3hBt01b+o/o/cJIgP 9Qc+KVGNBbWVMGnKxANbBw9b9ID8tXO3nzrylRuHB33NSjOyPonKAjFgIe7RZ6j9fu CYzrB7jwZGbi6mkwiQvFwWIV6IDuF5acfnu8kLUr0/lY/9LQxhwf6kI0NYHftVpgRi VJsGam/28WHQ/gNhN95V9ayynY9zvSo9734Ry8DfKMeisdWgpn7maqmgjfanQQVpch v0S3eLdrTKY2A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9F656693D7 for ; Fri, 16 Jan 2026 17:57:54 -0700 (MST) 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 BWnlxKjV-ORr for ; Fri, 16 Jan 2026 17:57:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611474; bh=e4/XdvKX4+qgiSVT2I4FsKxmAPNaHm9bCQuJbTC7wmA=; 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=lEr94TBE3ZLgw1UrL58sEaegiJOCGsFfNIyT8yrco9pYjIrG0lrI7RwWf9ZhUDwdT vLofKZZnmdGNzH7kgXNrQ8i7NroqxlwlqlcFyPZs17GMvf1Hv3hBt01b+o/o/cJIgP 9Qc+KVGNBbWVMGnKxANbBw9b9ID8tXO3nzrylRuHB33NSjOyPonKAjFgIe7RZ6j9fu CYzrB7jwZGbi6mkwiQvFwWIV6IDuF5acfnu8kLUr0/lY/9LQxhwf6kI0NYHftVpgRi VJsGam/28WHQ/gNhN95V9ayynY9zvSo9734Ry8DfKMeisdWgpn7maqmgjfanQQVpch v0S3eLdrTKY2A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8E159693E0 for ; Fri, 16 Jan 2026 17:57:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611472; bh=4u+7/NJNAQUpQFM+nSoAYBgs/hJkSaY9Jdqkc/2UShA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bEJV+lfc3QcgJa0GJPTd4hUQnmcGOAAl1+E52T5N6ixBCTqq/24OG8eMFRNEkgjwJ IR1Z6ftPGeiOJ0I8pWIjW8cVRO1GHmUKWv35hipTh1TwYmIpenHJIT+GG4VuJfxrb9 uwpLC5OFWoKCoB0KF+C1DX9ltRVP0Cp1GFF9ufjvEjmJFzwHmtm+vsw1jlBcHtPzZX AhgY1HT8FeC/PjOknkK+J2/JNsOb+J8hWcBw167RDN3VHMC0aXpYJNN+bIWdi/wLhJ JPZEaRF4QEhEckd+AGOoF4mmabNGqaDNVd4//U4U0VSl3y1FVMuoV32/8LYEJ1MZV7 4qH/O/yL+Cnaw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F00E0693D7; Fri, 16 Jan 2026 17:57:52 -0700 (MST) 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 rCW8_VvLa06v; Fri, 16 Jan 2026 17:57:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768611468; bh=FQuuo5cf6//l9iw0ND51cgWeBIcsP1RskhIDINc+M6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bia96WfAFRqzp/1F1J5KI0+nYqtk0HbNlTzO5mzgpRtShow8BZMu2kgXWX7BlCIDI wVzUF/lzrrFKopx+ZSFbles0lAXhXlIUJt4IVkj7qVTzvYtIoVfNFpLP59vgsanGPp hXSdoa3ySCaSLnt3bQsoMcKxpRekIi9kf1qdSeWs5LrDeVImMZsZ3HFnfOXHd36FvX HGtshq+/o6B+68I+KAfh0sY7g2+0c8mby1wsJdnnBmEcjjLGHvdToHAtxT/KUS+lnW CNdthI3zHCepuT5je+d5Tz/IOQjGxMQ6iEBtS711wAoauB1dvC7ZNBtCCtcFlRLtyn Qw8EhyQp8Seow== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A5162693B1; Fri, 16 Jan 2026 17:57:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 16 Jan 2026 17:56:46 -0700 Message-ID: <20260117005702.1684841-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260117005702.1684841-1-sjg@u-boot.org> References: <20260117005702.1684841-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: PSBWEGXA5U3HEKWQSAWUR56VPZ4ODEBA X-Message-ID-Hash: PSBWEGXA5U3HEKWQSAWUR56VPZ4ODEBA 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: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/18] video: Add vidconsole_uc_plat for per-device platform data 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 struct vidconsole_uc_plat to hold uclass platform data for vidconsole devices. This includes ctx_size which allows drivers to specify the size of context data they need. This prepares for dynamic context allocation where drivers can have different sized contexts. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 1 + include/video_console.h | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index ed9311bd05e..1ac8e2ddf3c 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -928,6 +928,7 @@ UCLASS_DRIVER(vidconsole) = { .post_probe = vidconsole_post_probe, .pre_remove = vidconsole_pre_remove, .per_device_auto = sizeof(struct vidconsole_priv), + .per_device_plat_auto = sizeof(struct vidconsole_uc_plat), }; int vidconsole_clear_and_reset(struct udevice *dev) diff --git a/include/video_console.h b/include/video_console.h index d3e8b3f3c9f..72bc0e5b0db 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -136,6 +136,19 @@ struct vidconsole_ctx { int xsize_frac; }; +/** + * struct vidconsole_uc_plat - uclass platform data for a vidconsole device + * + * This holds information that the uclass needs to know about each device. It + * is accessed using dev_get_uclass_plat(dev). + * + * @ctx_size: Size of context data needed by the driver, or 0 to use the + * default (sizeof(struct vidconsole_ctx)) + */ +struct vidconsole_uc_plat { + uint ctx_size; +}; + /** * struct vidconsole_priv - uclass-private data about a console device *