summaryrefslogtreecommitdiff
path: root/doc/develop
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-10-14 16:31:58 -0600
committerSimon Glass <[email protected]>2024-10-18 14:10:22 -0600
commit012e1e86523e3591ed5a986f894e207e1bcb32f1 (patch)
tree997dd98215123ff46ced04bd89858fbfb0a0dfb0 /doc/develop
parentd8ff97ce91529263c9d82a4bc00e133822673ab0 (diff)
expo: Allow menu items to have values
At present menu items are stored according to their sequence number in the menu. In some cases we may want to have holes in that sequence, or not use a sequence at all. Add a new 'value' property for menu items. This will be used for reading and writing, if present. If there is no 'value' property, then the normal sequence number will be used instead. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'doc/develop')
-rw-r--r--doc/develop/expo.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/develop/expo.rst b/doc/develop/expo.rst
index d8115c463c1..cc7c36173db 100644
--- a/doc/develop/expo.rst
+++ b/doc/develop/expo.rst
@@ -361,6 +361,13 @@ item-id
Specifies the ID for each menu item. These are used for checking which item
has been selected.
+item-value
+ type: u32 list, optional
+
+ Specifies the value for each menu item. These are used for saving and
+ loading. If this is omitted the value is its position in the menu (0..n-1).
+ Valid values are positive and negative integers INT_MIN...(INT_MAX - 1).
+
item-label / item-label-id
type: string list / u32 list, required
@@ -474,6 +481,9 @@ strings are provided inline in the nodes where they are used.
/* IDs for the menu items */
item-id = <ID_CPU_SPEED_1 ID_CPU_SPEED_2
ID_CPU_SPEED_3>;
+
+ /* values for the menu items */
+ item-value = <(-1) 3 6>;
};
power-loss {