aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass2023-06-01 10:23:01 -0600
committerTom Rini2023-07-14 12:54:51 -0400
commit82cafee133ee5c087449761988c096fc26a17cf6 (patch)
tree8558fb8f832174e54cc1ed454b163e3b870b36ff /include
parent7230fdb3837ad745adff4cf129dd04e893fe0a36 (diff)
expo: Support building an expo from a description file
The only way to create an expo at present is by calling the functions to create each object. It is useful to have more data-driven approach, where the objects can be specified in a suitable file format and created from that. This makes testing easier as well. Add support for describing an expo in a devicetree node. This allows more complex tests to be set up, as well as providing an easier format for users. It also provides a better basis for the upcoming configuration editor. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/expo.h14
-rw-r--r--include/test/cedit-test.h29
2 files changed, 43 insertions, 0 deletions
diff --git a/include/expo.h b/include/expo.h
index f7febe1c9ae..9fec4d0cd84 100644
--- a/include/expo.h
+++ b/include/expo.h
@@ -653,4 +653,18 @@ int expo_action_get(struct expo *exp, struct expo_action *act);
*/
int expo_apply_theme(struct expo *exp, ofnode node);
+/**
+ * expo_build() - Build an expo from an FDT description
+ *
+ * Build a complete expo from a description in the provided devicetree.
+ *
+ * See doc/developer/expo.rst for a description of the format
+ *
+ * @root: Root node for expo description
+ * @expp: Returns the new expo
+ * Returns: 0 if OK, -ENOMEM if out of memory, -EINVAL if there is a format
+ * error, -ENOENT if there is a references to a non-existent string
+ */
+int expo_build(ofnode root, struct expo **expp);
+
#endif /*__SCENE_H */
diff --git a/include/test/cedit-test.h b/include/test/cedit-test.h
new file mode 100644
index 00000000000..349df75b16d
--- /dev/null
+++ b/include/test/cedit-test.h
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Binding shared between cedit.dtsi and test/boot/expo.c
+ *
+ * Copyright 2023 Google LLC
+ * Written by Simon Glass <sjg@chromium.org>
+ */
+
+#ifndef __cedit_test_h
+#define __cedit_test_h
+
+#define ID_PROMPT 1
+#define ID_SCENE1 2
+#define ID_SCENE1_TITLE 3
+
+#define ID_CPU_SPEED 4
+#define ID_CPU_SPEED_TITLE 5
+#define ID_CPU_SPEED_1 6
+#define ID_CPU_SPEED_2 7
+#define ID_CPU_SPEED_3 8
+
+#define ID_POWER_LOSS 9
+#define ID_AC_OFF 10
+#define ID_AC_ON 11
+#define ID_AC_MEMORY 12
+
+#define ID_DYNAMIC_START 13
+
+#endif