summaryrefslogtreecommitdiff
path: root/util/comm-host.h
diff options
context:
space:
mode:
authorHarry Cutts <hcutts@chromium.org>2019-09-25 11:20:20 -0700
committerCommit Bot <commit-bot@chromium.org>2019-10-04 06:59:27 +0000
commit5f7e4c337dae601208f308efba15ad6d9ffbe788 (patch)
treedd88337d1ede373e381fad8c6c0df91634871890 /util/comm-host.h
parent2ee2d6fe8711f51343bb08e0fde599c2643c93e6 (diff)
downloadchrome-ec-5f7e4c337dae601208f308efba15ad6d9ffbe788.tar.gz
util/comm-i2c: Add switch to specify I2C bus
Currently, devices running CrOS EC that aren't actually the embedded controller (such as touchpad or fingerprint MCUs) can only be contacted over I2C if they are in the device tree. To avoid having to recompile the Kernel, Coreboot, or `ectool`, the `--i2c_bus` switch allows `ectool` to be used for testing as-is. BRANCH=none BUG=none TEST=Checked various commands (hello, version, inventory...) with `--i2c_bus=7`, connecting to a MAX32660. Verified that a contradictory `--interface` switch is rejected. Checked that invalid bus numbers (≥32) are rejected. Change-Id: I92f3307bbbdf88978b9f8271610a3ae222279767 Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1828064 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'util/comm-host.h')
-rw-r--r--util/comm-host.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/comm-host.h b/util/comm-host.h
index 603f95e107..309c97eeb5 100644
--- a/util/comm-host.h
+++ b/util/comm-host.h
@@ -39,9 +39,10 @@ enum comm_interface {
*
* @param interfaces Interfaces to try; use COMM_ALL to try all of them.
* @param device_name For DEV option, the device file to use.
+ * @param i2c_bus For I2C option, the bus number to use (or -1 to autodetect).
* @return 0 in case of success, or error code.
*/
-int comm_init_alt(int interfaces, const char *device_name);
+int comm_init_alt(int interfaces, const char *device_name, int i2c_bus);
/**
* Initialize dev interface