| ReStranger | 1b85f70 | 2025-09-30 04:05:06 +0300 | [diff] [blame] | 1 | #! /vendor/bin/sh |
| 2 | |
| 3 | # |
| 4 | # Copyright (c) 2019-2021, 2023, Qualcomm Technologies, Inc. |
| 5 | # All Rights Reserved. |
| 6 | # Confidential and Proprietary - Qualcomm Technologies, Inc. |
| 7 | # |
| 8 | # Copyright (c) 2019 The Linux Foundation. All rights reserved. |
| 9 | # |
| 10 | |
| 11 | export PATH=/vendor/bin |
| 12 | |
| 13 | soc_id=`getprop ro.vendor.qti.soc_id` |
| 14 | if [ "$soc_id" -eq 415 ] || [ "$soc_id" -eq 439 ] || [ "$soc_id" -eq 450 ] || [ "$soc_id" -eq 475 ] || [ "$soc_id" -eq 515 ]; then |
| 15 | setprop persist.vendor.hvdcp_opti.start 2 |
| 16 | exit 0 |
| 17 | fi |
| 18 | |
| 19 | if [ "$soc_id" -eq 441 ] || [ "$soc_id" -eq 471 ]; then |
| 20 | #Scuba does not support usb-pd or charge pumps |
| 21 | find /sys/class/power_supply/battery/ -type f -maxdepth 1 | xargs chown system.system |
| 22 | find /sys/class/power_supply/bms/ -type f -maxdepth 1 | xargs chown system.system |
| 23 | find /sys/class/power_supply/main/ -type f -maxdepth 1 | xargs chown system.system |
| 24 | find /sys/class/power_supply/usb/ -type f -maxdepth 1 | xargs chown system.system |
| 25 | else |
| 26 | find /sys/class/power_supply/battery/ -type f -maxdepth 1 | xargs chown system.system |
| 27 | find /sys/class/power_supply/bms/ -type f -maxdepth 1 | xargs chown system.system |
| 28 | find /sys/class/power_supply/main/ -type f -maxdepth 1 | xargs chown system.system |
| 29 | find /sys/class/power_supply/usb/ -type f -maxdepth 1 | xargs chown system.system |
| 30 | find /sys/class/power_supply/charge_pump_master/ -type f -maxdepth 1 | xargs chown system.system |
| 31 | find /sys/class/power_supply/pc_port/ -type f -maxdepth 1 | xargs chown system.system |
| 32 | find /sys/class/power_supply/dc/ -type f -maxdepth 1 | xargs chown system.system |
| 33 | find /sys/class/power_supply/parallel/ -type f -maxdepth 1 | xargs chown system.system |
| 34 | find /sys/class/usbpd/usbpd0/ -type f -maxdepth 1 | xargs chown system.system |
| 35 | find /sys/class/qc-vdm/ -type f -maxdepth 1 | xargs chown system.system |
| 36 | find /sys/class/charge_pump/ -type f -maxdepth 1 | xargs chown system.system |
| 37 | find /sys/class/qcom-battery/ -type f -maxdepth 1 | xargs chown system.system |
| 38 | find /sys/class/qbg/qbg_context -type f -maxdepth 1 | xargs chown system.system |
| 39 | |
| 40 | for i in 0 1 2 3 4 5 6 7 8 9 |
| 41 | do |
| 42 | devname=`cat /sys/bus/iio/devices/iio:device$i/name` |
| 43 | if [[ "$devname" == *smb* ]] || [[ "$devname" == *qg* ]] || [[ "$devname" == *div2_cp* ]] || [[ "$devname" == *div2-cp* ]]; then |
| 44 | find /sys/bus/iio/devices/iio:device$i/ -type f -maxdepth 1 | xargs chown system.system |
| 45 | fi |
| 46 | done |
| 47 | fi |
| 48 | |
| 49 | aon_present=`getprop ro.vendor.qc_aon_presence` |
| 50 | if [ "$aon_present" -eq 1 ]; then |
| 51 | setprop persist.vendor.hvdcp_opti.start 2 |
| 52 | exit 0 |
| 53 | fi |
| 54 | |
| 55 | setprop persist.vendor.hvdcp_opti.start 1 |