From f52b23e96423fa0447013d58da1c6677ac8ae9f8 Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Sat, 17 May 2014 16:08:05 -0700 Subject: samus_pd: when sinking power detect loss of VBUS and disconnect Detect loss of VBUS when acting as PD sink and go to the disconnected state. This allows us to renegotiate power when power supply drops and switches to 5V. BUG=none BRANCH=none TEST=On a samus, tested by running for a couple of hours, and verifying that occasionally when zinger drops from 20V to 5V, we detect it and go to the disconnected state. Note, this only happens a couple times every hour. Change-Id: I237d267824ff564662c9c02e525ce2613ed229e6 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/200365 Reviewed-by: Vincent Palatin --- board/fruitpie/usb_pd_config.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'board/fruitpie') diff --git a/board/fruitpie/usb_pd_config.h b/board/fruitpie/usb_pd_config.h index 3c53d5e923..75d3b112c3 100644 --- a/board/fruitpie/usb_pd_config.h +++ b/board/fruitpie/usb_pd_config.h @@ -84,6 +84,11 @@ static inline int pd_adc_read(int cc) return adc_read_channel(ADC_CH_CC2_PD); } +static inline int pd_snk_is_vbus_provided(void) +{ + return 1; +} + /* Standard-current DFP : no-connect voltage is 1.55V */ #define PD_SRC_VNC 1550 /* mV */ -- cgit v1.2.1