Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1535910

[PATCH 1/3] mfd: cros_ec: Add activity motion sense definitions

From Thierry Escande <thierry.escande@collabora.com>
Newsgroups linux.kernel
Subject [PATCH 1/3] mfd: cros_ec: Add activity motion sense definitions
Date 2016-12-05 10:20 +0100
Message-ID <sKXBg-2G5-39@gated-at.bofh.it> (permalink)
References <sKXBg-2G5-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Gwendal Grignou <gwendal@chromium.org>

This adds motion sense definitions to the commands header related to the
activity sensors attached behind the ChromeOS Embedded Controller.
Supported activities are MOTION and DOUBLE_TAP.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
---
 include/linux/mfd/cros_ec_commands.h | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h
index 1683003..80e6060 100644
--- a/include/linux/mfd/cros_ec_commands.h
+++ b/include/linux/mfd/cros_ec_commands.h
@@ -1417,6 +1417,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
 };
@@ -1494,6 +1506,21 @@ struct ec_response_motion_sensor_data {
 	};
 } __packed;
 
+/* List supported activity recognition */
+enum motionsensor_activity {
+	MOTIONSENSE_ACTIVITY_RESERVED = 0,
+	MOTIONSENSE_ACTIVITY_SIG_MOTION = 1,
+	MOTIONSENSE_ACTIVITY_DOUBLE_TAP = 2,
+};
+
+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 */
+};
+
 struct ec_params_motion_sense {
 	uint8_t cmd;
 	union {
@@ -1561,6 +1588,8 @@ struct ec_params_motion_sense {
 			/* Data to set or EC_MOTION_SENSE_NO_VALUE to read. */
 			int32_t data;
 		} sensor_odr, sensor_range;
+
+		struct ec_motion_sense_activity set_activity;
 	};
 } __packed;
 
@@ -1611,6 +1640,12 @@ struct ec_response_motion_sense {
 			int16_t temp;
 			int16_t offset[3];
 		} sensor_offset, perform_calib;
+
+		struct {
+			uint16_t reserved;
+			uint32_t enabled;
+			uint32_t disabled;
+		} __packed list_activities;
 	};
 } __packed;
 
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] Add ChromeOS EC Activity Sensors driver Thierry Escande <thierry.escande@collabora.com> - 2016-12-05 10:20 +0100
  [PATCH 1/3] mfd: cros_ec: Add activity motion sense definitions Thierry Escande <thierry.escande@collabora.com> - 2016-12-05 10:20 +0100
  [PATCH 3/3] iio: cros_ec_activity: add ChromeOS EC Activity Sensors Thierry Escande <thierry.escande@collabora.com> - 2016-12-05 10:20 +0100
    Re: [PATCH 3/3] iio: cros_ec_activity: add ChromeOS EC Activity  Sensors kbuild test robot <lkp@intel.com> - 2016-12-07 03:20 +0100
  [PATCH 2/3] iio: core: Add double tap as possible gesture Thierry Escande <thierry.escande@collabora.com> - 2016-12-05 10:20 +0100
    Re: [PATCH 2/3] iio: core: Add double tap as possible gesture Peter Meerwald-Stadler <pmeerw@pmeerw.net> - 2016-12-06 12:30 +0100

csiph-web