From 1ca23a7b10613132c8dbfde0fd88cb0e18d63855 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Tue, 29 Aug 2023 12:41:08 +0100 Subject: [PATCH] LG8n: charger: Powersaving in charger mode Bug: 72445880 Test: boot to charger Signed-off-by: Shirayuki39 --- rootdir/etc/init/hw/init.cgroup.rc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rootdir/etc/init/hw/init.cgroup.rc b/rootdir/etc/init/hw/init.cgroup.rc index f8d9b7a..42a1124 100644 --- a/rootdir/etc/init/hw/init.cgroup.rc +++ b/rootdir/etc/init/hw/init.cgroup.rc @@ -8,7 +8,19 @@ on charger write /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq 0 write /sys/devices/system/cpu/cpufreq/policy6/scaling_min_freq 0 write /sys/class/devfreq/mtk-dvfsrc-devfreq/userspace/set_freq 0 + + # Lock to lowest frequency on charger mode + write /sys/devices/system/cpu/cpufreq/policy0/scaling_governor powersave + write /sys/devices/system/cpu/cpufreq/policy6/scaling_governor powersave + # Offline all cores except cpu0 + write /sys/devices/system/cpu/cpu1/online 0 + write /sys/devices/system/cpu/cpu2/online 0 + write /sys/devices/system/cpu/cpu3/online 0 + write /sys/devices/system/cpu/cpu4/online 0 + write /sys/devices/system/cpu/cpu5/online 0 + write /sys/devices/system/cpu/cpu6/online 0 + write /sys/devices/system/cpu/cpu7/online 0 on post-fs-data write /sys/devices/system/cpu/cpufreq/policy0/scaling_governor sugov_ext