common: add feature bit for touchpad support

Add a new 'feature' bit to allow the host to auto-detect a TP MCU.

Signed-off-by: Wei-Ning Huang <wnhuang@google.com>

BRANCH=none
BUG=b:37584134
TEST=on eve with TP connected, look at the feature bit.

Change-Id: I81b30b96b31fc8dcb6769dd146fb33cdd487fddf
Reviewed-on: https://chromium-review.googlesource.com/485422
Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org>
Tested-by: Wei-Ning Huang <wnhuang@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
This commit is contained in:
Wei-Ning Huang
2017-04-22 21:00:54 +08:00
committed by chrome-bot
parent ba105838f5
commit a12bf17be9
3 changed files with 6 additions and 0 deletions

View File

@@ -789,6 +789,9 @@ static int host_command_get_features(struct host_cmd_handler_args *args)
#endif
#ifdef CONFIG_SPI_FP_PORT
| EC_FEATURE_MASK_0(EC_FEATURE_FINGERPRINT)
#endif
#ifdef HAS_TASK_CENTROIDING
| EC_FEATURE_MASK_0(EC_FEATURE_TOUCHPAD)
#endif
;
return EC_RES_SUCCESS;

View File

@@ -1078,6 +1078,8 @@ enum ec_feature_code {
EC_FEATURE_RTC = 27,
/* The MCU exposes a Fingerprint sensor */
EC_FEATURE_FINGERPRINT = 28,
/* The MCU exposes a Touchpad */
EC_FEATURE_TOUCHPAD = 29,
};
#define EC_FEATURE_MASK_0(event_code) (1UL << (event_code % 32))

View File

@@ -512,6 +512,7 @@ static const char * const ec_feature_names[] = {
[EC_FEATURE_VSTORE] = "Temporary secure vstore",
[EC_FEATURE_USBC_SS_MUX_VIRTUAL] = "Host-controlled USB-C SS mux",
[EC_FEATURE_RTC] = "Real-time clock",
[EC_FEATURE_TOUCHPAD] = "Touchpad",
};
int cmd_inventory(int argc, char *argv[])