static void msm_otg_late_power_work(struct work_struct *w) { struct msm_otg *motg = container_of((struct delayed_work *)w, struct msm_otg, late_power_work); int booster = sec_get_notification(HNOTIFY_BOOSTER); pr_info("%s, ID=%d, booster=%d\n", __func__, test_bit(ID, &motg->inputs), booster); if (!test_bit(ID, &motg->inputs) && (booster == NOTIFY_POWER_OFF)) { msm_hsusb_vbus_power(motg, 0); msleep(100); msm_hsusb_vbus_power(motg, 1); } }
static void msm_otg_late_power_work(struct work_struct *w) { struct msm_otg *motg = container_of((struct delayed_work *)w, struct msm_otg, late_power_work); dev_info(motg->phy.dev, "%s, ID=%d, booster=%d\n", __func__, test_bit(ID, &motg->inputs), motg->ndev.booster); if (!test_bit(ID, &motg->inputs) && (motg->ndev.booster == NOTIFY_POWER_OFF)) { msm_hsusb_vbus_power(motg, 0); msleep(100); msm_hsusb_vbus_power(motg, 1); } }
static int msm_otg_set_id_state_pbatest(int id, struct host_notify_dev *ndev) { struct msm_otg *motg = container_of(ndev, struct msm_otg, ndev); #ifdef MSM_OTG_DIRECT_VBUS pr_info("[OTG] %s %d, id: %d\n", __func__, __LINE__, id); msm_hsusb_vbus_power(motg, id); #else struct usb_phy *phy = &motg->phy; pr_info("[OTG] %s %d, id: %d\n", __func__, __LINE__, id); if (atomic_read(&motg->in_lpm)) pm_runtime_resume(phy->dev); if (!id) set_bit(ID, &motg->inputs); else clear_bit(ID, &motg->inputs); schedule_work(&motg->sm_work); #endif #ifdef CONFIG_USB_SWITCH_FSA9485 if (!id) fsa9485_otg_detach(); #endif return 0; }