power: pm8921-charger: add dc_unplug_check option

Add a configuration option to enable or disable
the reverse boost fix for the DC charging path.

Some board designs do not utilize the DC_IN path
on the PMIC, however they do use the presence
detection of DC_IN to enable the auto switching
and interrupt features. In these particular configurations
the PMIC does not control the DC OVP FETs.
Hence add an option to enable or disable the DC path workaround
and leave the workaround disabled by default.

Change-Id: I1e55bbfe37c7cc6f62581af11280a565ed648c06
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
This commit is contained in:
David Keitel 2012-05-25 18:04:14 -07:00 committed by Stephen Boyd
parent 1c68749c15
commit 1218989c85
2 changed files with 11 additions and 0 deletions

View file

@ -248,6 +248,7 @@ struct pm8921_chg_chip {
bool ext_charging;
bool ext_charge_done;
bool iusb_fine_res;
bool dc_unplug_check;
DECLARE_BITMAP(enabled_irqs, PM_CHG_MAX_INTS);
struct work_struct battery_id_valid_work;
int64_t batt_id_min;
@ -2447,6 +2448,10 @@ static void unplug_check_worker(struct work_struct *work)
}
} else if (active_path & DC_ACTIVE_BIT) {
pr_debug("DC charger active\n");
/* Some board designs are not prone to reverse boost on DC
* charging path */
if (!chip->dc_unplug_check)
return;
} else {
/* No charger active */
if (!(is_usb_chg_plugged_in(chip)
@ -4000,6 +4005,7 @@ static int __devinit pm8921_charger_probe(struct platform_device *pdev)
chip->warm_temp_dc = INT_MIN;
chip->temp_check_period = pdata->temp_check_period;
chip->dc_unplug_check = pdata->dc_unplug_check;
chip->max_bat_chg_current = pdata->max_bat_chg_current;
chip->cool_bat_chg_current = pdata->cool_bat_chg_current;
chip->warm_bat_chg_current = pdata->warm_bat_chg_current;

View file

@ -89,6 +89,10 @@ enum pm8921_chg_led_src_config {
* @get_batt_capacity_percent:
* a board specific function to return battery
* capacity. If null - a default one will be used
* @dc_unplug_check: enables the reverse boosting fix for the DC_IN line
* however, this should only be enabled for devices which
* control the DC OVP FETs otherwise this option should
* remain disabled
* @trkl_voltage: the trkl voltage in (mV) below which hw controlled
* trkl charging happens with linear charger
* @weak_voltage: the weak voltage (mV) below which hw controlled
@ -137,6 +141,7 @@ struct pm8921_charger_platform_data {
int64_t batt_id_min;
int64_t batt_id_max;
bool keep_btm_on_suspend;
bool dc_unplug_check;
int trkl_voltage;
int weak_voltage;
int trkl_current;