expo: Allow setting the start of the dynamic-ID range
Provide a way to set this value so that it is easy to separate the
statically allocated IDs (generated by the caller) from those
generated dynamically by expo itself.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/boot/expo.c b/boot/expo.c
index 8b966b6..be11cfd 100644
--- a/boot/expo.c
+++ b/boot/expo.c
@@ -56,6 +56,21 @@
free(exp);
}
+uint resolve_id(struct expo *exp, uint id)
+{
+ if (!id)
+ id = exp->next_id++;
+ else if (id >= exp->next_id)
+ exp->next_id = id + 1;
+
+ return id;
+}
+
+void expo_set_dynamic_start(struct expo *exp, uint dyn_start)
+{
+ exp->next_id = dyn_start;
+}
+
int expo_str(struct expo *exp, const char *name, uint id, const char *str)
{
struct expo_string *estr;
diff --git a/boot/scene.c b/boot/scene.c
index 43c978e..2ac9bfc 100644
--- a/boot/scene.c
+++ b/boot/scene.c
@@ -18,16 +18,6 @@
#include <linux/input.h>
#include "scene_internal.h"
-uint resolve_id(struct expo *exp, uint id)
-{
- if (!id)
- id = exp->next_id++;
- else if (id >= exp->next_id)
- exp->next_id = id + 1;
-
- return id;
-}
-
int scene_new(struct expo *exp, const char *name, uint id, struct scene **scnp)
{
struct scene *scn;