summaryrefslogtreecommitdiff
path: root/common/dptf.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2017-02-09 11:46:46 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-14 14:50:36 -0800
commit9bd9279f369d913dc6334ee09452c2efe7e9d3ae (patch)
treef209652ac951ed6f45f93096296084d403e24326 /common/dptf.c
parent47e60b44bdcd17a2414276802f74faac720c5ecb (diff)
downloadchrome-ec-9bd9279f369d913dc6334ee09452c2efe7e9d3ae.tar.gz
eve: Move DPTF tablet mode support to common code
Enable ACPI to retrieve the tablet mode switch status. BUG=chrome-os-partner:62223 BRANCH=eve TEST=With evtest, check we receive tablet switch event. ... /dev/input/event4: Tablet Mode Switch ... Supported events: Event type 0 (EV_SYN) Event type 5 (EV_SW) Event code 1 (SW_TABLET_MODE) Properties: Testing ... (interrupt to exit) Event: time 1486670351.311647, type 5 (EV_SW), code 1 (SW_TABLET_MODE), value 1 Event: time 1486670351.311647, -------------- SYN_REPORT ------------ Event: time 1486670352.574079, type 5 (EV_SW), code 1 (SW_TABLET_MODE), value 0 Event: time 1486670352.574079, -------------- SYN_REPORT ------------ ... Change-Id: I5db6aa2c113bbd2b8e8d8fe0c55551e1edac0c79 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/440405 Commit-Ready: Duncan Laurie <dlaurie@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/dptf.c')
-rw-r--r--common/dptf.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/common/dptf.c b/common/dptf.c
index 23e597bec9..6833356dec 100644
--- a/common/dptf.c
+++ b/common/dptf.c
@@ -103,6 +103,19 @@ void dptf_set_temp_threshold(int sensor_id, int temp, int idx, int enable)
}
}
+#ifdef CONFIG_DPTF_DEVICE_ORIENTATION
+/*
+ * When tablet mode changes, send an event to ACPI to retrieve
+ * tablet mode value and send an event to the kernel.
+ */
+static void dptf_tablet_mode_changed(void)
+{
+ host_set_single_event(EC_HOST_EVENT_MODE_CHANGE);
+}
+DECLARE_HOOK(HOOK_TABLET_MODE_CHANGE, dptf_tablet_mode_changed,
+ HOOK_PRIO_DEFAULT);
+#endif
+
/*****************************************************************************/
/* EC-specific thermal controls */