summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2015-08-27 12:56:28 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-08-27 21:27:49 -0700
commiteb57628abe6037924d4dc4845107fdebeee58ea9 (patch)
treefb58069323c22f07aefa2d71656f8a8f09a49daa
parent8cd6cb8d2b50e317beeb33a456db37ed6b75d6d5 (diff)
downloadchrome-ec-eb57628abe6037924d4dc4845107fdebeee58ea9.tar.gz
Kunimitsu: Buffer AC status to the PCH
Ported the patch from Glados. Change-Id: Id7e6ca674e35c98594d09b86ab5bdf518f8b3984 Reviewed-on: https://chromium-review.googlesource.com/288922 BUG=none BRANCH=none TEST=boot on Kunimitsu and verify PCH_ACOK is asserted when the device starts to charge and is deasserted when no cable is connected. Change-Id: I869dab9dacc9c80da1cff79d795f07e16cbd37de Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/295864 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/kunimitsu/board.c12
-rw-r--r--board/kunimitsu/gpio.inc2
2 files changed, 13 insertions, 1 deletions
diff --git a/board/kunimitsu/board.c b/board/kunimitsu/board.c
index f8d1dd128b..d2359de78c 100644
--- a/board/kunimitsu/board.c
+++ b/board/kunimitsu/board.c
@@ -308,10 +308,22 @@ static void board_init(void)
/* Enable pericom BC1.2 interrupts */
gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_L);
gpio_enable_interrupt(GPIO_USB_C1_BC12_INT_L);
+
+ /* Provide AC status to the PCH */
+ gpio_set_level(GPIO_PCH_ACOK, extpower_is_present());
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
/**
+ * Buffer the AC present GPIO to the PCH.
+ */
+static void board_extpower(void)
+{
+ gpio_set_level(GPIO_PCH_ACOK, extpower_is_present());
+}
+DECLARE_HOOK(HOOK_AC_CHANGE, board_extpower, HOOK_PRIO_DEFAULT);
+
+/**
* Set active charge port -- only one port can be active at a time.
*
* @param charge_port Charge port to enable.
diff --git a/board/kunimitsu/gpio.inc b/board/kunimitsu/gpio.inc
index be459d06ef..643b335b16 100644
--- a/board/kunimitsu/gpio.inc
+++ b/board/kunimitsu/gpio.inc
@@ -60,7 +60,7 @@ GPIO(PCH_WAKE_L, PIN(66), GPIO_ODR_HIGH)
GPIO(EC_FAN1_TTACH, PIN(105), GPIO_INPUT)
/* Fan PWM output - NC / testing only */
GPIO(EC_FAN1_PWM, PIN(136), GPIO_OUT_LOW)
-GPIO(PCH_ACOK, PIN(110), GPIO_ODR_HIGH)
+GPIO(PCH_ACOK, PIN(110), GPIO_OUT_LOW)
/* Interrupts from accelerometer / gyro -- not yet implemented */
GPIO(LID_ACCEL_INT, PIN(161), GPIO_INPUT | GPIO_PULL_DOWN) /* Lid ACCEL sensor interrupt to EC */
GPIO(GYRO_INT, PIN(127), GPIO_INPUT | GPIO_PULL_DOWN) /* Lid Gyro sensor interrupt to EC */