power: charger: set under threshold as vddmax_min for unplug_usbcheck_work.

When usb mode is changed from MTP to Tethering, chg_gone_irq_handler is called
and then disconnect tethering by turning off ovpfet from unplug_ovp_fet_open.
So we add under threshold to protect this error while usb is being connected.

Change-Id: Id66a3db0822c291ba348cf93d2e7a72f6ae857ae
This commit is contained in:
roy.park 2012-09-21 16:16:53 -07:00 committed by Iliyan Malchev
parent 4172e74684
commit e62e15cc2e

View file

@ -2944,10 +2944,11 @@ static void unplug_usbcheck_work(struct work_struct *work)
usb_vin = vchg.physical;
pr_info("usb_vin : %d, max_voltage_mv=%d\n", usb_vin, chip->max_voltage_mv);
if (usb_vin/1000 <= chip->max_voltage_mv) {
unplug_ovp_fet_open(chip);
if ((usb_vin/1000 <= chip->max_voltage_mv) &&
(usb_vin/1000 > PM8921_CHG_VDDMAX_MIN)){
pr_info(" Turn off USB ovp \n");
unplug_ovp_fet_open(chip);
}
pr_debug(" Notify USB update here \n");
power_supply_changed(&chip->batt_psy);
power_supply_changed(&chip->usb_psy);
power_supply_changed(&chip->dc_psy);