summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Chi <raychi@google.com>2023-02-02 01:56:33 +0800
committerTreeHugger Robot <treehugger-gerrit@google.com>2023-02-03 14:47:40 +0000
commit5e713fa131dc314d423f17c774646a10c220c611 (patch)
tree5548380f5fb27caa615b5f79366c4d63347ca34f
parentf56de0504d702c2e0b1e29b4d0d6101870b3e453 (diff)
[DO NOT MERGE] gs101: 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: Icbfe2a2839b3225b56de35ab949aa1758d27d9a6
-rw-r--r--usb/gadget/UsbGadget.h4
-rw-r--r--usb/gadget/android.hardware.usb.gadget-service.gs101.rc1
2 files changed, 4 insertions, 1 deletions
diff --git a/usb/gadget/UsbGadget.h b/usb/gadget/UsbGadget.h
index 8a2f7fdd..96a356db 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/11110000.dwc3/"
#endif
-static MonitorFfs monitorFfs(kGadgetName);
+constexpr char kExtconTypecState[] = "/sys/class/extcon/extcon0/cable.0/state";
+constexpr char kUsbGadgetState[] = "/sys/devices/platform/11110000.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.gs101.rc b/usb/gadget/android.hardware.usb.gadget-service.gs101.rc
index 8fa88680..da1a3b41 100644
--- a/usb/gadget/android.hardware.usb.gadget-service.gs101.rc
+++ b/usb/gadget/android.hardware.usb.gadget-service.gs101.rc
@@ -15,6 +15,7 @@ on post-fs
chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_b_sess
chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_otg_id
chown root system /sys/devices/platform/11110000.usb/usb_data_enabled
+ chown root system /sys/devices/platform/11110000.usb/dwc3_exynos_gadget_state
chmod 664 /sys/class/typec/port0/power_role
chmod 664 /sys/class/typec/port0/data_role
chmod 664 /sys/class/typec/port0/port_type