From 24e96c7ab5c892472578ec1ca5125428ffa3d538 Mon Sep 17 00:00:00 2001 From: David Keitel Date: Mon, 15 Jul 2013 21:11:35 -0700 Subject: [PATCH] init: qcom: Add charger_monitor service This adds the charger monitor service. The charger monitor is responsible to conduct the adaptive input current limting. This service is supported on 8x26, 8974 and 8x10. CRs-Fixed: 457381 Change-Id: I7b7b3cd751a06f67a460d821043cfc2e896a53e2 --- rootdir/etc/init.qcom.rc | 5 +++++ rootdir/etc/init.qcom.sh | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index 8bf6f429..6a32ff38 100644 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -716,3 +716,8 @@ on property:persist.usb.hvdcp.detect=true on property:persist.usb.hvdcp.detect=false stop hvdcp + +service charger_monitor /system/bin/charger_monitor + user system + group system + disabled diff --git a/rootdir/etc/init.qcom.sh b/rootdir/etc/init.qcom.sh index 33c3d995..0b23b76e 100755 --- a/rootdir/etc/init.qcom.sh +++ b/rootdir/etc/init.qcom.sh @@ -69,6 +69,17 @@ start_battery_monitor() fi } +start_charger_monitor() +{ + if ls /sys/module/qpnp_charger/parameters/charger_monitor; then + chown root.system /sys/module/qpnp_charger/parameters/* + chown root.system /sys/class/power_supply/battery/input_current_max + chmod 0664 /sys/class/power_supply/battery/input_current_max + chmod 0664 /sys/module/qpnp_charger/parameters/charger_monitor + start charger_monitor + fi +} + baseband=`getprop ro.baseband` izat_premium_enablement=`getprop ro.qc.sdk.izat.premium_enabled` izat_service_mask=`getprop ro.qc.sdk.izat.service_mask` @@ -178,7 +189,9 @@ case "$target" in esac case "$baseband" in "msm") - start_battery_monitor;; + start_battery_monitor + start_charger_monitor + ;; esac ;; esac