thermal: Enable thermalHAL in off charging mode
To support USB port overheat protection, we need to launch thermalHAL in
off charging mode.
Bug: 183573049
Test: verified usb port overheat protection in off charging mode with
emul temp
Change-Id: I0b36646d9779c2c1a25f38aafea5ca178bf91be1
diff --git a/conf/init.gs101.rc b/conf/init.gs101.rc
index 9d3a24b..436e021 100644
--- a/conf/init.gs101.rc
+++ b/conf/init.gs101.rc
@@ -870,6 +870,17 @@
chown system system /dev/thermal/cdev-by-name/wlc_fcc/cur_state
chown system system /dev/thermal/cdev-by-name/usbc-port/cur_state
+# Create thermal symlink in off charging mode
+on charger
+ mkdir /dev/thermal 0750 system system
+ mkdir /dev/thermal/tz-by-name 0750 system system
+ mkdir /dev/thermal/cdev-by-name 0750 system system
+ start vendor.thermal.symlinks
+
+# Launch thermal hal in off charging mode
+on charger && property:vendor.thermal.link_ready=1
+ start vendor.thermal-hal-2-0
+
on property:vendor.disable.bcl.control=1
write /sys/devices/virtual/pmic/mitigation/instruction/enable_mitigation 0