sm8450-common: Fix battery and USB OTG detection

* In cape (msm-5.10) pmic driver now lies in adsp [1], so
   adsp firmware must to be loaded along with qti battery/
   charger kernel module, in order to get battery and usb
   power_supply up & running

 * With this, we dont need to set usb mode to peripheral
   explicitly either

 * The GKI kernel for 5.10 explicitly disabled
   FW_LOADER_USER_HELPER_FALLBACK, and the right way to enable it is to
   echo 1 to the /proc/sys/kernel/firmware_config/force_sysfs_fallback,
   so do this before writing to adsp sysfs node.

[1]: 4e2b0f663a

Depends-On: Id0e64302dbbdc53620cbc1825c36e13bb9e58aef
Change-Id: I835fa5daaa53eb704cc6c0777d7069d47ecbe10c
This commit is contained in:
ghostrider-reborn 2022-12-17 19:03:10 +05:30 committed by Arian
parent 19b79e58c0
commit 6d47060aef

View file

@ -25,6 +25,9 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
on early-init
write /proc/sys/kernel/firmware_config/force_sysfs_fallback 1
on init
write /sys/class/backlight/panel0-backlight/brightness 200
setprop sys.usb.configfs 1
@ -38,3 +41,10 @@ on property:ro.boot.usbcontroller=*
on fs
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
# Load ADSP firmware for PMIC
mkdir /firmware
mount vfat /dev/block/bootdevice/by-name/modem${ro.boot.slot_suffix} /firmware ro context=u:object_r:firmware_file:s0
on property:dev.mnt.blk.firmware=*
write /sys/kernel/boot_adsp/boot 1