diff options
| author | dhacker29 <dhackerdvm@gmail.com> | 2014-04-26 06:01:41 -0400 |
|---|---|---|
| committer | dhacker29 <dhackerdvm@gmail.com> | 2014-04-26 06:01:41 -0400 |
| commit | 5e47d7f6409a02339d1e5dbce5216665224e83ab (patch) | |
| tree | a8fd2ff5f9659ff64cb5eaf6f6c09e4417a36277 | |
| parent | e9e5b8f7ff01d8b35c481d2cd881f94d299ce3a5 (diff) | |
Build charger and stop using a prebuilt charge_only_mode
Change-Id: I7fe90998a5cd0312c0a031d197df92ceee28c6f4
| -rw-r--r-- | device-proprietary-files.txt | 2 | ||||
| -rw-r--r-- | device_moto_msm8960dt.mk | 4 | ||||
| -rwxr-xr-x | moto_com.sh | 39 | ||||
| -rwxr-xr-x | rootdir/etc/init.qcom.rc | 3 | ||||
| -rwxr-xr-x | rootdir/etc/init.target.rc | 3 |
5 files changed, 47 insertions, 4 deletions
diff --git a/device-proprietary-files.txt b/device-proprietary-files.txt index 95139f9..70c0676 100644 --- a/device-proprietary-files.txt +++ b/device-proprietary-files.txt @@ -4,7 +4,6 @@ bin/ap_gain.bin bin/ap_gain_mmul.bin bin/batt_health bin/bootmodem -bin/charge_only_mode bin/efsks bin/hardware_revisions.sh bin/imsdatadaemon @@ -12,7 +11,6 @@ bin/imsqmidaemon bin/ims_rtp_daemon bin/irsc_util bin/ks -bin/moto_com.sh bin/mount_ext4.sh bin/mpdecision bin/msp430 diff --git a/device_moto_msm8960dt.mk b/device_moto_msm8960dt.mk index d1e59d4..ad368e0 100644 --- a/device_moto_msm8960dt.mk +++ b/device_moto_msm8960dt.mk @@ -117,6 +117,10 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/config/audio_policy.conf:system/etc/audio_policy.conf \ $(LOCAL_PATH)/config/snd_soc_msm_2x:system/etc/snd_soc_msm/snd_soc_msm_2x +# Charger mode setup +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/moto_com.sh:system/bin/moto_com.sh + # Media config PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/config/media_profiles.xml:system/etc/media_profiles.xml \ diff --git a/moto_com.sh b/moto_com.sh new file mode 100755 index 0000000..8985d7a --- /dev/null +++ b/moto_com.sh @@ -0,0 +1,39 @@ +#!/system/bin/sh +PATH=/sbin:/system/sbin:/system/bin:/system/xbin +export PATH + +mode=`getprop ro.bootmode` +case "$mode" in + "charger") + + echo 1 > /sys/module/rpm_resources/enable_low_power/L2_cache + echo 1 > /sys/module/rpm_resources/enable_low_power/pxo + echo 1 > /sys/module/rpm_resources/enable_low_power/vdd_dig + echo 1 > /sys/module/rpm_resources/enable_low_power/vdd_mem + echo 1 > /sys/module/pm_8x60/modes/cpu0/retention/idle_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu1/retention/idle_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu2/retention/idle_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu3/retention/idle_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu2/power_collapse/suspend_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu3/power_collapse/suspend_enabled + echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo "interactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor + echo "interactive" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor + echo "interactive" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu1/online + echo 0 > /sys/devices/system/cpu/cpu2/online + echo 0 > /sys/devices/system/cpu/cpu3/online + echo 1 > /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu2/standalone_power_collapse/idle_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu3/standalone_power_collapse/idle_enabled + echo 1 > /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled + + echo 0 > /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled + echo 1 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu3/online + ;; +esac diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index eb5957c..4eb2125 100755 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -490,6 +490,9 @@ on property:init.svc.sdcard=running wait /mnt/shell/emulated/0 600 mount none /mnt/shell/emulated/0 /storage/emulated/legacy bind +service charger /charger + class charger + #Disable boot timeout for external modems. on property:persist.sys.mdm.timeout_disable=1 write /sys/module/mdm_common/parameters/disable_boot_timeout 1 diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc index 124af97..bc397f9 100755 --- a/rootdir/etc/init.target.rc +++ b/rootdir/etc/init.target.rc @@ -91,10 +91,9 @@ on start-charging chown mot_pwric mot_pwric /sys/devices/platform/msm_ssbi.0/pm8921-core/pm8921-charger/force_chg_fail_clear start batt_health start qcom-post-boot - # Prepare for charge-only mode + # Prepare for charger mode write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand write /sys/devices/system/cpu/cpu1/online 0 - exec /system/bin/charge_only_mode on property:ro.modem.no_wdog_chk=1 write /sys/module/modem_8960/parameters/no_wdog_chk 1 |
