Amit Pundir | 242bcef | 2021-07-22 22:55:10 +0530 | [diff] [blame] | 1 | #! /vendor/bin/sh |
| 2 | # Grep and set the vendor.usb.controller property from |
| 3 | # /sys/class/udc at the boot time. |
| 4 | # |
| 5 | # Upstream commit eb9b7bfd5954 ("arm64: dts: qcom: Harmonize DWC |
| 6 | # USB3 DT nodes name") (v5.14-rc1) changed the DTS USB node names, |
| 7 | # breaking the sys.usb.controller property hardcoded in the |
| 8 | # platform specific init.usb.common.rc |
| 9 | # |
| 10 | # This script will get rid of the static/hardcoded property name |
| 11 | # which we set in init.<hw>.usb.rc and set it to the available |
| 12 | # on-board USB controller from /sys/class/udc instead. |
| 13 | |
| 14 | # Searching for db845c's DWC3 UDC explicitly |
| 15 | UDC_ADDRESS=a600000 |
| 16 | UDC=`/vendor/bin/ls /sys/class/udc/ | /vendor/bin/grep $UDC_ADDRESS` |
| 17 | setprop vendor.usb.controller $UDC |