bootctl: Add an option to switch the layout

Provide an operation to switch to a different layout, for use with the
upcoming 'multi' UI.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-10-16 11:47:11 +01:00
parent b54d2ae5b9
commit 781e013812
2 changed files with 31 additions and 0 deletions

View File

@@ -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));

View File

@@ -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