diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-05-10 22:47:11 +0000 |
---|---|---|
committer | Vincent Palatin <vpalatin@chromium.org> | 2012-05-14 23:33:21 +0000 |
commit | 87d3707f62c14376f9c5013e455544bf32d0fb33 (patch) | |
tree | a3f88652a3961a51299e4d71605b5e12fb772afd /common/thermal_commands.c | |
parent | 805299d838c996c1a96b9808214d742ea28eb707 (diff) | |
download | chrome-ec-87d3707f62c14376f9c5013e455544bf32d0fb33.tar.gz |
Slightly update the host commands API
Preparatory work to use common host command code between ARM and x86.
Every command sends back explicitly the size of the response payload.
The size of the response defaults to 0 ond can be updated.
Add a protocol version number returned as command 0x00 to help with
backward compatibility.
move a couple of function from lpc specific header to host commands to
be able to implement them for the I2C link.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:9614
TEST=make BOARD=link
Change-Id: I6a28edf02996ddf6b7f32a3831d07d5f0271848f
Diffstat (limited to 'common/thermal_commands.c')
-rw-r--r-- | common/thermal_commands.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/thermal_commands.c b/common/thermal_commands.c index e3be7429ab..f3476f8348 100644 --- a/common/thermal_commands.c +++ b/common/thermal_commands.c @@ -9,7 +9,7 @@ #include "thermal.h" -enum lpc_status thermal_command_set_threshold(uint8_t *data) +int thermal_command_set_threshold(uint8_t *data, int *resp_size) { struct lpc_params_thermal_set_threshold *p = (struct lpc_params_thermal_set_threshold *)data; @@ -22,7 +22,7 @@ DECLARE_HOST_COMMAND(EC_LPC_COMMAND_THERMAL_SET_THRESHOLD, thermal_command_set_threshold); -enum lpc_status thermal_command_get_threshold(uint8_t *data) +int thermal_command_get_threshold(uint8_t *data, int *resp_size) { struct lpc_params_thermal_get_threshold *p = (struct lpc_params_thermal_get_threshold *)data; @@ -33,13 +33,14 @@ enum lpc_status thermal_command_get_threshold(uint8_t *data) if (r->value == -1) return EC_LPC_RESULT_ERROR; + *resp_size = sizeof(struct lpc_response_thermal_get_threshold); return EC_LPC_RESULT_SUCCESS; } DECLARE_HOST_COMMAND(EC_LPC_COMMAND_THERMAL_GET_THRESHOLD, thermal_command_get_threshold); -enum lpc_status thermal_command_auto_fan_ctrl(uint8_t *data) +int thermal_command_auto_fan_ctrl(uint8_t *data, int *resp_size) { if (thermal_toggle_auto_fan_ctrl(1)) return EC_LPC_RESULT_ERROR; |