summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/ryu/board.c20
-rw-r--r--board/ryu/board.h3
-rw-r--r--board/ryu/gpio.inc12
-rw-r--r--power/tegra.c10
4 files changed, 33 insertions, 12 deletions
diff --git a/board/ryu/board.c b/board/ryu/board.c
index f6da9c2653..976c546de2 100644
--- a/board/ryu/board.c
+++ b/board/ryu/board.c
@@ -307,6 +307,16 @@ static void board_init(void)
/* Enable interrupts on VBUS transitions. */
gpio_enable_interrupt(GPIO_CHGR_ACOK);
+
+ /*
+ * TODO(crosbug.com/p/38689) Workaround for PMIC issue on P5.
+ * remove when P5 are de-commissioned.
+ * We are re-using EXTINT1 for the new power sequencing workaround
+ * this is killing the base closing detection on P5
+ * we won't charge it.
+ */
+ if (board_get_version() == 5)
+ gpio_enable_interrupt(GPIO_HPD_IN);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
@@ -317,6 +327,16 @@ const struct power_signal_info power_signal_list[] = {
};
BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
+/*
+ * TODO(crosbug.com/p/38689) Workaround for MAX77620 PMIC EN_PP3300 issue.
+ * remove when P5 are de-commissioned.
+ */
+void pp1800_on_off_evt(enum gpio_signal signal)
+{
+ int level = gpio_get_level(signal);
+ gpio_set_level(GPIO_EN_PP3300_RSVD, level);
+}
+
/* ADC channels */
const struct adc_t adc_channels[] = {
/* Vbus sensing. Converted to mV, /10 voltage divider. */
diff --git a/board/ryu/board.h b/board/ryu/board.h
index 285c598cc1..fa5f6eb888 100644
--- a/board/ryu/board.h
+++ b/board/ryu/board.h
@@ -193,6 +193,9 @@ int board_discharge_on_ac(int enable);
/* Set the charge current limit. */
void board_set_charge_limit(int charge_ma);
+/* PP1800 transition GPIO interrupt handler */
+void pp1800_on_off_evt(enum gpio_signal signal);
+
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */
diff --git a/board/ryu/gpio.inc b/board/ryu/gpio.inc
index 816e9e3e68..890c64390d 100644
--- a/board/ryu/gpio.inc
+++ b/board/ryu/gpio.inc
@@ -13,6 +13,13 @@ GPIO_INT(LID_OPEN, E, 1, GPIO_INT_BOTH | GPIO_PULL_UP, lid_inter
GPIO_INT(CHARGE_DONE, E, 6, GPIO_INT_BOTH, inductive_charging_interrupt)
GPIO_INT(AP_IN_SUSPEND, F, 9, GPIO_INT_BOTH, power_signal_interrupt)
GPIO_INT(AP_HOLD, E, 3, GPIO_INT_BOTH, power_signal_interrupt)
+/*
+ * TODO(crosbug.com/p/38689) Workaround for MAX77620 PMIC PP3300 issue
+ * Put back as GPIO_ODR_HIGH for P6+
+ */
+GPIO_INT(HPD_IN, C, 1, GPIO_INT_BOTH, pp1800_on_off_evt)
+
+/* Interrupt lines not used yet */
GPIO(BC_TEMP_ALERT_L, C, 5, GPIO_INT_FALLING)
GPIO(LB_INT_L, E, 7, GPIO_INT_FALLING | GPIO_PULL_UP)
GPIO(LIGHTBAR_EN_L, E, 8, GPIO_INT_FALLING | GPIO_PULL_UP)
@@ -40,10 +47,11 @@ GPIO(PMIC_PWRON_L, D, 14, GPIO_ODR_HIGH)
GPIO(PMIC_WARM_RESET_L, E, 4, GPIO_ODR_HIGH)
GPIO(EN_PP5000, A, 14, GPIO_OUT_LOW) /* Proto 5+ */
/*
- * We are missing an external pull-up for EN_PP3300. Pull it up here.
+ * We are missing an external pull-up for EN_PP3300.
+ * This GPIO is used to pull it up through an external 100kOhm.
* EN_PP3300 is still controlled by PMIC though.
*/
-GPIO(EN_PP3300_RSVD, E, 13, GPIO_INPUT | GPIO_PULL_UP)
+GPIO(EN_PP3300_RSVD, E, 13, GPIO_OUT_LOW)
/* sensor temp output and PMIC reset input */
GPIO(P5_PMIC_THERM_L, B, 8, GPIO_ODR_HIGH)
/* TODO(crosbug.com/p/38333) remove P4_PMIC_THERM_L */
diff --git a/power/tegra.c b/power/tegra.c
index 2bdba8b5f9..5efd41e61d 100644
--- a/power/tegra.c
+++ b/power/tegra.c
@@ -144,11 +144,6 @@ static void set_ap_reset(int asserted)
*/
static void set_pmic_pwron(int asserted)
{
-#ifdef BOARD_RYU
- /* TODO(crosbug.com/p/38689) Workaround for MAX77620 PMIC issue */
- if (asserted)
- gpio_set_flags(GPIO_EN_PP3300_RSVD, GPIO_INPUT | GPIO_PULL_UP);
-#endif /* BOARD_RYU */
/* Signal is active-low */
gpio_set_level(GPIO_PMIC_PWRON_L, asserted ? 0 : 1);
}
@@ -163,11 +158,6 @@ static void set_pmic_therm(int asserted)
{
/* Signal is active-low */
gpio_set_level(GPIO_PMIC_THERM_L, asserted ? 0 : 1);
-#ifdef BOARD_RYU
- /* TODO(crosbug.com/p/38689) Workaround for MAX77620 PMIC issue */
- if (asserted)
- gpio_set_flags(GPIO_EN_PP3300_RSVD, GPIO_INPUT);
-#endif /* BOARD_RYU */
}
/**