summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthikeyan Ramasubramanian <kramasub@chromium.org>2019-01-15 12:11:29 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-01-17 20:20:26 -0800
commit7d794116deacb595952ebd126cf9c05ea15b9b10 (patch)
tree9ec2a0a49458f61f9a73b66ee9d45651d7be5966
parent82dbe746f3e0da4b5000d6ff0934137338da2db2 (diff)
downloadchrome-ec-7d794116deacb595952ebd126cf9c05ea15b9b10.tar.gz
driver/ppc/nx20p348.c: Handle overcurrent event
Currently the overcurrent event is logged but not handled. Report the overcurrent event to the USB PD framework which in turn will handle the overcurrent event further. BUG=b:115475862 BRANCH=octopus TEST=Boot to ChromeOS in grabbiter. No overcurrent events reported when the sink is drawing <= 3.20 A. Overcurrent events are reported when the sink is drawing > 3.25 A. After 3 reports, the port is latched off and power delivery is stopped. The port is re-enabled only after the sink is disconnected. Also when the sink is drawing current at 3.24 A, there is one report of overcurrent. The port gets disabled in response to that event. But the port is re-enabled after 1 second since overcurrent event is reported only once. After the port is re-enabled, the sink is able to draw the set current. When the overcurrent event is reported, I can see in the kernel logs that the overcurrent condition is detected by the kernel. EC Logs: [3391.984462 C1: PPC detected Vbus overcurrent!] [3391.984953 C1: overcurrent!] [3392.044935 C1: PPC detected Vbus overcurrent!] [3392.045425 C1: overcurrent!] [3392.061404 C1: PPC detected Vbus overcurrent!] [3392.061894 C1: overcurrent!] [3392.062142 C1: OC event limit reached! Source path disabled until physical disconnect.] [3392.077226 C1: PPC detected Vbus overcurrent!] [3392.077532 C1: overcurrent!] [3392.077891 C1: OC event limit reached! Source path disabled until physical disconnect.] [3392.092660 C1: PPC detected Vbus overcurrent!] [3392.092966 C1: overcurrent!] [3392.093213 C1: OC event limit reached! Source path disabled until physical disconnect.] Kernel Logs: [ 3356.560456] usb usb2-port1: over-current condition [ 3356.768434] usb usb2-port2: over-current condition [ 3356.976446] usb usb2-port4: over-current condition [ 3357.184441] usb usb2-port5: over-current condition [ 3357.392445] usb usb2-port6: over-current condition Change-Id: I0af69a132fdd1dd5bab4d530c3b060b2a5aea501 Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://chromium-review.googlesource.com/1412448 Commit-Ready: Karthikeyan Ramasubramanian <kramasub@chromium.org> Tested-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--driver/ppc/nx20p348x.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/driver/ppc/nx20p348x.c b/driver/ppc/nx20p348x.c
index 8a0d45851e..35202c8fe8 100644
--- a/driver/ppc/nx20p348x.c
+++ b/driver/ppc/nx20p348x.c
@@ -15,6 +15,7 @@
#include "tcpm.h"
#include "usb_charge.h"
#include "usb_pd_tcpm.h"
+#include "usb_pd.h"
#include "usbc_ppc.h"
#include "util.h"
@@ -322,11 +323,7 @@ static void nx20p348x_handle_interrupt(int port)
/* Check for 5V OC interrupt */
if (reg & NX20P348X_INT1_OC_5VSRC) {
CPRINTS("C%d: PPC detected Vbus overcurrent!", port);
- /*
- * TODO (b/69935262): The overcurrent action hasn't
- * been completed yet, but is required for TI PPC. When that
- * work is complete, tie it in here.
- */
+ pd_handle_overcurrent(port);
}
/* Check for Vbus reverse current protection */