summaryrefslogtreecommitdiff
path: root/util/comm-host.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2014-09-09 12:00:49 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-09-14 09:52:11 +0000
commitfab7ac3b9a5cc26927b8a40bbbba8049d64b323b (patch)
tree446e8aa1034f2f89a7c6fc248f918b308e6b5f46 /util/comm-host.c
parent9452186389651b83cee6731567f8f50776e0f19b (diff)
downloadchrome-ec-fab7ac3b9a5cc26927b8a40bbbba8049d64b323b.tar.gz
ectool: add new parameter to identify proper EC.
Add parameter name to identify which EC to talk to. Superseed --dev parameter, removed soon. --name cros_ec (the default): send commands to /dev/cros_ec. --name cros_pd: send commands to /dev/cros_pd. ... BUG=chrome-os-partner:31513 TEST=Tested on samus: check ectool --name cros_pd version returns proper data: ectool --name=cros_pd version RO version: samus_pd_v1.1.2079-8e4f9fc-dirt .... CQ-DEPEND=CL:217297 BRANCH=ToT Change-Id: Ie8b5c6c184d73a89b4445e88d6f104169176b9f3 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/217311 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'util/comm-host.c')
-rw-r--r--util/comm-host.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/util/comm-host.c b/util/comm-host.c
index a79a34a385..7da86316fb 100644
--- a/util/comm-host.c
+++ b/util/comm-host.c
@@ -23,7 +23,7 @@ void *ec_outbuf;
void *ec_inbuf;
static int command_offset;
-int comm_init_dev(void) __attribute__((weak));
+int comm_init_dev(const char *device_name) __attribute__((weak));
int comm_init_lpc(void) __attribute__((weak));
int comm_init_i2c(void) __attribute__((weak));
@@ -75,7 +75,7 @@ int ec_command(int command, int version,
indata, insize);
}
-int comm_init(int interfaces)
+int comm_init(int interfaces, const char *device_name)
{
struct ec_response_get_protocol_info info;
@@ -83,7 +83,8 @@ int comm_init(int interfaces)
ec_readmem = fake_readmem;
/* Prefer new /dev method */
- if ((interfaces & COMM_DEV) && comm_init_dev && !comm_init_dev())
+ if ((interfaces & COMM_DEV) && comm_init_dev &&
+ !comm_init_dev(device_name))
goto init_ok;
/* Fallback to direct LPC on x86 */