summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-07-22 12:24:14 -0700
committerGerrit <chrome-bot@google.com>2012-07-22 13:17:03 -0700
commit5fdf655b12f161f69b28e75f285a99f08a97d5f9 (patch)
tree34f7b6c18225c764ee22b4af9100e106a654d547
parentfbfc353cefa63b75a3e47e703b2eb47bac32d8f4 (diff)
downloadchrome-ec-5fdf655b12f161f69b28e75f285a99f08a97d5f9.tar.gz
Revert "i2c: Move host command processing into a function"
This reverts commit b2772df970e422e7e31731d38813ee57635c8058 Dependent on reverted change. Change-Id: I353bc6826033c0681394f0c49701dd5678422a0c Reviewed-on: https://gerrit.chromium.org/gerrit/28137 Commit-Ready: Randall Spangler <rspangler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--chip/stm32/i2c.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/chip/stm32/i2c.c b/chip/stm32/i2c.c
index 31c5174c55..248eed7237 100644
--- a/chip/stm32/i2c.c
+++ b/chip/stm32/i2c.c
@@ -141,23 +141,6 @@ static void i2c_send_response(struct host_cmd_handler_args *args)
i2c_write_raw(I2C2, host_buffer, out - host_buffer);
}
-/* Process the command in the i2c host buffer */
-static void i2c_process_command(void)
-{
- /* we have an available command : execute it */
- host_cmd_args.command = host_buffer[0];
- host_cmd_args.result = EC_RES_SUCCESS;
- host_cmd_args.send_response = i2c_send_response;
- host_cmd_args.version = 0;
- host_cmd_args.params = host_buffer + 1;
- host_cmd_args.params_size = EC_HOST_PARAM_SIZE;
- /* skip room for error code */
- host_cmd_args.response = host_buffer + 1;
- host_cmd_args.response_max = EC_HOST_PARAM_SIZE;
- host_cmd_args.response_size = 0;
- host_command_received(&host_cmd_args);
-}
-
static void i2c_event_handler(int port)
{
@@ -191,7 +174,19 @@ static void i2c_event_handler(int port)
if (i2c_sr1[port] & (1 << 7)) {
if (port == I2C2) { /* AP is waiting for EC response */
if (rx_index) {
- i2c_process_command();
+ /* we have an available command : execute it */
+ host_cmd_args.command = host_buffer[0];
+ host_cmd_args.result = EC_RES_SUCCESS;
+ host_cmd_args.send_response =
+ i2c_send_response;
+ host_cmd_args.version = 0;
+ host_cmd_args.params = host_buffer + 1;
+ host_cmd_args.params_size = EC_HOST_PARAM_SIZE;
+ /* skip room for error code */
+ host_cmd_args.response = host_buffer + 1;
+ host_cmd_args.response_max = EC_HOST_PARAM_SIZE;
+ host_cmd_args.response_size = 0;
+ host_command_received(&host_cmd_args);
/* reset host buffer after end of transfer */
rx_index = 0;
} else {