diff options
author | Mary Ruthven <mruthven@chromium.org> | 2019-05-07 16:00:27 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-14 03:50:01 -0700 |
commit | 0775901e94904463328ded042bb53ee49d2c8c46 (patch) | |
tree | 00f3e121b12b9042b755477e9727b80b7351e3bb | |
parent | a05affa8514cb1b8ed324685ce23e9b665de13a4 (diff) | |
download | chrome-ec-0775901e94904463328ded042bb53ee49d2c8c46.tar.gz |
iteflash: use serial number to find the ccd device
There may be multiple ccd devices connected to the host. Use the serial
number to choose the correct device.
BUG=none
BRANCH=none
TEST=try to flash ampton with two CCD devices connected to the host
Change-Id: I1554e94f31b5582955ea25c19da2c3da98012e46
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1600502
Reviewed-by: Matthew Blecker <matthewb@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r-- | util/iteflash.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/util/iteflash.c b/util/iteflash.c index f0d110f19e..e66b01cf55 100644 --- a/util/iteflash.c +++ b/util/iteflash.c @@ -809,8 +809,9 @@ static int connect_to_ccd_i2c_bridge(struct common_hnd *chnd) { int rv; - rv = usb_findit(NULL, chnd->conf.usb_vid, chnd->conf.usb_pid, - CR50_I2C_SUBCLASS, CR50_I2C_PROTOCOL, &chnd->uep); + rv = usb_findit(chnd->conf.usb_serial, chnd->conf.usb_vid, + chnd->conf.usb_pid, CR50_I2C_SUBCLASS, + CR50_I2C_PROTOCOL, &chnd->uep); if (rv) { fprintf(stderr, "%s: usb_findit returned error %d\n", @@ -1662,15 +1663,9 @@ static int linux_i2c_interface_shutdown(struct common_hnd *chnd) static int ccd_i2c_interface_init(struct common_hnd *chnd) { - int ret; chnd->conf.usb_vid = CR50_USB_VID; chnd->conf.usb_pid = CR50_USB_PID; - ret = connect_to_ccd_i2c_bridge(chnd); - if (!ret) { - printf("Using CCD device%s\n", - chnd->conf.usb_serial ? ", ignoring serial number" : ""); - } - return ret; + return connect_to_ccd_i2c_bridge(chnd); } static int ccd_i2c_interface_shutdown(struct common_hnd *chnd) |