diff options
author | Edward Hill <ecgh@chromium.org> | 2018-01-25 16:13:22 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-01-31 22:38:56 -0800 |
commit | 11bda19561bd4d5dcbc6419e08ee94c05e9ae862 (patch) | |
tree | dbde4b8307382e30986031f809b8684aeb5ba757 /include/usbc_ppc.h | |
parent | eb60e291e8c7c178e0814c5d2a5cbe6c207182d2 (diff) | |
download | chrome-ec-11bda19561bd4d5dcbc6419e08ee94c05e9ae862.tar.gz |
sn5s330: Enable VBUS interrupts
If the sn5s330 PPC is being used to detect VBUS presence
(CONFIG_USB_PD_VBUS_DETECT_PPC), then enable interrupts and call
usb_charger_vbus_change when VBUS_GOOD changes.
BUG=b:72007153,b:72007492
BRANCH=none
TEST=Connect 3A and 1A USB-A chargers to each of Grunt's USB-C ports,
check that BC1.2 detection is working:
With 1A:
> chgsup
port=0/1, type=7, cur=500mA, vtg=5000mV, lsm=1
With 3A:
> chgsup
port=0/1, type=7, cur=2400mA, vtg=5000mV, lsm=1
TEST=Boot Grunt to OS, then connect USB2 mouse or USB3 flash drive to each
of Grunt's USB-C ports. Devices do not work due to b:71772180, but gpioget
shows EC is setting USB_C0/1_BC12_VBUS_ON_L correctly.
Change-Id: Iffc352105a321997adb364b9fbb8bafef248c224
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/887938
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'include/usbc_ppc.h')
-rw-r--r-- | include/usbc_ppc.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/include/usbc_ppc.h b/include/usbc_ppc.h index 4fbb913a11..eec8362959 100644 --- a/include/usbc_ppc.h +++ b/include/usbc_ppc.h @@ -77,21 +77,13 @@ struct ppc_drv { #endif /* defined(CONFIG_CMD_PPC_DUMP) */ #ifdef CONFIG_USB_PD_VBUS_DETECT_PPC - /* - * TODO(aaboagye): In order for VBUS detection to work properly for our - * system, we need to enable VBUS interrupts and send the appropriate - * notifications. - */ - /** * Determine if VBUS is present or not. * * @param port: The Type-C port number. - * @param vbus_present: 1: VBUS is present. 0: VBUS is not present. - * @return EC_SUCCESS if able to determine VBUS status, otherwise an - * error. + * @return 1 if VBUS is present, 0 if not. */ - int (*is_vbus_present)(int port, int *vbus_present); + int (*is_vbus_present)(int port); #endif /* defined(CONFIG_USB_PD_VBUS_DETECT_PPC) */ }; @@ -116,11 +108,9 @@ int ppc_init(int port); * Determine if VBUS is present or not. * * @param port: The Type-C port number. - * @param vbus_present: 1: VBUS is present. 0: VBUS is not present. - * @return EC_SUCCESS if able to determine VBUS status, otherwise an - * error. + * @return 1 if VBUS is present, 0 if not. */ -int ppc_is_vbus_present(int port, int *vbus_present); +int ppc_is_vbus_present(int port); /** * Is the port sourcing Vbus? |