summaryrefslogtreecommitdiff
path: root/include/ec_commands.h
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-08-30 21:07:03 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-18 20:57:22 -0700
commit6b5a49ef15354c5b31be51f32006dbb4d7dc7c62 (patch)
tree7df76a93bfedaecdfda598278591a7411e3602f8 /include/ec_commands.h
parent13a7ae7b6fe5c67446adeb95256271547a0c777b (diff)
downloadchrome-ec-6b5a49ef15354c5b31be51f32006dbb4d7dc7c62.tar.gz
motion: Add Gesture Interface
Add an interface with the host to set up gesture recognition. Today, only significant motion is supported. Add a virtual sensor for concentrating gesture support from host. BRANCH=smaug BUG=b:23570481 TEST=On ryu, enable significant motion from host. Change-Id: I906fa2d2d7b4ca2771ea2f58b91de8d97bf4e2e3 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/296213
Diffstat (limited to 'include/ec_commands.h')
-rw-r--r--include/ec_commands.h48
1 files changed, 46 insertions, 2 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index e5520102c3..796f09eaea 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -862,7 +862,7 @@ struct ec_response_get_set_value {
uint32_t value;
} __packed;
-/* More than one command can use these structs to get/set paramters. */
+/* More than one command can use these structs to get/set parameters. */
#define EC_CMD_GSV_PAUSE_IN_S5 0x0c
/*****************************************************************************/
@@ -1701,6 +1701,18 @@ enum motionsense_command {
*/
MOTIONSENSE_CMD_SENSOR_OFFSET = 11,
+ /*
+ * List available activities for a MOTION sensor.
+ * Indicates if they are enabled or disabled.
+ */
+ MOTIONSENSE_CMD_LIST_ACTIVITIES = 12,
+
+ /*
+ * Activity management
+ * Enable/Disable activity recognition.
+ */
+ MOTIONSENSE_CMD_SET_ACTIVITY = 13,
+
/* Number of motionsense sub-commands. */
MOTIONSENSE_NUM_CMDS
};
@@ -1712,6 +1724,7 @@ enum motionsensor_type {
MOTIONSENSE_TYPE_MAG = 2,
MOTIONSENSE_TYPE_PROX = 3,
MOTIONSENSE_TYPE_LIGHT = 4,
+ MOTIONSENSE_TYPE_ACTIVITY = 5,
MOTIONSENSE_TYPE_MAX,
};
@@ -1745,6 +1758,11 @@ struct ec_response_motion_sensor_data {
uint16_t rsvd;
uint32_t timestamp;
} __packed;
+ struct {
+ uint8_t activity; /* motionsensor_activity */
+ uint8_t state;
+ int16_t add_info[2];
+ };
};
} __packed;
@@ -1765,6 +1783,21 @@ struct ec_response_motion_sense_fifo_data {
uint32_t number_data;
struct ec_response_motion_sensor_data data[0];
} __packed;
+
+/* List supported activity recognition */
+enum motionsensor_activity {
+ MOTIONSENSE_ACTIVITY_RESERVED = 0,
+ MOTIONSENSE_ACTIVITY_SIG_MOTION = 1,
+};
+
+struct ec_motion_sense_activity {
+ uint8_t sensor_num;
+ uint8_t activity; /* one of enum motionsensor_activity */
+ uint8_t enable; /* 1: enable, 0: disable */
+ uint8_t reserved;
+ uint16_t parameters[3]; /* activity dependent parameters */
+};
+
/* Module flag masks used for the dump sub-command. */
#define MOTIONSENSE_MODULE_FLAG_ACTIVE (1<<0)
@@ -1819,7 +1852,7 @@ struct ec_params_motion_sense {
* and MOTIONSENSE_CMD_PERFORM_CALIB. */
struct {
uint8_t sensor_num;
- } info, data, fifo_flush, perform_calib;
+ } info, data, fifo_flush, perform_calib, list_activities;
/*
* Used for MOTIONSENSE_CMD_EC_RATE, MOTIONSENSE_CMD_SENSOR_ODR
@@ -1878,6 +1911,8 @@ struct ec_params_motion_sense {
*/
uint32_t max_data_vector;
} fifo_read;
+
+ struct ec_motion_sense_activity set_activity;
};
} __packed;
@@ -1932,6 +1967,15 @@ struct ec_response_motion_sense {
struct ec_response_motion_sense_fifo_info fifo_info, fifo_flush;
struct ec_response_motion_sense_fifo_data fifo_read;
+
+ struct {
+ uint16_t reserved;
+ uint32_t enabled;
+ uint32_t disabled;
+ } __packed list_activities;
+
+ struct {
+ } set_activity;
};
} __packed;