diff options
-rw-r--r-- | futility/cmd_update.c | 11 | ||||
-rw-r--r-- | futility/updater_utils.c | 11 | ||||
-rw-r--r-- | futility/updater_utils.h | 7 |
3 files changed, 18 insertions, 11 deletions
diff --git a/futility/cmd_update.c b/futility/cmd_update.c index d501aca2..2f34c556 100644 --- a/futility/cmd_update.c +++ b/futility/cmd_update.c @@ -148,17 +148,6 @@ static void print_help(int argc, char *argv[]) argv[0]); } -static void prepare_servo_control(const char *control_name, int on) -{ - char *cmd; - if (!control_name) - return; - - ASPRINTF(&cmd, "dut-control %s:%s", control_name, on ? "on" : "off"); - free(host_shell(cmd)); - free(cmd); -} - static int do_update(int argc, char *argv[]) { struct updater_config *cfg; diff --git a/futility/updater_utils.c b/futility/updater_utils.c index cc60ee8a..883b7027 100644 --- a/futility/updater_utils.c +++ b/futility/updater_utils.c @@ -430,6 +430,17 @@ static int host_get_platform_version(void) return VbGetSystemPropertyInt("board_id"); } +void prepare_servo_control(const char *control_name, int on) +{ + char *cmd; + if (!control_name) + return; + + ASPRINTF(&cmd, "dut-control %s:%s", control_name, on ? "on" : "off"); + free(host_shell(cmd)); + free(cmd); +} + /* * Helper function to detect type of Servo board attached to host. * Returns a string as programmer parameter on success, otherwise NULL. diff --git a/futility/updater_utils.h b/futility/updater_utils.h index 43e23a1e..953b91f0 100644 --- a/futility/updater_utils.h +++ b/futility/updater_utils.h @@ -194,6 +194,13 @@ char *host_shell(const char *command); char *host_detect_servo(const char **prepare_ctrl_name); /* + * Makes a dut-control request for control_name. + * Sets control_name to "on" if on is non zero, else "off". + * Does not check for failure. + */ +void prepare_servo_control(const char *control_name, int on); + +/* * Returns 1 if a given file (cbfs_entry_name) exists inside a particular CBFS * section of an image file, otherwise 0. */ |