forked from rubenslte/android_kernel_samsung_msm8226
power: pm8921-charger: Make charger removal detection workaround optional
On some platforms such as MPQ8064 the charger removal detection workarounds - reverse boost fix and OVP FET stuck do not work as expected as the SMBC module is disconnected from USBout. On these targets the USB interface is not used for charging but merely to indicate the USB driver of the insertion/removal. Add a platform data variable to make this optional and enable the same for MPQ8064 Change-Id: I3fca1b357f8fc280483302f72ffbc61fb50109a7 Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
ca403ce99c
commit
80c729b513
@@ -557,4 +557,7 @@ void __init apq8064_init_pmic(void)
|
||||
|
||||
if (!machine_is_apq8064_mtp() && !machine_is_apq8064_liquid())
|
||||
apq8064_pm8921_chg_pdata.battery_less_hardware = 1;
|
||||
|
||||
if (machine_is_mpq8064_hrd())
|
||||
apq8064_pm8921_chg_pdata.disable_chg_rmvl_wrkarnd = 1;
|
||||
}
|
||||
|
||||
@@ -296,6 +296,7 @@ struct pm8921_chg_chip {
|
||||
int stop_chg_upon_expiry;
|
||||
bool disable_aicl;
|
||||
int usb_type;
|
||||
bool disable_chg_rmvl_wrkarnd;
|
||||
};
|
||||
|
||||
/* user space parameter to limit usb current */
|
||||
@@ -3057,7 +3058,7 @@ static void unplug_check_worker(struct work_struct *work)
|
||||
pr_debug("reg_loop=0x%x usb_ma = %d\n", reg_loop, usb_ma);
|
||||
|
||||
ibat = get_prop_batt_current(chip);
|
||||
if (reg_loop & VIN_ACTIVE_BIT) {
|
||||
if ((reg_loop & VIN_ACTIVE_BIT) && !chip->disable_chg_rmvl_wrkarnd) {
|
||||
if (ibat > 0) {
|
||||
pr_debug("revboost ibat = %d fsm = %d loop = 0x%x\n",
|
||||
ibat, pm_chg_get_fsm_state(chip), reg_loop);
|
||||
@@ -3077,7 +3078,8 @@ static void unplug_check_worker(struct work_struct *work)
|
||||
active_path, active_chg_plugged_in);
|
||||
chg_gone = pm_chg_get_rt_status(chip, CHG_GONE_IRQ);
|
||||
|
||||
if (chg_gone == 1 && active_chg_plugged_in == 1) {
|
||||
if (chg_gone == 1 && active_chg_plugged_in == 1 &&
|
||||
!chip->disable_chg_rmvl_wrkarnd) {
|
||||
pr_debug("chg_gone=%d, active_chg_plugged_in = %d\n",
|
||||
chg_gone, active_chg_plugged_in);
|
||||
unplug_ovp_fet_open(chip);
|
||||
@@ -4869,6 +4871,7 @@ static int __devinit pm8921_charger_probe(struct platform_device *pdev)
|
||||
chip->vin_min = pdata->vin_min;
|
||||
chip->thermal_mitigation = pdata->thermal_mitigation;
|
||||
chip->thermal_levels = pdata->thermal_levels;
|
||||
chip->disable_chg_rmvl_wrkarnd = pdata->disable_chg_rmvl_wrkarnd;
|
||||
|
||||
chip->cold_thr = pdata->cold_thr;
|
||||
chip->hot_thr = pdata->hot_thr;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
@@ -188,6 +188,7 @@ struct pm8921_charger_platform_data {
|
||||
int btc_delay_ms;
|
||||
int btc_panic_if_cant_stop_chg;
|
||||
int stop_chg_upon_expiry;
|
||||
bool disable_chg_rmvl_wrkarnd;
|
||||
};
|
||||
|
||||
enum pm8921_charger_source {
|
||||
|
||||
Reference in New Issue
Block a user