Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright 2022 Google LLC |
| 4 | * Written by Simon Glass <sjg@chromium.org> |
| 5 | */ |
| 6 | |
Simon Glass | 8df4a4e | 2023-08-14 16:40:25 -0600 | [diff] [blame] | 7 | #ifndef __EXPO_H |
| 8 | #define __EXPO_H |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 9 | |
Simon Glass | a968f5f | 2023-10-01 19:13:31 -0600 | [diff] [blame] | 10 | #include <abuf.h> |
Simon Glass | c999e17 | 2023-06-01 10:22:53 -0600 | [diff] [blame] | 11 | #include <dm/ofnode_decl.h> |
Simon Glass | ebec497 | 2025-05-02 08:46:33 -0600 | [diff] [blame] | 12 | #include <linux/bitops.h> |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 13 | #include <linux/list.h> |
| 14 | |
| 15 | struct udevice; |
| 16 | |
Simon Glass | a968f5f | 2023-10-01 19:13:31 -0600 | [diff] [blame] | 17 | #include <cli.h> |
| 18 | |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 19 | /** |
Simon Glass | 53a0a2f | 2024-10-14 16:31:57 -0600 | [diff] [blame] | 20 | * enum expo_id_t - standard expo IDs |
| 21 | * |
| 22 | * These are assumed to be in use at all times. Expos should use IDs starting |
| 23 | * from EXPOID_BASE_ID, |
| 24 | * |
| 25 | * @EXPOID_NONE: Not used, invalid ID 0 |
| 26 | * @EXPOID_SAVE: User has requested that the expo data be saved |
| 27 | * @EXPOID_DISCARD: User has requested that the expo data be discarded |
| 28 | * @EXPOID_BASE_ID: First ID which can be used for expo objects |
| 29 | */ |
| 30 | enum expo_id_t { |
| 31 | EXPOID_NONE, |
| 32 | |
| 33 | EXPOID_SAVE, |
| 34 | EXPOID_DISCARD, |
| 35 | |
| 36 | EXPOID_BASE_ID = 5, |
| 37 | }; |
| 38 | |
| 39 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 40 | * enum expoact_type - types of actions reported by the expo |
| 41 | * |
| 42 | * @EXPOACT_NONE: no action |
Simon Glass | f0e1e8c | 2023-06-01 10:22:59 -0600 | [diff] [blame] | 43 | * @EXPOACT_POINT_OBJ: object was highlighted (@id indicates which) |
Simon Glass | 719a3c6 | 2023-06-01 10:22:56 -0600 | [diff] [blame] | 44 | * @EXPOACT_POINT_ITEM: menu item was highlighted (@id indicates which) |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 45 | * @EXPOACT_SELECT: menu item was selected (@id indicates which) |
Simon Glass | f0e1e8c | 2023-06-01 10:22:59 -0600 | [diff] [blame] | 46 | * @EXPOACT_OPEN: menu was opened, so an item can be selected (@id indicates |
| 47 | * which menu object) |
| 48 | * @EXPOACT_CLOSE: menu was closed (@id indicates which menu object) |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 49 | * @EXPOACT_QUIT: request to exit the menu |
| 50 | */ |
| 51 | enum expoact_type { |
| 52 | EXPOACT_NONE, |
Simon Glass | f0e1e8c | 2023-06-01 10:22:59 -0600 | [diff] [blame] | 53 | EXPOACT_POINT_OBJ, |
Simon Glass | 719a3c6 | 2023-06-01 10:22:56 -0600 | [diff] [blame] | 54 | EXPOACT_POINT_ITEM, |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 55 | EXPOACT_SELECT, |
Simon Glass | f0e1e8c | 2023-06-01 10:22:59 -0600 | [diff] [blame] | 56 | EXPOACT_OPEN, |
| 57 | EXPOACT_CLOSE, |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 58 | EXPOACT_QUIT, |
| 59 | }; |
| 60 | |
| 61 | /** |
| 62 | * struct expo_action - an action report by the expo |
| 63 | * |
| 64 | * @type: Action type (EXPOACT_NONE if there is no action) |
Simon Glass | 719a3c6 | 2023-06-01 10:22:56 -0600 | [diff] [blame] | 65 | * @select: Used for EXPOACT_POINT_ITEM and EXPOACT_SELECT |
Heinrich Schuchardt | a99e8fe | 2024-09-18 23:58:03 +0200 | [diff] [blame] | 66 | * @select.id: ID number of the object affected. |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 67 | */ |
| 68 | struct expo_action { |
| 69 | enum expoact_type type; |
| 70 | union { |
| 71 | struct { |
| 72 | int id; |
| 73 | } select; |
| 74 | }; |
| 75 | }; |
| 76 | |
| 77 | /** |
Simon Glass | c999e17 | 2023-06-01 10:22:53 -0600 | [diff] [blame] | 78 | * struct expo_theme - theme for the expo |
| 79 | * |
| 80 | * @font_size: Default font size for all text |
| 81 | * @menu_inset: Inset width (on each side and top/bottom) for menu items |
| 82 | * @menuitem_gap_y: Gap between menu items in pixels |
Simon Glass | 377f18e | 2024-10-14 16:31:55 -0600 | [diff] [blame] | 83 | * @menu_title_margin_x: Gap between right side of menu title and left size of |
| 84 | * menu label |
Simon Glass | c999e17 | 2023-06-01 10:22:53 -0600 | [diff] [blame] | 85 | */ |
| 86 | struct expo_theme { |
| 87 | u32 font_size; |
| 88 | u32 menu_inset; |
| 89 | u32 menuitem_gap_y; |
Simon Glass | 377f18e | 2024-10-14 16:31:55 -0600 | [diff] [blame] | 90 | u32 menu_title_margin_x; |
Simon Glass | c999e17 | 2023-06-01 10:22:53 -0600 | [diff] [blame] | 91 | }; |
| 92 | |
| 93 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 94 | * struct expo - information about an expo |
| 95 | * |
| 96 | * A group of scenes which can be presented to the user, typically to obtain |
| 97 | * input or to make a selection. |
| 98 | * |
| 99 | * @name: Name of the expo (allocated) |
| 100 | * @display: Display to use (`UCLASS_VIDEO`), or NULL to use text mode |
Simon Glass | 67e2af1 | 2023-06-01 10:22:34 -0600 | [diff] [blame] | 101 | * @cons: Console to use (`UCLASS_VIDEO_CONSOLE`), or NULL to use text mode |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 102 | * @scene_id: Current scene ID (0 if none) |
| 103 | * @next_id: Next ID number to use, for automatic allocation |
| 104 | * @action: Action selected by user. At present only one is supported, with the |
| 105 | * type set to EXPOACT_NONE if there is no action |
| 106 | * @text_mode: true to use text mode for the menu (no vidconsole) |
Simon Glass | d353b75 | 2023-06-01 10:22:55 -0600 | [diff] [blame] | 107 | * @popup: true to use popup menus, instead of showing all items |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 108 | * @priv: Private data for the controller |
Simon Glass | 527d864 | 2025-05-02 08:46:20 -0600 | [diff] [blame] | 109 | * @done: Indicates that a cedit session is complete and the user has quit |
| 110 | * @save: Indicates that cedit data should be saved, rather than discarded |
Simon Glass | c999e17 | 2023-06-01 10:22:53 -0600 | [diff] [blame] | 111 | * @theme: Information about fonts styles, etc. |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 112 | * @scene_head: List of scenes |
| 113 | * @str_head: list of strings |
Simon Glass | 683d883 | 2025-05-02 08:46:15 -0600 | [diff] [blame] | 114 | * @cch: Keyboard context for input |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 115 | */ |
| 116 | struct expo { |
| 117 | char *name; |
| 118 | struct udevice *display; |
Simon Glass | 67e2af1 | 2023-06-01 10:22:34 -0600 | [diff] [blame] | 119 | struct udevice *cons; |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 120 | uint scene_id; |
| 121 | uint next_id; |
| 122 | struct expo_action action; |
| 123 | bool text_mode; |
Simon Glass | d353b75 | 2023-06-01 10:22:55 -0600 | [diff] [blame] | 124 | bool popup; |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 125 | void *priv; |
Simon Glass | 527d864 | 2025-05-02 08:46:20 -0600 | [diff] [blame] | 126 | bool done; |
| 127 | bool save; |
Simon Glass | c999e17 | 2023-06-01 10:22:53 -0600 | [diff] [blame] | 128 | struct expo_theme theme; |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 129 | struct list_head scene_head; |
| 130 | struct list_head str_head; |
Simon Glass | 683d883 | 2025-05-02 08:46:15 -0600 | [diff] [blame] | 131 | struct cli_ch_state cch; |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 132 | }; |
| 133 | |
| 134 | /** |
| 135 | * struct expo_string - a string that can be used in an expo |
| 136 | * |
| 137 | * @id: ID number of the string |
Simon Glass | da33775 | 2025-05-02 08:46:32 -0600 | [diff] [blame] | 138 | * @buf: String (contains nul terminator) |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 139 | * @sibling: Node to link this object to its siblings |
| 140 | */ |
| 141 | struct expo_string { |
| 142 | uint id; |
Simon Glass | da33775 | 2025-05-02 08:46:32 -0600 | [diff] [blame] | 143 | struct abuf buf; |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 144 | struct list_head sibling; |
| 145 | }; |
| 146 | |
| 147 | /** |
| 148 | * struct scene - information about a scene in an expo |
| 149 | * |
| 150 | * A collection of text/image/menu items in an expo |
| 151 | * |
| 152 | * @expo: Expo this scene is part of |
| 153 | * @name: Name of the scene (allocated) |
| 154 | * @id: ID number of the scene |
Simon Glass | ea274b6 | 2023-06-01 10:22:27 -0600 | [diff] [blame] | 155 | * @title_id: String ID of title of the scene (allocated) |
Simon Glass | d353b75 | 2023-06-01 10:22:55 -0600 | [diff] [blame] | 156 | * @highlight_id: ID of highlighted object, if any |
Simon Glass | a968f5f | 2023-10-01 19:13:31 -0600 | [diff] [blame] | 157 | * @cls: cread state to use for input |
| 158 | * @buf: Buffer for input |
| 159 | * @entry_save: Buffer to hold vidconsole text-entry information |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 160 | * @sibling: Node to link this scene to its siblings |
| 161 | * @obj_head: List of objects in the scene |
| 162 | */ |
| 163 | struct scene { |
| 164 | struct expo *expo; |
| 165 | char *name; |
| 166 | uint id; |
Simon Glass | ea274b6 | 2023-06-01 10:22:27 -0600 | [diff] [blame] | 167 | uint title_id; |
Simon Glass | d353b75 | 2023-06-01 10:22:55 -0600 | [diff] [blame] | 168 | uint highlight_id; |
Simon Glass | a968f5f | 2023-10-01 19:13:31 -0600 | [diff] [blame] | 169 | struct cli_line_state cls; |
| 170 | struct abuf buf; |
| 171 | struct abuf entry_save; |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 172 | struct list_head sibling; |
| 173 | struct list_head obj_head; |
| 174 | }; |
| 175 | |
| 176 | /** |
| 177 | * enum scene_obj_t - type of a scene object |
| 178 | * |
| 179 | * @SCENEOBJT_NONE: Used to indicate that the type does not matter |
| 180 | * @SCENEOBJT_IMAGE: Image data to render |
| 181 | * @SCENEOBJT_TEXT: Text line to render |
| 182 | * @SCENEOBJT_MENU: Menu containing items the user can select |
Simon Glass | 6116e76 | 2023-10-01 19:13:32 -0600 | [diff] [blame] | 183 | * @SCENEOBJT_TEXTLINE: Line of text the user can edit |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 184 | */ |
| 185 | enum scene_obj_t { |
| 186 | SCENEOBJT_NONE = 0, |
| 187 | SCENEOBJT_IMAGE, |
| 188 | SCENEOBJT_TEXT, |
Simon Glass | 193bfea | 2023-10-01 19:13:27 -0600 | [diff] [blame] | 189 | |
| 190 | /* types from here on can be highlighted */ |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 191 | SCENEOBJT_MENU, |
Simon Glass | 6116e76 | 2023-10-01 19:13:32 -0600 | [diff] [blame] | 192 | SCENEOBJT_TEXTLINE, |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 193 | }; |
| 194 | |
| 195 | /** |
Simon Glass | 854ca69 | 2025-05-02 08:46:30 -0600 | [diff] [blame] | 196 | * struct scene_obj_bbox - Dimensions of an object |
Simon Glass | 7b04395 | 2023-06-01 10:22:49 -0600 | [diff] [blame] | 197 | * |
Simon Glass | bc3a15f | 2025-05-02 08:46:31 -0600 | [diff] [blame] | 198 | * @x0: x position, in pixels from left side |
| 199 | * @y0: y position, in pixels from top |
Simon Glass | ebec497 | 2025-05-02 08:46:33 -0600 | [diff] [blame] | 200 | * @x1: x position of right size |
| 201 | * @y1: y position of bottom |
Simon Glass | 7b04395 | 2023-06-01 10:22:49 -0600 | [diff] [blame] | 202 | */ |
Simon Glass | 854ca69 | 2025-05-02 08:46:30 -0600 | [diff] [blame] | 203 | struct scene_obj_bbox { |
Simon Glass | bc3a15f | 2025-05-02 08:46:31 -0600 | [diff] [blame] | 204 | int x0; |
| 205 | int y0; |
Simon Glass | ebec497 | 2025-05-02 08:46:33 -0600 | [diff] [blame] | 206 | int x1; |
| 207 | int y1; |
Simon Glass | 7b04395 | 2023-06-01 10:22:49 -0600 | [diff] [blame] | 208 | }; |
| 209 | |
| 210 | /** |
Simon Glass | ebec497 | 2025-05-02 08:46:33 -0600 | [diff] [blame] | 211 | * struct scene_obj_dims - Dimensions of the object being drawn |
| 212 | * |
| 213 | * Image and text objects have a dimension which can change depending on what |
| 214 | * they contain. For images this stores the size. For text it stores the size as |
| 215 | * rendered on the display |
| 216 | * |
| 217 | * @x: x dimension |
| 218 | * @y: y dimension |
| 219 | */ |
| 220 | struct scene_obj_dims { |
| 221 | int x; |
| 222 | int y; |
| 223 | }; |
| 224 | |
| 225 | /** |
Simon Glass | 6081b0f | 2023-06-01 10:22:50 -0600 | [diff] [blame] | 226 | * enum scene_obj_flags_t - flags for objects |
| 227 | * |
| 228 | * @SCENEOF_HIDE: object should be hidden |
Simon Glass | d353b75 | 2023-06-01 10:22:55 -0600 | [diff] [blame] | 229 | * @SCENEOF_POINT: object should be highlighted |
| 230 | * @SCENEOF_OPEN: object should be opened (e.g. menu is opened so that an option |
| 231 | * can be selected) |
Simon Glass | ebec497 | 2025-05-02 08:46:33 -0600 | [diff] [blame] | 232 | * @SCENEOF_SIZE_VALID: object's size (width/height) is valid, so any adjustment |
| 233 | * to x0/y0 should maintain the width/height of the object |
Simon Glass | 6081b0f | 2023-06-01 10:22:50 -0600 | [diff] [blame] | 234 | */ |
| 235 | enum scene_obj_flags_t { |
| 236 | SCENEOF_HIDE = 1 << 0, |
Simon Glass | d353b75 | 2023-06-01 10:22:55 -0600 | [diff] [blame] | 237 | SCENEOF_POINT = 1 << 1, |
| 238 | SCENEOF_OPEN = 1 << 2, |
Simon Glass | ebec497 | 2025-05-02 08:46:33 -0600 | [diff] [blame] | 239 | SCENEOF_SIZE_VALID = BIT(3), |
Simon Glass | 6081b0f | 2023-06-01 10:22:50 -0600 | [diff] [blame] | 240 | }; |
| 241 | |
Simon Glass | a968f5f | 2023-10-01 19:13:31 -0600 | [diff] [blame] | 242 | enum { |
| 243 | /* Maximum number of characters allowed in an line editor */ |
| 244 | EXPO_MAX_CHARS = 250, |
| 245 | }; |
| 246 | |
Simon Glass | 6081b0f | 2023-06-01 10:22:50 -0600 | [diff] [blame] | 247 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 248 | * struct scene_obj - information about an object in a scene |
| 249 | * |
| 250 | * @scene: Scene that this object relates to |
| 251 | * @name: Name of the object (allocated) |
| 252 | * @id: ID number of the object |
| 253 | * @type: Type of this object |
Simon Glass | ebec497 | 2025-05-02 08:46:33 -0600 | [diff] [blame] | 254 | * @bbox: Bounding box for this object |
| 255 | * @dims: Dimensions of the text/image (may be smaller than bbox) |
Simon Glass | 6081b0f | 2023-06-01 10:22:50 -0600 | [diff] [blame] | 256 | * @flags: Flags for this object |
Simon Glass | 2b91ca6 | 2023-08-14 16:40:37 -0600 | [diff] [blame] | 257 | * @bit_length: Number of bits used for this object in CMOS RAM |
| 258 | * @start_bit: Start bit to use for this object in CMOS RAM |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 259 | * @sibling: Node to link this object to its siblings |
| 260 | */ |
| 261 | struct scene_obj { |
| 262 | struct scene *scene; |
| 263 | char *name; |
| 264 | uint id; |
| 265 | enum scene_obj_t type; |
Simon Glass | 854ca69 | 2025-05-02 08:46:30 -0600 | [diff] [blame] | 266 | struct scene_obj_bbox bbox; |
Simon Glass | ebec497 | 2025-05-02 08:46:33 -0600 | [diff] [blame] | 267 | struct scene_obj_dims dims; |
Simon Glass | 2b91ca6 | 2023-08-14 16:40:37 -0600 | [diff] [blame] | 268 | u8 flags; |
| 269 | u8 bit_length; |
| 270 | u16 start_bit; |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 271 | struct list_head sibling; |
| 272 | }; |
| 273 | |
Simon Glass | 193bfea | 2023-10-01 19:13:27 -0600 | [diff] [blame] | 274 | /* object can be highlighted when moving around expo */ |
| 275 | static inline bool scene_obj_can_highlight(const struct scene_obj *obj) |
| 276 | { |
| 277 | return obj->type >= SCENEOBJT_MENU; |
| 278 | } |
| 279 | |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 280 | /** |
| 281 | * struct scene_obj_img - information about an image object in a scene |
| 282 | * |
| 283 | * This is a rectangular image which is blitted onto the display |
| 284 | * |
| 285 | * @obj: Basic object information |
| 286 | * @data: Image data in BMP format |
| 287 | */ |
| 288 | struct scene_obj_img { |
| 289 | struct scene_obj obj; |
| 290 | char *data; |
| 291 | }; |
| 292 | |
| 293 | /** |
| 294 | * struct scene_obj_txt - information about a text object in a scene |
| 295 | * |
| 296 | * This is a single-line text object |
| 297 | * |
| 298 | * @obj: Basic object information |
| 299 | * @str_id: ID of the text string to display |
| 300 | * @font_name: Name of font (allocated by caller) |
| 301 | * @font_size: Nominal size of font in pixels |
| 302 | */ |
| 303 | struct scene_obj_txt { |
| 304 | struct scene_obj obj; |
| 305 | uint str_id; |
| 306 | const char *font_name; |
| 307 | uint font_size; |
| 308 | }; |
| 309 | |
| 310 | /** |
| 311 | * struct scene_obj_menu - information about a menu object in a scene |
| 312 | * |
| 313 | * A menu has a number of items which can be selected by the user |
| 314 | * |
| 315 | * It also has: |
| 316 | * |
| 317 | * - a text/image object (@pointer_id) which points to the current item |
| 318 | * (@cur_item_id) |
| 319 | * |
| 320 | * - a preview object which shows an image related to the current item |
| 321 | * |
| 322 | * @obj: Basic object information |
| 323 | * @title_id: ID of the title text, or 0 if none |
| 324 | * @cur_item_id: ID of the current menu item, or 0 if none |
| 325 | * @pointer_id: ID of the object pointing to the current selection |
| 326 | * @item_head: List of items in the menu |
| 327 | */ |
| 328 | struct scene_obj_menu { |
| 329 | struct scene_obj obj; |
| 330 | uint title_id; |
| 331 | uint cur_item_id; |
| 332 | uint pointer_id; |
| 333 | struct list_head item_head; |
| 334 | }; |
| 335 | |
| 336 | /** |
| 337 | * enum scene_menuitem_flags_t - flags for menu items |
| 338 | * |
| 339 | * @SCENEMIF_GAP_BEFORE: Add a gap before this item |
| 340 | */ |
| 341 | enum scene_menuitem_flags_t { |
| 342 | SCENEMIF_GAP_BEFORE = 1 << 0, |
| 343 | }; |
| 344 | |
| 345 | /** |
| 346 | * struct scene_menitem - a menu item in a menu |
| 347 | * |
| 348 | * A menu item has: |
| 349 | * |
| 350 | * - text object holding the name (short) and description (can be longer) |
| 351 | * - a text object holding the keypress |
| 352 | * |
| 353 | * @name: Name of the item (this is allocated by this call) |
| 354 | * @id: ID number of the object |
| 355 | * @key_id: ID of text object to use as the keypress to show |
| 356 | * @label_id: ID of text object to use as the label text |
| 357 | * @desc_id: ID of text object to use as the description text |
| 358 | * @preview_id: ID of the preview object, or 0 if none |
| 359 | * @flags: Flags for this item |
Simon Glass | 100389f | 2024-10-14 16:31:58 -0600 | [diff] [blame] | 360 | * @value: Value for this item, or INT_MAX to use sequence |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 361 | * @sibling: Node to link this item to its siblings |
| 362 | */ |
| 363 | struct scene_menitem { |
| 364 | char *name; |
| 365 | uint id; |
| 366 | uint key_id; |
| 367 | uint label_id; |
| 368 | uint desc_id; |
| 369 | uint preview_id; |
| 370 | uint flags; |
Simon Glass | 100389f | 2024-10-14 16:31:58 -0600 | [diff] [blame] | 371 | int value; |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 372 | struct list_head sibling; |
| 373 | }; |
| 374 | |
| 375 | /** |
Simon Glass | 6116e76 | 2023-10-01 19:13:32 -0600 | [diff] [blame] | 376 | * struct scene_obj_textline - information about a textline in a scene |
| 377 | * |
| 378 | * A textline has a prompt and a line of editable text |
| 379 | * |
| 380 | * @obj: Basic object information |
| 381 | * @label_id: ID of the label text, or 0 if none |
| 382 | * @edit_id: ID of the editable text |
| 383 | * @max_chars: Maximum number of characters allowed |
| 384 | * @buf: Text buffer containing current text |
| 385 | * @pos: Cursor position |
| 386 | */ |
| 387 | struct scene_obj_textline { |
| 388 | struct scene_obj obj; |
| 389 | uint label_id; |
| 390 | uint edit_id; |
| 391 | uint max_chars; |
| 392 | struct abuf buf; |
| 393 | uint pos; |
| 394 | }; |
| 395 | |
| 396 | /** |
Simon Glass | 377f18e | 2024-10-14 16:31:55 -0600 | [diff] [blame] | 397 | * struct expo_arrange_info - Information used when arranging a scene |
| 398 | * |
| 399 | * @label_width: Maximum width of labels in scene |
| 400 | */ |
| 401 | struct expo_arrange_info { |
| 402 | int label_width; |
| 403 | }; |
| 404 | |
| 405 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 406 | * expo_new() - create a new expo |
| 407 | * |
| 408 | * Allocates a new expo |
| 409 | * |
| 410 | * @name: Name of expo (this is allocated by this call) |
| 411 | * @priv: Private data for the controller |
| 412 | * @expp: Returns a pointer to the new expo on success |
| 413 | * Returns: 0 if OK, -ENOMEM if out of memory |
| 414 | */ |
| 415 | int expo_new(const char *name, void *priv, struct expo **expp); |
| 416 | |
| 417 | /** |
| 418 | * expo_destroy() - Destroy an expo and free all its memory |
| 419 | * |
| 420 | * @exp: Expo to destroy |
| 421 | */ |
| 422 | void expo_destroy(struct expo *exp); |
| 423 | |
| 424 | /** |
Simon Glass | 6e9e415 | 2023-06-01 10:22:47 -0600 | [diff] [blame] | 425 | * expo_set_dynamic_start() - Set the start of the 'dynamic' IDs |
| 426 | * |
| 427 | * It is common for a set of 'static' IDs to be used to refer to objects in the |
| 428 | * expo. These typically use an enum so that they are defined in sequential |
| 429 | * order. |
| 430 | * |
| 431 | * Dynamic IDs (for objects not in the enum) are intended to be used for |
| 432 | * objects to which the code does not need to refer. These are ideally located |
| 433 | * above the static IDs. |
| 434 | * |
| 435 | * Use this function to set the start of the dynamic range, making sure that the |
| 436 | * value is higher than all the statically allocated IDs. |
| 437 | * |
| 438 | * @exp: Expo to update |
| 439 | * @dyn_start: Start ID that expo should use for dynamic allocation |
| 440 | */ |
| 441 | void expo_set_dynamic_start(struct expo *exp, uint dyn_start); |
| 442 | |
| 443 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 444 | * expo_str() - add a new string to an expo |
| 445 | * |
| 446 | * @exp: Expo to update |
| 447 | * @name: Name to use (this is allocated by this call) |
| 448 | * @id: ID to use for the new object (0 to allocate one) |
| 449 | * @str: Pointer to text to display (allocated by caller) |
| 450 | * Returns: ID number for the object (typically @id), or -ve on error |
| 451 | */ |
| 452 | int expo_str(struct expo *exp, const char *name, uint id, const char *str); |
| 453 | |
| 454 | /** |
| 455 | * expo_get_str() - Get a string by ID |
| 456 | * |
| 457 | * @exp: Expo to use |
| 458 | * @id: String ID to look up |
| 459 | * @returns string, or NULL if not found |
| 460 | */ |
| 461 | const char *expo_get_str(struct expo *exp, uint id); |
| 462 | |
| 463 | /** |
| 464 | * expo_set_display() - set the display to use for a expo |
| 465 | * |
| 466 | * @exp: Expo to update |
| 467 | * @dev: Display to use (`UCLASS_VIDEO`), NULL to use text mode |
| 468 | * Returns: 0 (always) |
| 469 | */ |
| 470 | int expo_set_display(struct expo *exp, struct udevice *dev); |
| 471 | |
| 472 | /** |
Simon Glass | 7a96005 | 2023-06-01 10:22:52 -0600 | [diff] [blame] | 473 | * expo_calc_dims() - Calculate the dimensions of the objects |
| 474 | * |
| 475 | * Updates the width and height of all objects based on their contents |
| 476 | * |
| 477 | * @exp: Expo to update |
| 478 | * Returns 0 if OK, -ENOTSUPP if there is no graphical console |
| 479 | */ |
| 480 | int expo_calc_dims(struct expo *exp); |
| 481 | |
| 482 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 483 | * expo_set_scene_id() - Set the current scene ID |
| 484 | * |
| 485 | * @exp: Expo to update |
| 486 | * @scene_id: New scene ID to use (0 to select no scene) |
| 487 | * Returns: 0 if OK, -ENOENT if there is no scene with that ID |
| 488 | */ |
| 489 | int expo_set_scene_id(struct expo *exp, uint scene_id); |
| 490 | |
| 491 | /** |
Simon Glass | c892511 | 2023-06-01 10:23:02 -0600 | [diff] [blame] | 492 | * expo_first_scene_id() - Get the ID of the first scene |
| 493 | * |
| 494 | * @exp: Expo to check |
| 495 | * Returns: Scene ID of first scene, or -ENOENT if there are no scenes |
| 496 | */ |
| 497 | int expo_first_scene_id(struct expo *exp); |
| 498 | |
| 499 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 500 | * expo_render() - render the expo on the display / console |
| 501 | * |
| 502 | * @exp: Expo to render |
| 503 | * |
| 504 | * Returns: 0 if OK, -ECHILD if there is no current scene, -ENOENT if the |
| 505 | * current scene is not found, other error if something else goes wrong |
| 506 | */ |
| 507 | int expo_render(struct expo *exp); |
| 508 | |
| 509 | /** |
Simon Glass | b2c4034 | 2023-06-01 10:22:37 -0600 | [diff] [blame] | 510 | * expo_set_text_mode() - Controls whether the expo renders in text mode |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 511 | * |
| 512 | * @exp: Expo to update |
| 513 | * @text_mode: true to use text mode, false to use the console |
| 514 | */ |
Simon Glass | b2c4034 | 2023-06-01 10:22:37 -0600 | [diff] [blame] | 515 | void expo_set_text_mode(struct expo *exp, bool text_mode); |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 516 | |
| 517 | /** |
| 518 | * scene_new() - create a new scene in a expo |
| 519 | * |
| 520 | * The scene is given the ID @id which must be unique across all scenes, objects |
| 521 | * and items. The expo's @next_id is updated to at least @id + 1 |
| 522 | * |
| 523 | * @exp: Expo to update |
| 524 | * @name: Name to use (this is allocated by this call) |
| 525 | * @id: ID to use for the new scene (0 to allocate one) |
| 526 | * @scnp: Returns a pointer to the new scene on success |
| 527 | * Returns: ID number for the scene (typically @id), or -ve on error |
| 528 | */ |
| 529 | int scene_new(struct expo *exp, const char *name, uint id, struct scene **scnp); |
| 530 | |
| 531 | /** |
| 532 | * expo_lookup_scene_id() - Look up a scene by ID |
| 533 | * |
| 534 | * @exp: Expo to check |
| 535 | * @scene_id: Scene ID to look up |
| 536 | * @returns pointer to scene if found, else NULL |
| 537 | */ |
| 538 | struct scene *expo_lookup_scene_id(struct expo *exp, uint scene_id); |
| 539 | |
| 540 | /** |
Simon Glass | 01922ec | 2023-06-01 10:22:57 -0600 | [diff] [blame] | 541 | * scene_highlight_first() - Highlight the first item in a scene |
| 542 | * |
| 543 | * This highlights the first item, so that the user can see that it is pointed |
| 544 | * to |
| 545 | * |
| 546 | * @scn: Scene to update |
| 547 | */ |
| 548 | void scene_highlight_first(struct scene *scn); |
| 549 | |
| 550 | /** |
| 551 | * scene_set_highlight_id() - Set the object which is highlighted |
| 552 | * |
| 553 | * Sets a new object to highlight in the scene |
| 554 | * |
| 555 | * @scn: Scene to update |
| 556 | * @id: ID of object to highlight |
| 557 | */ |
| 558 | void scene_set_highlight_id(struct scene *scn, uint id); |
| 559 | |
| 560 | /** |
| 561 | * scene_set_open() - Set whether an item is open or not |
| 562 | * |
| 563 | * @scn: Scene to update |
| 564 | * @id: ID of object to update |
| 565 | * @open: true to open the object, false to close it |
| 566 | * Returns: 0 if OK, -ENOENT if @id is invalid |
| 567 | */ |
| 568 | int scene_set_open(struct scene *scn, uint id, bool open); |
| 569 | |
| 570 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 571 | * scene_obj_count() - Count the number of objects in a scene |
| 572 | * |
| 573 | * @scn: Scene to check |
| 574 | * Returns: number of objects in the scene, 0 if none |
| 575 | */ |
| 576 | int scene_obj_count(struct scene *scn); |
| 577 | |
| 578 | /** |
| 579 | * scene_img() - add a new image to a scene |
| 580 | * |
| 581 | * @scn: Scene to update |
| 582 | * @name: Name to use (this is allocated by this call) |
| 583 | * @id: ID to use for the new object (0 to allocate one) |
| 584 | * @data: Pointer to image data |
| 585 | * @imgp: If non-NULL, returns the new object |
| 586 | * Returns: ID number for the object (typically @id), or -ve on error |
| 587 | */ |
| 588 | int scene_img(struct scene *scn, const char *name, uint id, char *data, |
| 589 | struct scene_obj_img **imgp); |
| 590 | |
| 591 | /** |
| 592 | * scene_txt() - add a new text object to a scene |
| 593 | * |
| 594 | * @scn: Scene to update |
| 595 | * @name: Name to use (this is allocated by this call) |
| 596 | * @id: ID to use for the new object (0 to allocate one) |
| 597 | * @str_id: ID of the string to use |
| 598 | * @txtp: If non-NULL, returns the new object |
| 599 | * Returns: ID number for the object (typically @id), or -ve on error |
| 600 | */ |
| 601 | int scene_txt(struct scene *scn, const char *name, uint id, uint str_id, |
| 602 | struct scene_obj_txt **txtp); |
| 603 | |
| 604 | /** |
Simon Glass | db6a051 | 2023-10-01 19:13:23 -0600 | [diff] [blame] | 605 | * scene_txt_str() - add a new string to expo and text object to a scene |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 606 | * |
| 607 | * @scn: Scene to update |
| 608 | * @name: Name to use (this is allocated by this call) |
| 609 | * @id: ID to use for the new object (0 to allocate one) |
| 610 | * @str_id: ID of the string to use |
| 611 | * @str: Pointer to text to display (allocated by caller) |
| 612 | * @txtp: If non-NULL, returns the new object |
| 613 | * Returns: ID number for the object (typically @id), or -ve on error |
| 614 | */ |
| 615 | int scene_txt_str(struct scene *scn, const char *name, uint id, uint str_id, |
| 616 | const char *str, struct scene_obj_txt **txtp); |
| 617 | |
| 618 | /** |
| 619 | * scene_menu() - create a menu |
| 620 | * |
| 621 | * @scn: Scene to update |
| 622 | * @name: Name to use (this is allocated by this call) |
| 623 | * @id: ID to use for the new object (0 to allocate one) |
| 624 | * @menup: If non-NULL, returns the new object |
| 625 | * Returns: ID number for the object (typically @id), or -ve on error |
| 626 | */ |
| 627 | int scene_menu(struct scene *scn, const char *name, uint id, |
| 628 | struct scene_obj_menu **menup); |
| 629 | |
| 630 | /** |
Simon Glass | 6116e76 | 2023-10-01 19:13:32 -0600 | [diff] [blame] | 631 | * scene_textline() - create a textline |
| 632 | * |
| 633 | * @scn: Scene to update |
| 634 | * @name: Name to use (this is allocated by this call) |
| 635 | * @id: ID to use for the new object (0 to allocate one) |
| 636 | * @max_chars: Maximum length of the textline in characters |
| 637 | * @tlinep: If non-NULL, returns the new object |
| 638 | * Returns: ID number for the object (typically @id), or -ve on error |
| 639 | */ |
| 640 | int scene_textline(struct scene *scn, const char *name, uint id, uint max_chars, |
| 641 | struct scene_obj_textline **tlinep); |
| 642 | |
| 643 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 644 | * scene_txt_set_font() - Set the font for an object |
| 645 | * |
| 646 | * @scn: Scene to update |
| 647 | * @id: ID of object to update |
| 648 | * @font_name: Font name to use (allocated by caller) |
| 649 | * @font_size: Font size to use (nominal height in pixels) |
| 650 | */ |
| 651 | int scene_txt_set_font(struct scene *scn, uint id, const char *font_name, |
| 652 | uint font_size); |
| 653 | |
| 654 | /** |
| 655 | * scene_obj_set_pos() - Set the postion of an object |
| 656 | * |
| 657 | * @scn: Scene to update |
| 658 | * @id: ID of object to update |
| 659 | * @x: x position, in pixels from left side |
| 660 | * @y: y position, in pixels from top |
| 661 | * Returns: 0 if OK, -ENOENT if @id is invalid |
| 662 | */ |
| 663 | int scene_obj_set_pos(struct scene *scn, uint id, int x, int y); |
| 664 | |
| 665 | /** |
Simon Glass | 7a96005 | 2023-06-01 10:22:52 -0600 | [diff] [blame] | 666 | * scene_obj_set_size() - Set the size of an object |
| 667 | * |
| 668 | * @scn: Scene to update |
| 669 | * @id: ID of object to update |
| 670 | * @w: width in pixels |
| 671 | * @h: height in pixels |
| 672 | * Returns: 0 if OK, -ENOENT if @id is invalid |
| 673 | */ |
| 674 | int scene_obj_set_size(struct scene *scn, uint id, int w, int h); |
| 675 | |
| 676 | /** |
Simon Glass | c6143dc | 2025-05-02 08:46:35 -0600 | [diff] [blame] | 677 | * scene_obj_set_width() - Set the width of an object |
| 678 | * |
| 679 | * @scn: Scene to update |
| 680 | * @id: ID of object to update |
| 681 | * @w: width in pixels |
| 682 | * Returns: 0 if OK, -ENOENT if @id is invalid |
| 683 | */ |
| 684 | int scene_obj_set_width(struct scene *scn, uint id, int w); |
| 685 | |
| 686 | /** |
| 687 | * scene_obj_set_bbox() - Set the bounding box of an object |
| 688 | * |
| 689 | * @scn: Scene to update |
| 690 | * @id: ID of object to update |
| 691 | * @x0: x position, in pixels from left side |
| 692 | * @y0: y position, in pixels from top |
| 693 | * @x1: ending x position (right side) |
| 694 | * @y1: ending y position (botton side) |
| 695 | * Returns: 0 if OK, -ENOENT if @id is invalid |
| 696 | */ |
| 697 | int scene_obj_set_bbox(struct scene *scn, uint id, int x0, int y0, int x1, |
| 698 | int y1); |
| 699 | |
| 700 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 701 | * scene_obj_set_hide() - Set whether an object is hidden |
| 702 | * |
| 703 | * The update happens when the expo is next rendered. |
| 704 | * |
| 705 | * @scn: Scene to update |
| 706 | * @id: ID of object to update |
| 707 | * @hide: true to hide the object, false to show it |
| 708 | * Returns: 0 if OK, -ENOENT if @id is invalid |
| 709 | */ |
| 710 | int scene_obj_set_hide(struct scene *scn, uint id, bool hide); |
| 711 | |
| 712 | /** |
| 713 | * scene_menu_set_title() - Set the title of a menu |
| 714 | * |
| 715 | * @scn: Scene to update |
| 716 | * @id: ID of menu object to update |
| 717 | * @title_id: ID of text object to use as the title |
| 718 | * Returns: 0 if OK, -ENOENT if @id is invalid, -EINVAL if @title_id is invalid |
| 719 | */ |
| 720 | int scene_menu_set_title(struct scene *scn, uint id, uint title_id); |
| 721 | |
| 722 | /** |
| 723 | * scene_menu_set_pointer() - Set the item pointer for a menu |
| 724 | * |
| 725 | * This is a visual indicator of the current item, typically a ">" character |
| 726 | * which sits next to the current item and moves when the user presses the |
| 727 | * up/down arrow keys |
| 728 | * |
| 729 | * @scn: Scene to update |
| 730 | * @id: ID of menu object to update |
| 731 | * @cur_item_id: ID of text or image object to use as a pointer to the current |
| 732 | * item |
| 733 | * Returns: 0 if OK, -ENOENT if @id is invalid, -EINVAL if @cur_item_id is invalid |
| 734 | */ |
| 735 | int scene_menu_set_pointer(struct scene *scn, uint id, uint cur_item_id); |
| 736 | |
| 737 | /** |
Simon Glass | be04b96 | 2025-05-02 08:46:24 -0600 | [diff] [blame] | 738 | * scene_menu_select_item() - move the pointer/highlight to an item |
| 739 | * |
| 740 | * @scn: Scene to update |
| 741 | * @id: ID of menu object to update |
| 742 | * @sel_id: ID of the menuitem to select |
| 743 | * Return 0 on success, -ENOENT if there was no such item |
| 744 | */ |
| 745 | int scene_menu_select_item(struct scene *scn, uint id, uint sel_id); |
| 746 | |
| 747 | /** |
| 748 | * scene_menu_get_cur_item() - get the currently pointed-to item |
| 749 | * |
| 750 | * @scn: Scene to update |
| 751 | * @id: ID of menu object to update |
| 752 | * Return ID of the current item the menu is pointing to, -ENOENT if @id is not |
| 753 | * valid, 0 if no item is pointed to |
| 754 | */ |
| 755 | int scene_menu_get_cur_item(struct scene *scn, uint id); |
| 756 | |
| 757 | /** |
Simon Glass | d8adbe9 | 2023-01-06 08:52:36 -0600 | [diff] [blame] | 758 | * scene_obj_get_hw() - Get width and height of an object in a scene |
| 759 | * |
| 760 | * @scn: Scene to check |
| 761 | * @id: ID of menu object to check |
| 762 | * @widthp: If non-NULL, returns width of object in pixels |
| 763 | * Returns: Height of object in pixels |
| 764 | */ |
| 765 | int scene_obj_get_hw(struct scene *scn, uint id, int *widthp); |
| 766 | |
| 767 | /** |
| 768 | * scene_menuitem() - Add an item to a menu |
| 769 | * |
| 770 | * @scn: Scene to update |
| 771 | * @menu_id: ID of menu object to update |
| 772 | * @name: Name to use (this is allocated by this call) |
| 773 | * @id: ID to use for the new object (0 to allocate one) |
| 774 | * @key_id: ID of text object to use as the keypress to show |
| 775 | * @label_id: ID of text object to use as the label text |
| 776 | * @desc_id: ID of text object to use as the description text |
| 777 | * @preview_id: ID of object to use as the preview (text or image) |
| 778 | * @flags: Flags for this item (enum scene_menuitem_flags_t) |
| 779 | * @itemp: If non-NULL, returns the new object |
| 780 | * Returns: ID number for the item (typically @id), or -ve on error |
| 781 | */ |
| 782 | int scene_menuitem(struct scene *scn, uint menu_id, const char *name, uint id, |
| 783 | uint key_id, uint label_id, uint desc_id, uint preview_id, |
| 784 | uint flags, struct scene_menitem **itemp); |
| 785 | |
| 786 | /** |
| 787 | * scene_arrange() - Arrange the scene to deal with object sizes |
| 788 | * |
| 789 | * Updates any menus in the scene so that their objects are in the right place. |
| 790 | * |
| 791 | * @scn: Scene to arrange |
| 792 | * Returns: 0 if OK, -ve on error |
| 793 | */ |
| 794 | int scene_arrange(struct scene *scn); |
| 795 | |
| 796 | /** |
| 797 | * expo_send_key() - set a keypress to the expo |
| 798 | * |
| 799 | * @exp: Expo to receive the key |
| 800 | * @key: Key to send (ASCII or enum bootmenu_key) |
| 801 | * Returns: 0 if OK, -ECHILD if there is no current scene |
| 802 | */ |
| 803 | int expo_send_key(struct expo *exp, int key); |
| 804 | |
| 805 | /** |
| 806 | * expo_action_get() - read user input from the expo |
| 807 | * |
| 808 | * @exp: Expo to check |
| 809 | * @act: Returns action |
| 810 | * Returns: 0 if OK, -EAGAIN if there was no action to return |
| 811 | */ |
| 812 | int expo_action_get(struct expo *exp, struct expo_action *act); |
| 813 | |
Simon Glass | c999e17 | 2023-06-01 10:22:53 -0600 | [diff] [blame] | 814 | /** |
| 815 | * expo_apply_theme() - Apply a theme to an expo |
| 816 | * |
| 817 | * @exp: Expo to update |
| 818 | * @node: Node containing the theme |
| 819 | */ |
| 820 | int expo_apply_theme(struct expo *exp, ofnode node); |
| 821 | |
Simon Glass | 6130072 | 2023-06-01 10:23:01 -0600 | [diff] [blame] | 822 | /** |
| 823 | * expo_build() - Build an expo from an FDT description |
| 824 | * |
| 825 | * Build a complete expo from a description in the provided devicetree. |
| 826 | * |
Massimo Pegorer | c8c7002 | 2023-09-09 12:32:28 +0200 | [diff] [blame] | 827 | * See doc/develop/expo.rst for a description of the format |
Simon Glass | 6130072 | 2023-06-01 10:23:01 -0600 | [diff] [blame] | 828 | * |
| 829 | * @root: Root node for expo description |
| 830 | * @expp: Returns the new expo |
| 831 | * Returns: 0 if OK, -ENOMEM if out of memory, -EINVAL if there is a format |
| 832 | * error, -ENOENT if there is a references to a non-existent string |
| 833 | */ |
| 834 | int expo_build(ofnode root, struct expo **expp); |
| 835 | |
Simon Glass | 3434420 | 2024-10-14 16:32:11 -0600 | [diff] [blame] | 836 | /** |
| 837 | * cb_expo_build() - Build an expo for coreboot CMOS RAM |
| 838 | * |
| 839 | * @expp: Returns the expo created |
| 840 | * Return: 0 if OK, -ve on error |
| 841 | */ |
| 842 | int cb_expo_build(struct expo **expp); |
| 843 | |
Simon Glass | 137b442 | 2025-05-02 08:46:16 -0600 | [diff] [blame] | 844 | /** |
| 845 | * expo_poll() - render an expo and see if the user takes an action |
| 846 | * |
| 847 | * Thsi calls expo_render() and then checks for a keypress. If there is one, it |
| 848 | * is processed and the resulting action returned, if any |
| 849 | * |
| 850 | * @exp: Expo to poll |
| 851 | * @act: Returns action on success |
| 852 | * Return: 0 if an action was obtained, -EAGAIN if not, other error if something |
| 853 | * went wrong |
| 854 | */ |
| 855 | int expo_poll(struct expo *exp, struct expo_action *act); |
| 856 | |
Simon Glass | 8df4a4e | 2023-08-14 16:40:25 -0600 | [diff] [blame] | 857 | #endif /*__EXPO_H */ |