mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
elm: get VBUS statue from GPIO
GPIO_USB_C0_VBUS_WAKE_L is used to show VBUS status on elm. If VBUS is present, pd sends soft reset on boot. So it can boot without battery. BUG=chrome-os-partner:53496 BRANCH=none TEST=test on elm. Remove battery and boot up successfully only with AC. Use "sysjump rw" command and ec won't reboot by pd hard reset. Change-Id: I1cdb12894c7b6bc41d7a16802b8c0ef14e2aa426 Signed-off-by: YH Huang <yh.huang@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/346261 Tested-by: Koro Chen <koro.chen@mediatek.com> Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
@@ -238,7 +238,7 @@ static void board_init(void)
|
||||
board_reset_pd_mcu();
|
||||
|
||||
/* Update VBUS supplier */
|
||||
usb_charger_vbus_change(0, !gpio_get_level(GPIO_USB_C0_VBUS_WAKE_L));
|
||||
usb_charger_vbus_change(0, pd_snk_is_vbus_provided(0));
|
||||
|
||||
/* Remap SPI2 to DMA channels 6 and 7 */
|
||||
REG32(STM32_DMA1_BASE + 0xa8) |= (1 << 20) | (1 << 21) |
|
||||
|
||||
@@ -93,7 +93,6 @@
|
||||
#define CONFIG_USB_PD_TCPM_MUX
|
||||
#define CONFIG_USB_PD_TCPM_TCPCI
|
||||
#define CONFIG_USB_PD_TRY_SRC
|
||||
#define CONFIG_USB_PD_TCPM_VBUS
|
||||
#undef CONFIG_TCPC_I2C_BASE_ADDR
|
||||
#define CONFIG_TCPC_I2C_BASE_ADDR 0x58
|
||||
#define CONFIG_USB_PD_ANX7688
|
||||
|
||||
@@ -95,6 +95,11 @@ void typec_set_input_current_limit(int port, uint32_t max_ma,
|
||||
charge_manager_update_charge(CHARGE_SUPPLIER_TYPEC, port, &charge);
|
||||
}
|
||||
|
||||
int pd_snk_is_vbus_provided(int port)
|
||||
{
|
||||
return !gpio_get_level(GPIO_USB_C0_VBUS_WAKE_L);
|
||||
}
|
||||
|
||||
int pd_board_checks(void)
|
||||
{
|
||||
return EC_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user