Skip to content

Commit

Permalink
garnet: Fix battery and USB OTG detection
Browse files Browse the repository at this point in the history
 * 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
  • Loading branch information
adithya2306 authored and kleidione committed Jan 22, 2025
1 parent 6e075b0 commit 4d226b5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rootdir/etc/init.recovery.qcom.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 4d226b5

Please sign in to comment.