summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2016-11-02 15:57:47 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-11-04 04:54:20 -0700
commitcbae8f9b321f33734a34cb85c82636bbfa7663ee (patch)
treea754d8be330873cb746733423b6d615e6d44ebd9 /power
parentb8c1ce6700ba9e467f4b6a42cac5ceb3aacdd1db (diff)
downloadchrome-ec-cbae8f9b321f33734a34cb85c82636bbfa7663ee.tar.gz
kevin: Add Sensor in S3, disable keyboard wakeup in tablet mode.
Let sensor be powered on in S3. It is useful for Android and if we want to disable keyboard wakeup based on lid angle. Allow EC to disable touchpad and not send keyboard events when lid angle is greater than 180. BUG=chrome-os-partner:57510,chromium:620633 BRANCH=gru TEST=In S3, check the sensors are readable. Check that when in S3 and lid angle is < 180 EC sends keyboard events. Check that when in S3 and lid angle is > 180 EC does not send keyboard events. Change-Id: I4e7959ed37bc5dfdf9c105ecae94c314b253d77f Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/406739 Commit-Ready: Gwendal Grignou <gwendal@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/rk3399.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/power/rk3399.c b/power/rk3399.c
index 7352af8efc..1b6916c06d 100644
--- a/power/rk3399.c
+++ b/power/rk3399.c
@@ -224,6 +224,10 @@ enum power_state power_handle_state(enum power_state state)
msleep(1);
gpio_set_level(GPIO_PP1800_LID_EN_L, 0);
+ gpio_set_level(GPIO_PP1800_SIXAXIS_EN_L, 0);
+ msleep(2);
+ gpio_set_level(GPIO_PP1800_SENSOR_EN_L, 0);
+
/*
* TODO: Consider ADC_PP900_AP / ADC_PP1200_LPDDR analog
* voltage levels for state transition.
@@ -260,10 +264,6 @@ enum power_state power_handle_state(enum power_state state)
sys_reset_asserted = 0;
}
- gpio_set_level(GPIO_PP1800_SIXAXIS_EN_L, 0);
- msleep(2);
- gpio_set_level(GPIO_PP1800_SENSOR_EN_L, 0);
-
if (power_wait_signals(IN_PGOOD_S0)) {
chipset_force_shutdown();
return POWER_S3S0;
@@ -286,8 +286,6 @@ enum power_state power_handle_state(enum power_state state)
hook_notify(HOOK_CHIPSET_SUSPEND);
MSLEEP_CHECK_ABORTED_SUSPEND(20);
- gpio_set_level(GPIO_PP1800_SENSOR_EN_L, 1);
- gpio_set_level(GPIO_PP1800_SIXAXIS_EN_L, 1);
gpio_set_level(GPIO_PP3300_S0_EN_L, 1);
MSLEEP_CHECK_ABORTED_SUSPEND(20);
@@ -326,6 +324,8 @@ enum power_state power_handle_state(enum power_state state)
/* Call hooks before we remove power rails */
hook_notify(HOOK_CHIPSET_SHUTDOWN);
+ gpio_set_level(GPIO_PP1800_SENSOR_EN_L, 1);
+ gpio_set_level(GPIO_PP1800_SIXAXIS_EN_L, 1);
gpio_set_level(GPIO_PP1800_LID_EN_L, 1);
gpio_set_level(GPIO_PP3300_TRACKPAD_EN_L, 1);
gpio_set_level(GPIO_PP5000_EN, 0);