diff options
author | Jett Rink <jettrink@chromium.org> | 2019-05-08 07:34:00 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-23 00:12:21 +0000 |
commit | 0237cc790983b9fa4159963ec6ee2feab5a7f512 (patch) | |
tree | 56c0dfc524d54ebdc96d4dd226d87ed07b2a5835 /include | |
parent | 4a538f82eb1225afc44e612b1fec46506c0e1efb (diff) | |
download | chrome-ec-0237cc790983b9fa4159963ec6ee2feab5a7f512.tar.gz |
i2c: add i2clookup host command
Add a new host command that will allow you to lookup a well known device
on the EC. This is useful for FAFT tests that want to talk directly
with i2c devices but don't know the physical address for each platform.
BRANCH=octopus
BUG=b:119065537
TEST=Used this with new faft test in CL:1601300
Change-Id: I82c2d5462fcb4edbc92ea60765971190fed7ae81
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1601060
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1767514
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Tested-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/ec_commands.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h index a23f2f712b..a924f5aceb 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -5150,6 +5150,35 @@ struct ec_response_adc_read { } __ec_align4; /*****************************************************************************/ +/* I2C lookup command + * + * Return values: + * EC_RES_UNAVAILABLE: Lookup type is supported but not present on system. + * EC_RES_INVALID_PARAM: The type was unrecognized. + */ + +#define EC_CMD_I2C_LOOKUP 0x0126 + +enum i2c_device_type { + I2C_LOOKUP_TYPE_CBI_EEPROM = 1, + I2C_LOOKUP_TYPE_COUNT, + I2C_LOOKUP_TYPE_MAX = 0xFFFF, +}; + +struct ec_params_i2c_lookup { + uint16_t type; /* enum i2c_device_type */ + /* Used for type specific parameters in future */ + union { + uint16_t reseved; + }; +} __ec_align2; + +struct ec_response_i2c_lookup { + uint16_t i2c_port; /* Physical port for device */ + uint16_t i2c_addr; /* 7-bit (or 10-bit) address */ +} __ec_align1; + +/*****************************************************************************/ /* The command range 0x200-0x2FF is reserved for Rotor. */ /*****************************************************************************/ |