platform/chrome: cros_ec_proto: Update cros_ec_cmd_xfer() call-sites
authorPrashant Malani <pmalani@chromium.org>
Mon, 21 Sep 2020 08:51:58 +0000 (10:51 +0200)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Mon, 21 Sep 2020 08:51:58 +0000 (10:51 +0200)
commit64b02e54e50fea8ebe0a2b2dc37ea096d0030cc5
treec7d05a6144aafa25f0d603e827dc324c93bdfaeb
parentdd92f7dfe1ba3bad556c8a529edacce7c6fd0195
platform/chrome: cros_ec_proto: Update cros_ec_cmd_xfer() call-sites

Since all the other call-sites of cros_ec_cmd_xfer() have been converted
to use cros_ec_cmd_xfer_status() instead, update the remaining
call-sites to prepare for the merge of cros_ec_cmd_xfer() into
cros_ec_cmd_xfer_status().

As part of this update, change the error handling inside
cros_ec_get_sensor_count() such that the legacy LPC interface is tried
on all error values, not just when msg->result != EC_RESULT_SUCCESS.

Note that there is a slight change in API in cros_ec_get_sensor_count():
it will return a negative number of sensors when there are no sensors
on arm platform when MOTIONSENSE_CMD_DUMP is not supported (typical for
sensorless chromebook) instead of 0. However, this is not a problem when
probing the EC as we ignore errors only looking for cros_ec_get_sensor_count()
returning a positive number of sensors.

Signed-off-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
drivers/platform/chrome/cros_ec_proto.c