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:
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user