on charger
    #low power governing
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
    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/module/lpm_levels/enable_low_power/l2 4
    write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1
    write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1
    write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu0/retention/idle_enabled 1

on boot
    # Shamu boots with performance governor.
    # Switch one core to interactive to set permissions, for power hal and system server.
    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
    chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_rate
    chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_slack
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
    chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
    chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
    chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/target_loads
    chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
    chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
    chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boost
    chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
    #chown system system /sys/devices/system/cpu/cpufreq/interactive/input_boost
    #chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/input_boost
    chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
    chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
    chown system system /sys/devices/system/cpu/cpufreq/interactive/align_windows
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/align_windows
    chown system system /sys/devices/system/cpu/cpufreq/interactive/freq_calc_thresh
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/freq_calc_thresh
    chown system system /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
    chown system system /sys/devices/system/cpu/cpufreq/interactive/two_phase_freq
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/two_phase_freq
    chown system system /sys/devices/system/cpu/cpufreq/interactive/use_freq_calc_thresh
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/use_freq_calc_thresh
    chown system system /sys/module/cpu_boost/parameters/boost_ms
    chmod 0660 /sys/module/cpu_boost/parameters/boost_ms
    chown system system /sys/module/cpu_boost/parameters/sync_threshold
    chmod 0660 /sys/module/cpu_boost/parameters/sync_threshold
    chown system system /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
    chmod 0660 /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
    chown system system /sys/module/cpu_boost/parameters/input_boost_freq
    chmod 0660 /sys/module/cpu_boost/parameters/input_boost_freq
    chown system system /sys/module/cpu_boost/parameters/input_boost_ms
    chmod 0660 /sys/module/cpu_boost/parameters/input_boost_ms
    chown system system /dev/cpuctl/apps/cpu.notify_on_migrate
    chmod 0660 /dev/cpuctl/apps/cpu.notify_on_migrate

on property:dev.bootcomplete=1
    write /sys/module/lpm_levels/enable_low_power/l2 4
    write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1
    write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1
    write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1
    write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1
    write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1
    write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled 1
    write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled 1
    write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled 1
    write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu0/retention/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu1/retention/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu2/retention/idle_enabled 1
    write /sys/module/msm_pm/modes/cpu3/retention/idle_enabled 1
    write /sys/module/msm_thermal/core_control/enabled 0
    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive
    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive
    write /sys/module/msm_thermal/core_control/enabled 1
    write /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 1
    #write /sys/devices/system/cpu/sched_balance_policy/current_sched_balance_policy powersaving

    # cpufreq settings
    write /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay "20000 1400000:40000 1700000:20000"
    write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 90    
    write /sys/devices/system/cpu/cpufreq/interactive/target_loads "85 1500000:90 1800000:70"
    write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 40000
    write /dev/cpuctl/apps/cpu.notify_on_migrate 1

    write /sys/module/cpu_boost/parameters/boost_ms 20
    write /sys/module/cpu_boost/parameters/sync_threshold 1728000
    write /sys/module/cpu_boost/parameters/input_boost_freq "0:1267200 1:1267200 2:960000 3:729600"
    write /sys/module/cpu_boost/parameters/input_boost_ms 1000
	
    restorecon_recursive /sys/devices/system/cpu/cpufreq
