summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorRong Chang <rongchang@chromium.org>2016-03-08 16:57:37 +0800
committerchrome-bot <chrome-bot@chromium.org>2016-04-14 03:43:09 -0700
commit8d2aac6bef0307dfcb0c48eb3d04e7d843764731 (patch)
treec9987f5853b01c4775bb805137d2bd54d129762c /power
parentfc33f2b96b4924a28b66f700ab966cb2a3ec921d (diff)
downloadchrome-ec-8d2aac6bef0307dfcb0c48eb3d04e7d843764731.tar.gz
elm: initial elm mainboard
Elm is an oak variant that uses ANX7688 PD port controller. This CL sets PD port count to 1 and modifies TCPC I2C address to 0x50. Other elm changes are included in this change: - add 2 KX022 motion sensors, remove BMI160 - remove ALS - LED configuration changed to 2 bi-color LEDs - remove pi3usb30532 - add ANX7688 mux driver - change PD interrupt polarity BRANCH=none BUG=none TEST=manual make BOARD=elm -j load and test on elm proto Signed-off-by: Rong Chang <rongchang@chromium.org> Change-Id: I8ad02da9acade985bc0e7e2f85d9e58db7e6b38d Reviewed-on: https://chromium-review.googlesource.com/331453 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/mediatek.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/power/mediatek.c b/power/mediatek.c
index 82efb051ca..a619d050ea 100644
--- a/power/mediatek.c
+++ b/power/mediatek.c
@@ -181,9 +181,11 @@ static void chipset_turn_off_power_rails(void);
*/
static int is_suspend_asserted(void)
{
+#ifdef BOARD_OAK
if ((power_get_signals() & IN_SUSPEND) &&
(system_get_board_version() < 4))
usleep(SUSPEND_DEBOUNCE_TIME);
+#endif
return power_get_signals() & IN_SUSPEND;
}
@@ -196,9 +198,11 @@ static int is_suspend_asserted(void)
*/
static int is_suspend_deasserted(void)
{
+#ifdef BOARD_OAK
if (!(power_get_signals() & IN_SUSPEND) &&
(system_get_board_version() < 4))
usleep(SUSPEND_DEBOUNCE_TIME);
+#endif
return !(power_get_signals() & IN_SUSPEND);
}
@@ -213,9 +217,11 @@ static int is_power_good_asserted(void)
{
if (!gpio_get_level(GPIO_SYSTEM_POWER_H))
return 0;
+#ifdef BOARD_OAK
else if ((power_get_signals() & IN_POWER_GOOD) &&
(system_get_board_version() < 4))
usleep(POWER_DEBOUNCE_TIME);
+#endif
return power_get_signals() & IN_POWER_GOOD;
}
@@ -228,6 +234,7 @@ static int is_power_good_asserted(void)
*/
static int is_power_good_deasserted(void)
{
+#ifdef BOARD_OAK
/*
* Warm reset key from servo board lets the POWER_GOOD signal
* deasserted temporarily (about 1~2 seconds) on rev4.
@@ -235,14 +242,15 @@ static int is_power_good_deasserted(void)
* ignore the transient state if reset key is pressing.
*/
if (system_get_board_version() >= 4) {
- if (0 == gpio_get_level(GPIO_AP_RESET_L)) {
+ if (0 == gpio_get_level(GPIO_AP_RESET_L))
return 0;
- }
+ } else {
+ if (!(power_get_signals() & IN_POWER_GOOD))
+ usleep(POWER_DEBOUNCE_TIME);
}
-
- if (!(power_get_signals() & IN_POWER_GOOD) &&
- (system_get_board_version() < 4))
- usleep(POWER_DEBOUNCE_TIME);
+#endif
+ if (0 == gpio_get_level(GPIO_AP_RESET_L))
+ return 0;
return !(power_get_signals() & IN_POWER_GOOD);
}
@@ -610,10 +618,14 @@ static void power_on(void)
/* enable interrupt */
gpio_set_flags(GPIO_SUSPEND_L, INT_BOTH_PULL_UP);
- if(system_get_board_version() <= 3)
+#ifdef BOARD_OAK
+ if (system_get_board_version() <= 3)
gpio_set_flags(GPIO_EC_INT_L, GPIO_OUTPUT | GPIO_OUT_HIGH);
else
gpio_set_flags(GPIO_EC_INT_L, GPIO_ODR_HIGH);
+#else
+ gpio_set_flags(GPIO_EC_INT_L, GPIO_ODR_HIGH);
+#endif
disable_sleep(SLEEP_MASK_AP_RUN);
#ifdef HAS_TASK_POWERLED