platform/chrome: cros_ec_proto: separate cros_ec_wait_until_complete()
authorTzung-Bi Shih <tzungbi@kernel.org>
Mon, 18 Jul 2022 05:09:10 +0000 (05:09 +0000)
committerTzung-Bi Shih <tzungbi@kernel.org>
Wed, 20 Jul 2022 01:22:58 +0000 (01:22 +0000)
commit0aad9aff6a6450f7ea5e980add1b33d40e5bed52
tree139d6a5835a8dcc741fe168cd903d5de1470ddff
parent810be30d27bdfe7923084a5550dfddeed28ac08b
platform/chrome: cros_ec_proto: separate cros_ec_wait_until_complete()

EC returns EC_RES_IN_PROGRESS if the host command needs more time to
complete.  Whenever receives the return code, cros_ec_send_command()
sends EC_CMD_GET_COMMS_STATUS to query the command status.

Separate cros_ec_wait_until_complete() from cros_ec_send_command().
It sends EC_CMD_GET_COMMS_STATUS and waits until the previous command
was completed, or encountered error, or timed out.

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20220718050914.2267370-7-tzungbi@kernel.org
drivers/platform/chrome/cros_ec_proto.c