From a4ede5e0aced904efb17f3a3d5fb2c7f3c622133 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 2 May 2025 08:46:29 -0600 Subject: expo: Allow adding a single bootflow to a menu Refactor bootflow_menu_add_all() to call a new bootflow_menu_add() to add each of its bootflows. Move the last_bootdev value into struct menu_priv to make this work. Signed-off-by: Simon Glass --- include/bootflow.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/bootflow.h b/include/bootflow.h index 994b38394e8..615fb97f4a4 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -15,6 +15,7 @@ struct bootstd_priv; struct expo; +struct scene; enum { BOOTFLOW_MAX_USED_DEVS = 16, @@ -506,6 +507,21 @@ int bootflow_menu_new(struct expo **expp); */ int bootflow_menu_add_all(struct expo *exp); +/** + * bootflow_menu_add() - Add a bootflow to a menu + * + * Adds a new bootflow to the end of a menu. The caller must be careful to pass + * seq=0 for the first bootflow added, 1 for the second, etc. + * + * @exp: Menu to update + * @bflow: Bootflow to add + * @seq: Sequence number of this bootflow (0 = first) + * @scnp: Returns a pointer to the scene + * Return 0 on success, -ve on error + */ +int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, + struct scene **scnp); + /** * bootflow_menu_apply_theme() - Apply a theme to a bootmenu * -- cgit v1.2.3