aboutsummaryrefslogtreecommitdiff
path: root/drivers/platform/chrome/cros_ec_proto.c
diff options
context:
space:
mode:
authorGravatar Tzung-Bi Shih <tzungbi@kernel.org> 2022-06-09 08:49:39 +0000
committerGravatar Tzung-Bi Shih <tzungbi@kernel.org> 2022-06-10 02:31:42 +0000
commit3db0c9e5de7bd9dbe52580eb9752b2b3049e38da (patch)
tree38850477a4626d83e2f7dcb0c11e301949be6149 /drivers/platform/chrome/cros_ec_proto.c
parentplatform/chrome: cros_ec_proto: add Kunit tests for cros_ec_query_all() (diff)
downloadlinux-3db0c9e5de7bd9dbe52580eb9752b2b3049e38da.tar.gz
linux-3db0c9e5de7bd9dbe52580eb9752b2b3049e38da.tar.bz2
linux-3db0c9e5de7bd9dbe52580eb9752b2b3049e38da.zip
platform/chrome: use macros for passthru indexes
Move passthru indexes for EC and PD devices to common header. Also use them instead of literal constants. Reviewed-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20220609084957.3684698-4-tzungbi@kernel.org
Diffstat (limited to 'drivers/platform/chrome/cros_ec_proto.c')
-rw-r--r--drivers/platform/chrome/cros_ec_proto.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c
index cefabfe45551..cfa3dacce4e5 100644
--- a/drivers/platform/chrome/cros_ec_proto.c
+++ b/drivers/platform/chrome/cros_ec_proto.c
@@ -433,7 +433,7 @@ int cros_ec_query_all(struct cros_ec_device *ec_dev)
/* First try sending with proto v3. */
ec_dev->proto_version = 3;
- ret = cros_ec_host_command_proto_query(ec_dev, 0, proto_msg);
+ ret = cros_ec_host_command_proto_query(ec_dev, CROS_EC_DEV_EC_INDEX, proto_msg);
if (ret == 0) {
proto_info = (struct ec_response_get_protocol_info *)
@@ -459,7 +459,7 @@ int cros_ec_query_all(struct cros_ec_device *ec_dev)
/*
* Check for PD
*/
- ret = cros_ec_host_command_proto_query(ec_dev, 1, proto_msg);
+ ret = cros_ec_host_command_proto_query(ec_dev, CROS_EC_DEV_PD_INDEX, proto_msg);
if (ret) {
dev_dbg(ec_dev->dev, "no PD chip found: %d\n", ret);
@@ -609,7 +609,7 @@ int cros_ec_cmd_xfer(struct cros_ec_device *ec_dev, struct cros_ec_command *msg)
msg->insize = ec_dev->max_response;
}
- if (msg->command < EC_CMD_PASSTHRU_OFFSET(1)) {
+ if (msg->command < EC_CMD_PASSTHRU_OFFSET(CROS_EC_DEV_PD_INDEX)) {
if (msg->outsize > ec_dev->max_request) {
dev_err(ec_dev->dev,
"request of size %u is too big (max: %u)\n",