Browse Source

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]: https://git.codelinaro.org/clo/la/device/qcom/common/-/commit/4e2b0f663a8f4b73000c81999055363411aaf12c

Depends-On: Id0e64302dbbdc53620cbc1825c36e13bb9e58aef
Change-Id: I835fa5daaa53eb704cc6c0777d7069d47ecbe10c
ghostrider-reborn 2 years ago
parent
commit
13ca7d9b37
1 changed files with 10 additions and 0 deletions
  1. 10 0
      rootdir/etc/init.recovery.qcom.rc

+ 10 - 0
rootdir/etc/init.recovery.qcom.rc

@@ -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