From: Simon Glass <sjg@chromium.org> Provide an operation to switch to a different layout, for use with the upcoming 'multi' UI. Signed-off-by: Simon Glass <sjg@chromium.org> --- 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 -- 2.43.0