}
ret = 0;
+ /*
+ * we set charging regulator's maximum charging current 1st, then
+ * notify the charging type.
+ */
if (NULL != udc->vbus_reg && !udc->vbus_in_lp0) {
- tegra_udc_set_extcon_state(udc);
if (udc->connect_type != udc->connect_type_lp0 ||
udc->connect_type == CONNECT_TYPE_NONE)
ret = regulator_set_current_limit(udc->vbus_reg,
0, max_ua);
}
- if (!udc->vbus_in_lp0)
- udc->connect_type_lp0 = CONNECT_TYPE_NONE;
+ if (!udc->vbus_in_lp0) {
+ tegra_udc_set_extcon_state(udc);
+ udc->connect_type_lp0 = CONNECT_TYPE_NONE;
+ }
return ret;
}
unsigned long status;
/* Adding delay for proper detection of y-cable */
- if (tegra->support_y_cable && otg->phy->state == OTG_STATE_A_SUSPEND)
- msleep(400);
+ msleep(150);
mutex_lock(&tegra->irq_work_mutex);