M7350v3_en_gpl
This commit is contained in:
27
kernel/drivers/usb/otg/msm_otg.c
Executable file → Normal file
27
kernel/drivers/usb/otg/msm_otg.c
Executable file → Normal file
@ -1327,14 +1327,13 @@ static int msm_otg_notify_power_supply(struct msm_otg *motg, unsigned mA)
|
||||
goto psy_error;
|
||||
}
|
||||
|
||||
/* [chenchao] Fix reboot when pc reboot */
|
||||
if (motg->cur_power == 0 && mA > 2) {
|
||||
/* Enable charging */
|
||||
if (power_supply_set_online(psy, true))
|
||||
goto psy_error;
|
||||
if (power_supply_set_current_limit(psy, 1000*mA))
|
||||
goto psy_error;
|
||||
} else if (motg->cur_power > 0 && (mA == 0)) {
|
||||
} else if (motg->cur_power > 0 && (mA == 0 || mA == 2)) {
|
||||
/* Disable charging */
|
||||
if (power_supply_set_online(psy, false))
|
||||
goto psy_error;
|
||||
@ -2318,7 +2317,6 @@ static void msm_chg_detect_work(struct work_struct *w)
|
||||
bool is_dcd = false, tmout, vout, is_aca;
|
||||
u32 line_state, dm_vlgc;
|
||||
unsigned long delay;
|
||||
static bool det_time_out = false;
|
||||
|
||||
dev_dbg(phy->dev, "chg detection work\n");
|
||||
|
||||
@ -2360,11 +2358,6 @@ static void msm_chg_detect_work(struct work_struct *w)
|
||||
is_dcd = msm_chg_check_dcd(motg);
|
||||
motg->dcd_time += MSM_CHG_DCD_POLL_TIME;
|
||||
tmout = motg->dcd_time >= MSM_CHG_DCD_TIMEOUT;
|
||||
|
||||
if (tmout) {
|
||||
det_time_out = true;
|
||||
}
|
||||
|
||||
if (is_dcd || tmout) {
|
||||
msm_chg_disable_dcd(motg);
|
||||
msm_chg_enable_primary_det(motg);
|
||||
@ -2402,17 +2395,11 @@ static void msm_chg_detect_work(struct work_struct *w)
|
||||
break;
|
||||
}
|
||||
|
||||
if (line_state) { /* DP > VLGC or/and DM > VLGC */
|
||||
if (line_state) /* DP > VLGC or/and DM > VLGC */
|
||||
motg->chg_type = USB_PROPRIETARY_CHARGER;
|
||||
} else {
|
||||
else
|
||||
motg->chg_type = USB_SDP_CHARGER;
|
||||
|
||||
if (det_time_out) {
|
||||
det_time_out = false;
|
||||
motg->chg_type = USB_DCP_CHARGER;
|
||||
}
|
||||
}
|
||||
|
||||
motg->chg_state = USB_CHG_STATE_DETECTED;
|
||||
delay = 0;
|
||||
}
|
||||
@ -2583,9 +2570,8 @@ static void msm_otg_sm_work(struct work_struct *w)
|
||||
case USB_PROPRIETARY_CHARGER:
|
||||
msm_otg_notify_charger(motg,
|
||||
IDEV_CHG_MAX);
|
||||
/* [chenchao] Not suspend when charge with power adapter */
|
||||
/* pm_runtime_put_noidle(otg->phy->dev); */
|
||||
/* pm_runtime_suspend(otg->phy->dev); */
|
||||
pm_runtime_put_noidle(otg->phy->dev);
|
||||
pm_runtime_suspend(otg->phy->dev);
|
||||
break;
|
||||
case USB_ACA_B_CHARGER:
|
||||
msm_otg_notify_charger(motg,
|
||||
@ -2610,9 +2596,6 @@ static void msm_otg_sm_work(struct work_struct *w)
|
||||
OTG_STATE_B_PERIPHERAL;
|
||||
break;
|
||||
case USB_SDP_CHARGER:
|
||||
/* [chenchao] Fix always reboot when connect some notebook */
|
||||
msm_otg_notify_charger(motg,
|
||||
IDEV_CHG_MIN);
|
||||
msm_otg_start_peripheral(otg, 1);
|
||||
otg->phy->state =
|
||||
OTG_STATE_B_PERIPHERAL;
|
||||
|
Reference in New Issue
Block a user