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
This commit is contained in:
Ray Chi 2021-04-14 18:03:49 +08:00 committed by TreeHugger Robot
parent 3af08d4f6b
commit 72ef08cafa

View file

@ -74,7 +74,8 @@ constexpr char kGadgetName[] = "11110000.dwc3";
#ifndef UDC_PATH #ifndef UDC_PATH
#define UDC_PATH "/sys/class/udc/11110000.dwc3/" #define UDC_PATH "/sys/class/udc/11110000.dwc3/"
#endif #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" #define SPEED_PATH UDC_PATH "current_speed"