1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright 2023 Google LLC
11 #include <dm/ofnode_decl.h>
12 #include <linux/types.h>
21 /* size increment for writing FDT */
22 CEDIT_SIZE_INC = 1024,
25 /* Name of the cedit node in the devicetree */
26 #define CEDIT_NODE_NAME "cedit-values"
28 extern struct expo *cur_exp;
31 * cedit_arange() - Arrange objects in a configuration-editor scene
33 * @exp: Expo to update
34 * @vid_priv: Private info of the video device
35 * @scene_id: scene ID to arrange
36 * Returns: 0 if OK, -ve on error
38 int cedit_arange(struct expo *exp, struct video_priv *vid_priv, uint scene_id);
41 * cedit_run() - Run a configuration editor
43 * This accepts input until the user quits with Escape
46 * Returns: 0 if OK, -ve on error
48 int cedit_run(struct expo *exp);
51 * cedit_prepare() - Prepare to run a cedit
53 * Set up the video device, select the first scene and highlight the first item.
54 * This ensures that all menus have a selected item.
57 * @vid_privp: Set to private data for the video device
58 * @scnp: Set to the first scene
59 * Return: scene ID of first scene if OK, -ve on error
61 int cedit_prepare(struct expo *exp, struct video_priv **vid_privp,
65 * cedit_write_settings() - Write settings in FDT format
67 * Sets up an FDT with the settings
69 * @exp: Expo to write settings from
70 * @buf: Returns abuf containing the settings FDT (inited by this function)
71 * Return: 0 if OK, -ve on error
73 int cedit_write_settings(struct expo *exp, struct abuf *buf);
76 * cedit_read_settings() - Read settings in FDT format
78 * Read an FDT with the settings
80 * @exp: Expo to read settings into
81 * @tree: Tree to read from
82 * Return: 0 if OK, -ve on error
84 int cedit_read_settings(struct expo *exp, oftree tree);
87 * cedit_write_settings_env() - Write settings to envrionment variables
89 * @exp: Expo to write settings from
90 * @verbose: true to print each var as it is set
91 * Return: 0 if OK, -ve on error
93 int cedit_write_settings_env(struct expo *exp, bool verbose);
96 * cedit_read_settings_env() - Read settings from the environment
98 * @exp: Expo to read settings into
99 * @verbose: true to print each var before it is read
101 int cedit_read_settings_env(struct expo *exp, bool verbose);
104 * cedit_write_settings_cmos() - Write settings to CMOS RAM
106 * Write settings to the defined places in CMOS RAM
108 * @exp: Expo to write settings from
109 * @dev: UCLASS_RTC device containing space for this information
110 * Returns 0 if OK, -ve on error
111 * @verbose: true to print a summary at the end
113 int cedit_write_settings_cmos(struct expo *exp, struct udevice *dev,
117 * cedit_read_settings_cmos() - Read settings from CMOS RAM
119 * Read settings from the defined places in CMO RAM
121 * @exp: Expo to read settings into
122 * @dev: RTC device to read settings from
123 * @verbose: true to print a summary at the end
125 int cedit_read_settings_cmos(struct expo *exp, struct udevice *dev,
128 #endif /* __CEDIT_H */