From patchwork Sat Oct 18 08:41:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 618 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=1760776954; bh=ftrW8qL5Te1j47yygD8AD67rGzrcbwcyGKalinVu4cA=; 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=crUTd1IwgGHtEycUpRtNNK5Z193HJW3aud0OdHvsZLnLkd90co5ZREvpvIRAa/l/2 b1PWH7GYaePOcTO+WOj9u75PlSdjP9p30kE2ScdV1CC6G5bh0N2HDBPJ92rpcFkhwN e59YYou6qGbNLORgozqU6FMS6HM3/wa+J4b6TZIlsHYd5cLbB5Kc6GHILUqIb40xUB qmk5S7dLKPvNXe2mpWcn9IOBG8lzCh7VVav2sDnIkxHrAsRB50JvPncclnYsMsrEqR AoiEqA8inwI48i19Y1YHMA6A7VE4XyPK7TpZCYeemhboDoQ7Z59cF00ZQ3eXOnBVvb j+vN3ZkZD47dw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7AEAC681D3 for ; Sat, 18 Oct 2025 02:42:34 -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 Asb8rvtZXPiI for ; Sat, 18 Oct 2025 02:42:34 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760776954; bh=ftrW8qL5Te1j47yygD8AD67rGzrcbwcyGKalinVu4cA=; 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=crUTd1IwgGHtEycUpRtNNK5Z193HJW3aud0OdHvsZLnLkd90co5ZREvpvIRAa/l/2 b1PWH7GYaePOcTO+WOj9u75PlSdjP9p30kE2ScdV1CC6G5bh0N2HDBPJ92rpcFkhwN e59YYou6qGbNLORgozqU6FMS6HM3/wa+J4b6TZIlsHYd5cLbB5Kc6GHILUqIb40xUB qmk5S7dLKPvNXe2mpWcn9IOBG8lzCh7VVav2sDnIkxHrAsRB50JvPncclnYsMsrEqR AoiEqA8inwI48i19Y1YHMA6A7VE4XyPK7TpZCYeemhboDoQ7Z59cF00ZQ3eXOnBVvb j+vN3ZkZD47dw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6713A6814E for ; Sat, 18 Oct 2025 02:42:34 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760776951; bh=0W8zMsTNwnZnFUFjCCdfzsBDeYxKzq0Rr4MCRg8sI2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HS6RY3Gk8cMsfoQh3GKY33/u9VffWqncbR01n8VcK6+h2r9bs9892olMYdbycsBfc ZHVp13TnSD7xsrVySccJsq+vC6xflR/WHijoSuc3SM2gOYrdzGkWe6FUL3GRQXjQzT QeShk67YvySixK6gZnZgh0wFyctXrFD9bR4rZnr9bnSQ/Twzk8C/Fg5xGMK8c1p3ce 4IYXmy0oJ6fp04dsRaDq7gyqcXJuPJG7bs6iGcwGjYefjemPA5xwWGSw0Ej+5UGlcP xLnLzn+UtwtgLTaIqwlt4E2XpucZQoGjXNOPONCSOAZEY1TRfyyh3KCGyGykiFWM+M Br2AF9T5zoS7Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ECAE7681CD; Sat, 18 Oct 2025 02:42:31 -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 Flg_KuWvWleY; Sat, 18 Oct 2025 02:42:31 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760776947; bh=tH6qHQr7PXEXs9QFvU1I3Mzqx26IFb39iSjN8iN8TSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XgaGSGl1eDGQGpWZR2qUj7akneG8mZm4+x8jwNG9nRHD8i03TvigAsDrVtcjaNFPE SPNeV4RGy0QkQF6jHxSWm5e7vri7tPi8G1OFH5WxLcG8vE19qFamRwSOmS8iS4PEcQ npawcUgG2GLx/CT3DMvF8t3HpVV9jRDNsGrA2tckY6Sp5b0pDvxkh1aUCUv32PYBtB zspaPxcbxwdgjlcLGTMmaG042bQHI1lBHbRdzD0ERHYefHSOYNb2W5u3KV8avk/aA8 FCrEeRgw/eZQSJHzeqeqam/BC5SQeVQG90IO/1j6bLK82WQzQdas7Pvrny83kFV317 rte7GfYWty8HA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 844286814E; Sat, 18 Oct 2025 02:42:27 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sat, 18 Oct 2025 02:41:03 -0600 Message-ID: <20251018084117.1798704-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251018084117.1798704-1-sjg@u-boot.org> References: <20251018084117.1798704-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JM47J63QRW3TNJZA2QNZHI3UIOMZOUZP X-Message-ID-Hash: JM47J63QRW3TNJZA2QNZHI3UIOMZOUZP 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 18/24] bootctl: Add an option to switch the layout 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 Provide an operation to switch to a different layout, for use with the upcoming 'multi' UI. Signed-off-by: Simon Glass --- boot/bootctl/util.c | 15 +++++++++++++++ include/bootctl/ui.h | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/boot/bootctl/util.c b/boot/bootctl/util.c index ec8de21815d..48912c67f21 100644 --- a/boot/bootctl/util.c +++ b/boot/bootctl/util.c @@ -95,6 +95,21 @@ int bc_ui_poll(struct udevice *disp, int *seqp, bool *selectedp) return ret; } +int bc_ui_switch_layout(struct udevice *dev) +{ + struct bc_ui_ops *ops = bc_ui_get_ops(dev); + int ret; + + if (!ops->switch_layout) + return -ENOSYS; + + ret = ops->switch_layout(dev); + if (ret) + return log_msg_ret("bsl", ret); + + return 0; +} + void bc_oslist_setup_iter(struct oslist_iter *iter) { memset(iter, '\0', sizeof(struct oslist_iter)); diff --git a/include/bootctl/ui.h b/include/bootctl/ui.h index beb11178c52..4f8e08a00c2 100644 --- a/include/bootctl/ui.h +++ b/include/bootctl/ui.h @@ -91,6 +91,14 @@ struct bc_ui_ops { * -ve on error */ int (*poll)(struct udevice *dev, int *seqp, bool *selectedp); + + /** + * switch_layout() - Switch between different UI layout modes + * + * @dev: Display device + * Return 0 if OK, -ve on error + */ + int (*switch_layout)(struct udevice *dev); }; #define bc_ui_get_ops(dev) ((struct bc_ui_ops *)(dev)->driver->ops) @@ -132,4 +140,12 @@ int bc_ui_render(struct udevice *dev); */ int bc_ui_poll(struct udevice *dev, int *seqp, bool *selectedp); +/** + * bc_ui_switch_layout() - Switch between different UI layout modes + * + * @dev: Display device + * Return 0 if OK, -ve on error + */ +int bc_ui_switch_layout(struct udevice *dev); + #endif