summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 */