summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/glados/board.c15
-rw-r--r--board/glados/board.h1
-rw-r--r--power/skylake.c3
3 files changed, 19 insertions, 0 deletions
diff --git a/board/glados/board.c b/board/glados/board.c
index f16da8ed05..eff125b426 100644
--- a/board/glados/board.c
+++ b/board/glados/board.c
@@ -7,8 +7,10 @@
#include "button.h"
#include "charger.h"
+#include "console.h"
#include "extpower.h"
#include "gpio.h"
+#include "hooks.h"
#include "i2c.h"
#include "lid_switch.h"
#include "motion_sense.h"
@@ -20,6 +22,8 @@
#define GPIO_KB_INPUT (GPIO_INPUT | GPIO_PULL_UP)
#define GPIO_KB_OUTPUT (GPIO_ODR_HIGH)
+#define I2C_ADDR_BD99992 0x60
+
/* Exchange status with PD MCU. */
static void pd_mcu_interrupt(enum gpio_signal signal)
{
@@ -80,3 +84,14 @@ const struct button_config buttons[CONFIG_BUTTON_COUNT] = {
{ 0 },
{ 0 },
};
+
+static void pmic_init(void)
+{
+ /*
+ * Set V085ACNT / V0.85A Control Register:
+ * Lower power mode = 0.7V.
+ * Nominal output = 1.0V.
+ */
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992, 0x38, 0x7a);
+}
+DECLARE_HOOK(HOOK_CHIPSET_PRE_INIT, pmic_init, HOOK_PRIO_DEFAULT);
diff --git a/board/glados/board.h b/board/glados/board.h
index cfa44e425d..393c12182d 100644
--- a/board/glados/board.h
+++ b/board/glados/board.h
@@ -52,6 +52,7 @@
#define I2C_PORT_PD_MCU MEC1322_I2C1
#define I2C_PORT_ALS MEC1322_I2C2
#define I2C_PORT_ACCEL MEC1322_I2C2
+#define I2C_PORT_PMIC MEC1322_I2C3
#ifndef __ASSEMBLER__
diff --git a/power/skylake.c b/power/skylake.c
index bef664807d..d8c97fc3b6 100644
--- a/power/skylake.c
+++ b/power/skylake.c
@@ -145,6 +145,9 @@ enum power_state power_handle_state(enum power_state state)
break;
case POWER_G3S5:
+ /* Call hooks to initialize PMIC */
+ hook_notify(HOOK_CHIPSET_PRE_INIT);
+
if (power_wait_signals(IN_PCH_SLP_SUS_DEASSERTED)) {
chipset_force_shutdown();
return POWER_G3;