diff options
author | Mohammed Habibulla <moch@chromium.org> | 2014-10-06 18:32:16 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-07 20:58:33 +0000 |
commit | 5c8da35f877323e5c79f96c1a24831784e6f4603 (patch) | |
tree | fb0c65cdaa91f4e341f46c3e0d693cd5c5ab543e /common/fan.c | |
parent | 7cde31850dfcfb6bfe8bfd94a09599c041b10409 (diff) | |
download | chrome-ec-5c8da35f877323e5c79f96c1a24831784e6f4603.tar.gz |
ectool: hostcmd support to set fans auto control individually
ectool autofanctrl 1 - set auto fan control for fan 1
BUG=chrome-os-partner:23803
TEST=Tested the above EC command on Auron
BRANCH=none
Change-Id: Idcd3690ad98d7965420f26f7cc445207fe73704d
Signed-off-by: Mohammed Habibulla <moch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221816
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/fan.c')
-rw-r--r-- | common/fan.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/common/fan.c b/common/fan.c index 96eb373ca0..db0b9a0d86 100644 --- a/common/fan.c +++ b/common/fan.c @@ -370,16 +370,26 @@ DECLARE_HOST_COMMAND(EC_CMD_PWM_SET_FAN_DUTY, static int hc_thermal_auto_fan_ctrl(struct host_cmd_handler_args *args) { int fan; + const struct ec_params_auto_fan_ctrl_v1 *p_v1 = args->params; - /* TODO(crosbug.com/p/23803) */ - for (fan = 0; fan < CONFIG_FANS; fan++) - set_thermal_control_enabled(fan, 1); + if (args->version == 0) { + for (fan = 0; fan < CONFIG_FANS; fan++) + set_thermal_control_enabled(fan, 1); + + return EC_RES_SUCCESS; + } + + fan = p_v1->fan_idx; + if (fan >= CONFIG_FANS) + return EC_RES_ERROR; + + set_thermal_control_enabled(fan, 1); return EC_RES_SUCCESS; } DECLARE_HOST_COMMAND(EC_CMD_THERMAL_AUTO_FAN_CTRL, hc_thermal_auto_fan_ctrl, - EC_VER_MASK(0)); + EC_VER_MASK(0)|EC_VER_MASK(1)); /*****************************************************************************/ |