diff options
Diffstat (limited to 'arch/sandbox')
-rw-r--r-- | arch/sandbox/cpu/sdl.c | 3 | ||||
-rw-r--r-- | arch/sandbox/dts/cedit.dtsi | 64 | ||||
-rw-r--r-- | arch/sandbox/dts/sandbox.dtsi | 6 | ||||
-rw-r--r-- | arch/sandbox/dts/test.dts | 13 |
4 files changed, 85 insertions, 1 deletions
diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c index 2c570ed8d16..590e406517b 100644 --- a/arch/sandbox/cpu/sdl.c +++ b/arch/sandbox/cpu/sdl.c @@ -6,6 +6,7 @@ #include <errno.h> #include <unistd.h> #include <stdbool.h> +#include <sysreset.h> #include <linux/input.h> #include <SDL2/SDL.h> #include <asm/state.h> @@ -81,7 +82,7 @@ static void sandbox_sdl_poll_events(void) switch (event.type) { case SDL_QUIT: puts("LCD window closed - quitting\n"); - reset_cpu(); + sysreset_walk(SYSRESET_POWER_OFF); break; } } diff --git a/arch/sandbox/dts/cedit.dtsi b/arch/sandbox/dts/cedit.dtsi new file mode 100644 index 00000000000..a9eb4c2d594 --- /dev/null +++ b/arch/sandbox/dts/cedit.dtsi @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Expo definition for the configuration editor + * + * This used for testing building an expo from a data file. This devicetree + * provides a description of the objects to be created. + */ + +#include <test/cedit-test.h> + +&cedit { + dynamic-start = <ID_DYNAMIC_START>; + + scenes { + main { + id = <ID_SCENE1>; + + /* value refers to the matching id in /strings */ + title-id = <ID_SCENE1_TITLE>; + + /* simple string is used as it is */ + prompt = "UP and DOWN to choose, ENTER to select"; + + /* defines a menu within the scene */ + cpu-speed { + type = "menu"; + id = <ID_CPU_SPEED>; + + /* + * has both string and ID. The string is ignored + * if the ID is present and points to a string + */ + title = "CPU speed"; + title-id = <ID_CPU_SPEED_TITLE>; + + /* menu items as simple strings */ + item-label = "2 GHz", "2.5 GHz", "3 GHz"; + + /* IDs for the menu items */ + item-id = <ID_CPU_SPEED_1 ID_CPU_SPEED_2 + ID_CPU_SPEED_3>; + }; + + power-loss { + type = "menu"; + id = <ID_POWER_LOSS>; + + title = "AC Power"; + item-label = "Always Off", "Always On", + "Memory"; + + item-id = <ID_AC_OFF ID_AC_ON ID_AC_MEMORY>; + }; + }; + }; + + strings { + title { + id = <ID_SCENE1_TITLE>; + value = "Test Configuration"; + value-es = "configuración de prueba"; + }; + }; +}; diff --git a/arch/sandbox/dts/sandbox.dtsi b/arch/sandbox/dts/sandbox.dtsi index 30a305c4d20..f0ee0b3481a 100644 --- a/arch/sandbox/dts/sandbox.dtsi +++ b/arch/sandbox/dts/sandbox.dtsi @@ -16,6 +16,12 @@ stdout-path = "/serial"; }; + cedit-theme { + font-size = <30>; + menu-inset = <3>; + menuitem-gap-y = <1>; + }; + alarm_wdt: alarm-wdt { compatible = "sandbox,alarm-wdt"; timeout-sec = <5>; diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index ff9f9222e6f..b5509eee8cf 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -96,6 +96,8 @@ theme { font-size = <30>; + menu-inset = <3>; + menuitem-gap-y = <1>; }; /* @@ -139,6 +141,15 @@ }; }; + cedit: cedit { + }; + + cedit-theme { + font-size = <30>; + menu-inset = <3>; + menuitem-gap-y = <1>; + }; + fuzzing-engine { compatible = "sandbox,fuzzing-engine"; }; @@ -1828,3 +1839,5 @@ #ifdef CONFIG_SANDBOX_VPL #include "sandbox_vpl.dtsi" #endif + +#include "cedit.dtsi" |