summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Chi <raychi@google.com>2021-04-14 18:03:49 +0800
committerTreeHugger Robot <treehugger-gerrit@google.com>2023-02-03 14:47:40 +0000
commitbf79debcb284d985c4ac33d88aeb2d7b938acd9e (patch)
tree913a4eedbff8d97304c3d97ac7a92efdf9652563
parent17c28ccd37c56c63a27898b573d7932982e53815 (diff)
[DO NOT MERGE] gs201: usb: provide extcon and gadget state to monitorffs
Monitorffs needs to check the state of usb extcon and gadget state to pull up USB gadget. Therefore, this patch provide extcon and gadget state to monitorffs. Bug: 263435622 Test: verified pass Change-Id: Iceaade6ed0060e4006405a29a81af3c5a1ab1b8b
-rw-r--r--usb/gadget/UsbGadget.h4
-rw-r--r--usb/gadget/android.hardware.usb.gadget-service.rc1
2 files changed, 4 insertions, 1 deletions
diff --git a/usb/gadget/UsbGadget.h b/usb/gadget/UsbGadget.h
index 61e6e798..f036c8e0 100644
--- a/usb/gadget/UsbGadget.h
+++ b/usb/gadget/UsbGadget.h
@@ -79,7 +79,9 @@ constexpr char kSmpAffinityList[] = "/smp_affinity_list";
#ifndef UDC_PATH
#define UDC_PATH "/sys/class/udc/11210000.dwc3/"
#endif
-static MonitorFfs monitorFfs(kGadgetName);
+constexpr char kExtconTypecState[] = "/sys/class/extcon/extcon0/cable.0/state";
+constexpr char kUsbGadgetState[] = "/sys/devices/platform/11210000.usb/dwc3_exynos_gadget_state";
+static MonitorFfs monitorFfs(kGadgetName, kExtconTypecState, kUsbGadgetState);
#define SPEED_PATH UDC_PATH "current_speed"
diff --git a/usb/gadget/android.hardware.usb.gadget-service.rc b/usb/gadget/android.hardware.usb.gadget-service.rc
index e3c3b0db..0395862d 100644
--- a/usb/gadget/android.hardware.usb.gadget-service.rc
+++ b/usb/gadget/android.hardware.usb.gadget-service.rc
@@ -10,6 +10,7 @@ on post-fs
chown root system /sys/devices/platform/10d60000.hsi2c/i2c-2/i2c-max77759tcpc/contaminant_detection
chown root system /sys/devices/platform/11210000.usb/dwc3_exynos_otg_b_sess
chown root system /sys/devices/platform/11210000.usb/dwc3_exynos_otg_id
+ chown root system /sys/devices/platform/11210000.usb/dwc3_exynos_gadget_state
chown root system /sys/devices/platform/11210000.usb/usb_data_enabled
chmod 664 /sys/class/typec/port0/power_role
chmod 664 /sys/class/typec/port0/data_role