From 012e1e86523e3591ed5a986f894e207e1bcb32f1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 14 Oct 2024 16:31:58 -0600 Subject: 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 --- test/boot/expo.c | 1 + test/boot/files/expo_layout.dts | 3 +++ 2 files changed, 4 insertions(+) (limited to 'test') diff --git a/test/boot/expo.c b/test/boot/expo.c index b0bf2988bf0..1c2e746decc 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -717,6 +717,7 @@ static int expo_test_build(struct unit_test_state *uts) ut_asserteq(0, item->desc_id); ut_asserteq(0, item->preview_id); ut_asserteq(0, item->flags); + ut_asserteq(0, item->value); txt = scene_obj_find(scn, item->label_id, SCENEOBJT_NONE); ut_asserteq_str("2 GHz", expo_get_str(exp, txt->str_id)); diff --git a/test/boot/files/expo_layout.dts b/test/boot/files/expo_layout.dts index bed552288f4..ebe5adb27bb 100644 --- a/test/boot/files/expo_layout.dts +++ b/test/boot/files/expo_layout.dts @@ -39,6 +39,9 @@ item-id = ; + /* values for the menu items */ + item-value = <(-1) 3 6>; + start-bit = <0x400>; bit-length = <2>; }; -- cgit v1.3.1