mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 17:41:54 +00:00
samus_pd: provide VBUS in host mode
When we are a USB host (and a power source), provide 5V VBUS on the type-C receptacle. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=chrome-os-partner:28782 TEST=on Samus, put port0 in host mode (by doing "pd charger" on the PD MCU command line), then insert a type-C to type-A cable and observe we have VBUS on the other side. Change-Id: I5c6cd78b54dc1c651420eaaf122b8545b9f0b0de Reviewed-on: https://chromium-review.googlesource.com/201066 Reviewed-by: Alec Berg <alecaberg@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
3d9544ae42
commit
5725f4f0ef
@@ -92,13 +92,19 @@ static inline void pd_tx_init(void)
|
||||
static inline void pd_set_host_mode(int enable)
|
||||
{
|
||||
if (enable) {
|
||||
/* We never charging in power source mode */
|
||||
gpio_set_level(GPIO_USB_C0_CHARGE_EN_L, 1);
|
||||
/* High-Z is used for host mode. */
|
||||
gpio_set_level(GPIO_USB_C0_CC1_ODL, 1);
|
||||
gpio_set_level(GPIO_USB_C0_CC2_ODL, 1);
|
||||
} else {
|
||||
/* Kill VBUS power supply */
|
||||
gpio_set_level(GPIO_USB_C0_5V_EN, 0);
|
||||
/* Pull low for device mode. */
|
||||
gpio_set_level(GPIO_USB_C0_CC1_ODL, 0);
|
||||
gpio_set_level(GPIO_USB_C0_CC2_ODL, 0);
|
||||
/* Enable the charging path*/
|
||||
gpio_set_level(GPIO_USB_C0_CHARGE_EN_L, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "board.h"
|
||||
#include "common.h"
|
||||
#include "console.h"
|
||||
#include "gpio.h"
|
||||
#include "hooks.h"
|
||||
#include "registers.h"
|
||||
#include "task.h"
|
||||
@@ -106,11 +107,16 @@ int pd_request_voltage(uint32_t rdo)
|
||||
|
||||
int pd_set_power_supply_ready(void)
|
||||
{
|
||||
/* provide VBUS */
|
||||
gpio_set_level(GPIO_USB_C0_5V_EN, 1);
|
||||
|
||||
return EC_SUCCESS; /* we are ready */
|
||||
}
|
||||
|
||||
void pd_power_supply_reset(void)
|
||||
{
|
||||
/* Kill VBUS */
|
||||
gpio_set_level(GPIO_USB_C0_5V_EN, 0);
|
||||
}
|
||||
|
||||
int pd_board_checks(void)
|
||||
|
||||
Reference in New Issue
Block a user