From 1cdeaf4f5e1c2a77856d72893ca581f66a9fef66 Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Thu, 2 Apr 2020 12:17:07 -0700 Subject: [PATCH] sm8350-common: init.recovery.qcom.rc: Force USB to peripheral mode On some newer platforms USB relies on PMIC to notify it of cable connection status, but the PMIC driver has relocated to ADSP FW. Since ADSP is not expected to be loaded in recovery or fastbootd mode, USB may not get notified and hence won't start up. Force the USB to start in peripheral mode since the whole purpose of recovery/fastbootd is to interact with a USB connection anyhow. Currently the command assumes that there is a sysfs "mode" param located at /sys/class/udc/${ro.boot.usbcontroller}/device/.. which is true for dwc3-msm based driver on most QC SoCs. Change-Id: I5f7a01defdf987dbf4bd48f77bc70344c212a623 --- rootdir/etc/init.recovery.qcom.rc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rootdir/etc/init.recovery.qcom.rc b/rootdir/etc/init.recovery.qcom.rc index 3bc57ce..aba8a94 100644 --- a/rootdir/etc/init.recovery.qcom.rc +++ b/rootdir/etc/init.recovery.qcom.rc @@ -6,3 +6,6 @@ on fs on init setprop sys.usb.configfs 1 + +on property:ro.boot.usbcontroller=* + write /sys/class/udc/${ro.boot.usbcontroller}/device/../mode peripheral