From 72ef08cafa11ab10bc31105c70836cef92e1f7b4 Mon Sep 17 00:00:00 2001 From: Ray Chi Date: Wed, 14 Apr 2021 18:03:49 +0800 Subject: [PATCH] gs101: usb: add state of usb extcon to monitorffs Monitorffs needs to check the state of usb extcon to pull up USB gadget. Therefore, this patch add state of usb extcon and send this information to monitorffs. Bug: 173086594 Test: verified pass Change-Id: Ib2a1bb01813490185e1901fafdeba02458332e63 --- usb/UsbGadget.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usb/UsbGadget.h b/usb/UsbGadget.h index 2669f8da..e3eb3b4e 100644 --- a/usb/UsbGadget.h +++ b/usb/UsbGadget.h @@ -74,7 +74,8 @@ constexpr char kGadgetName[] = "11110000.dwc3"; #ifndef UDC_PATH #define UDC_PATH "/sys/class/udc/11110000.dwc3/" #endif -static MonitorFfs monitorFfs(kGadgetName); +constexpr char kExtconUsbState[] = "/sys/class/extcon/extcon0/cable.0/state"; +static MonitorFfs monitorFfs(kGadgetName, kExtconUsbState); #define SPEED_PATH UDC_PATH "current_speed"