Searched refs:motg (Results 1 - 1 of 1) sorted by relevance

/linux-4.1.27/drivers/usb/phy/
H A Dphy-msm-usb.c47 #define MSM_USB_BASE (motg->regs)
73 static int msm_hsusb_init_vddcx(struct msm_otg *motg, int init) msm_hsusb_init_vddcx() argument
78 ret = regulator_set_voltage(motg->vddcx, msm_hsusb_init_vddcx()
79 motg->vdd_levels[VDD_LEVEL_MIN], msm_hsusb_init_vddcx()
80 motg->vdd_levels[VDD_LEVEL_MAX]); msm_hsusb_init_vddcx()
82 dev_err(motg->phy.dev, "Cannot set vddcx voltage\n"); msm_hsusb_init_vddcx()
86 ret = regulator_enable(motg->vddcx); msm_hsusb_init_vddcx()
88 dev_err(motg->phy.dev, "unable to enable hsusb vddcx\n"); msm_hsusb_init_vddcx()
90 ret = regulator_set_voltage(motg->vddcx, 0, msm_hsusb_init_vddcx()
91 motg->vdd_levels[VDD_LEVEL_MAX]); msm_hsusb_init_vddcx()
93 dev_err(motg->phy.dev, "Cannot set vddcx voltage\n"); msm_hsusb_init_vddcx()
94 ret = regulator_disable(motg->vddcx); msm_hsusb_init_vddcx()
96 dev_err(motg->phy.dev, "unable to disable hsusb vddcx\n"); msm_hsusb_init_vddcx()
102 static int msm_hsusb_ldo_init(struct msm_otg *motg, int init) msm_hsusb_ldo_init() argument
107 rc = regulator_set_voltage(motg->v3p3, USB_PHY_3P3_VOL_MIN, msm_hsusb_ldo_init()
110 dev_err(motg->phy.dev, "Cannot set v3p3 voltage\n"); msm_hsusb_ldo_init()
113 rc = regulator_enable(motg->v3p3); msm_hsusb_ldo_init()
115 dev_err(motg->phy.dev, "unable to enable the hsusb 3p3\n"); msm_hsusb_ldo_init()
118 rc = regulator_set_voltage(motg->v1p8, USB_PHY_1P8_VOL_MIN, msm_hsusb_ldo_init()
121 dev_err(motg->phy.dev, "Cannot set v1p8 voltage\n"); msm_hsusb_ldo_init()
124 rc = regulator_enable(motg->v1p8); msm_hsusb_ldo_init()
126 dev_err(motg->phy.dev, "unable to enable the hsusb 1p8\n"); msm_hsusb_ldo_init()
133 regulator_disable(motg->v1p8); msm_hsusb_ldo_init()
135 regulator_disable(motg->v3p3); msm_hsusb_ldo_init()
140 static int msm_hsusb_ldo_set_mode(struct msm_otg *motg, int on) msm_hsusb_ldo_set_mode() argument
145 ret = regulator_set_load(motg->v1p8, USB_PHY_1P8_HPM_LOAD); msm_hsusb_ldo_set_mode()
150 ret = regulator_set_load(motg->v3p3, USB_PHY_3P3_HPM_LOAD); msm_hsusb_ldo_set_mode()
153 regulator_set_load(motg->v1p8, USB_PHY_1P8_LPM_LOAD); msm_hsusb_ldo_set_mode()
157 ret = regulator_set_load(motg->v1p8, USB_PHY_1P8_LPM_LOAD); msm_hsusb_ldo_set_mode()
160 ret = regulator_set_load(motg->v3p3, USB_PHY_3P3_LPM_LOAD); msm_hsusb_ldo_set_mode()
171 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); ulpi_read() local
196 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); ulpi_write() local
224 static void ulpi_init(struct msm_otg *motg) ulpi_init() argument
226 struct msm_otg_platform_data *pdata = motg->pdata; ulpi_init()
234 dev_vdbg(motg->phy.dev, "ulpi: write 0x%02x to 0x%02x\n", ulpi_init()
236 ulpi_write(&motg->phy, seq[idx], addr + idx); ulpi_init()
257 static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert) msm_otg_link_clk_reset() argument
262 ret = reset_control_assert(motg->link_rst); msm_otg_link_clk_reset()
264 ret = reset_control_deassert(motg->link_rst); msm_otg_link_clk_reset()
267 dev_err(motg->phy.dev, "usb link clk reset %s failed\n", msm_otg_link_clk_reset()
273 static int msm_otg_phy_clk_reset(struct msm_otg *motg) msm_otg_phy_clk_reset() argument
277 if (motg->phy_rst) msm_otg_phy_clk_reset()
278 ret = reset_control_reset(motg->phy_rst); msm_otg_phy_clk_reset()
281 dev_err(motg->phy.dev, "usb phy clk reset failed\n"); msm_otg_phy_clk_reset()
286 static int msm_link_reset(struct msm_otg *motg) msm_link_reset() argument
291 ret = msm_otg_link_clk_reset(motg, 1); msm_link_reset()
298 ret = msm_otg_link_clk_reset(motg, 0); msm_link_reset()
302 if (motg->phy_number) msm_link_reset()
314 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); msm_otg_reset() local
333 if (motg->phy_number) msm_otg_reset()
338 static void msm_phy_reset(struct msm_otg *motg) msm_phy_reset() argument
342 if (motg->pdata->phy_type != SNPS_28NM_INTEGRATED_PHY) { msm_phy_reset()
343 msm_otg_phy_clk_reset(motg); msm_phy_reset()
348 if (motg->phy_number) msm_phy_reset()
367 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); msm_usb_reset() local
370 if (!IS_ERR(motg->core_clk)) msm_usb_reset()
371 clk_prepare_enable(motg->core_clk); msm_usb_reset()
373 ret = msm_link_reset(motg); msm_usb_reset()
379 ret = msm_otg_reset(&motg->phy); msm_usb_reset()
388 msm_phy_reset(motg); msm_usb_reset()
390 if (!IS_ERR(motg->core_clk)) msm_usb_reset()
391 clk_disable_unprepare(motg->core_clk); msm_usb_reset()
398 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); msm_phy_init() local
399 struct msm_otg_platform_data *pdata = motg->pdata; msm_phy_init()
403 ulpi_init(motg); msm_phy_init()
409 msm_phy_reset(motg); msm_phy_init()
425 if (motg->phy_number) msm_phy_init()
436 static int msm_hsusb_config_vddcx(struct msm_otg *motg, int high) msm_hsusb_config_vddcx() argument
438 int max_vol = motg->vdd_levels[VDD_LEVEL_MAX]; msm_hsusb_config_vddcx()
443 min_vol = motg->vdd_levels[VDD_LEVEL_MIN]; msm_hsusb_config_vddcx()
445 min_vol = motg->vdd_levels[VDD_LEVEL_NONE]; msm_hsusb_config_vddcx()
447 ret = regulator_set_voltage(motg->vddcx, min_vol, max_vol); msm_hsusb_config_vddcx()
458 static int msm_otg_suspend(struct msm_otg *motg) msm_otg_suspend() argument
460 struct usb_phy *phy = &motg->phy; msm_otg_suspend()
462 struct msm_otg_platform_data *pdata = motg->pdata; msm_otg_suspend()
466 if (atomic_read(&motg->in_lpm)) msm_otg_suspend()
469 disable_irq(motg->irq); msm_otg_suspend()
487 if (motg->pdata->phy_type == CI_45NM_INTEGRATED_PHY) { msm_otg_suspend()
510 enable_irq(motg->irq); msm_otg_suspend()
524 if (motg->phy_number) msm_otg_suspend()
527 if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY && msm_otg_suspend()
528 motg->pdata->otg_control == OTG_PMIC_CONTROL) msm_otg_suspend()
531 clk_disable_unprepare(motg->pclk); msm_otg_suspend()
532 clk_disable_unprepare(motg->clk); msm_otg_suspend()
533 if (!IS_ERR(motg->core_clk)) msm_otg_suspend()
534 clk_disable_unprepare(motg->core_clk); msm_otg_suspend()
536 if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY && msm_otg_suspend()
537 motg->pdata->otg_control == OTG_PMIC_CONTROL) { msm_otg_suspend()
538 msm_hsusb_ldo_set_mode(motg, 0); msm_otg_suspend()
539 msm_hsusb_config_vddcx(motg, 0); msm_otg_suspend()
543 enable_irq_wake(motg->irq); msm_otg_suspend()
547 atomic_set(&motg->in_lpm, 1); msm_otg_suspend()
548 enable_irq(motg->irq); msm_otg_suspend()
555 static int msm_otg_resume(struct msm_otg *motg) msm_otg_resume() argument
557 struct usb_phy *phy = &motg->phy; msm_otg_resume()
563 if (!atomic_read(&motg->in_lpm)) msm_otg_resume()
566 clk_prepare_enable(motg->pclk); msm_otg_resume()
567 clk_prepare_enable(motg->clk); msm_otg_resume()
568 if (!IS_ERR(motg->core_clk)) msm_otg_resume()
569 clk_prepare_enable(motg->core_clk); msm_otg_resume()
571 if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY && msm_otg_resume()
572 motg->pdata->otg_control == OTG_PMIC_CONTROL) { msm_otg_resume()
575 if (motg->phy_number) msm_otg_resume()
578 msm_hsusb_ldo_set_mode(motg, 1); msm_otg_resume()
579 msm_hsusb_config_vddcx(motg, 1); msm_otg_resume()
615 disable_irq_wake(motg->irq); msm_otg_resume()
619 atomic_set(&motg->in_lpm, 0); msm_otg_resume()
621 if (motg->async_int) { msm_otg_resume()
622 motg->async_int = 0; msm_otg_resume()
624 enable_irq(motg->irq); msm_otg_resume()
633 static void msm_otg_notify_charger(struct msm_otg *motg, unsigned mA) msm_otg_notify_charger() argument
635 if (motg->cur_power == mA) msm_otg_notify_charger()
639 dev_info(motg->phy.dev, "Avail curr from USB = %u\n", mA); msm_otg_notify_charger()
640 motg->cur_power = mA; msm_otg_notify_charger()
645 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); msm_otg_set_power() local
654 if (motg->chg_type == USB_SDP_CHARGER) msm_otg_set_power()
655 msm_otg_notify_charger(motg, mA); msm_otg_set_power()
662 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); msm_otg_start_host() local
663 struct msm_otg_platform_data *pdata = motg->pdata; msm_otg_start_host()
702 struct msm_otg *motg = container_of(otg->usb_phy, struct msm_otg, phy); msm_otg_set_host() local
709 if (motg->pdata->mode == USB_DR_MODE_PERIPHERAL) { msm_otg_set_host()
720 schedule_work(&motg->sm_work); msm_otg_set_host()
729 hcd->power_budget = motg->pdata->power_budget; msm_otg_set_host()
738 if (motg->pdata->mode == USB_DR_MODE_HOST || otg->gadget) { msm_otg_set_host()
740 schedule_work(&motg->sm_work); msm_otg_set_host()
748 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); msm_otg_start_peripheral() local
749 struct msm_otg_platform_data *pdata = motg->pdata; msm_otg_start_peripheral()
776 struct msm_otg *motg = container_of(otg->usb_phy, struct msm_otg, phy); msm_otg_set_peripheral() local
782 if (motg->pdata->mode == USB_DR_MODE_HOST) { msm_otg_set_peripheral()
793 schedule_work(&motg->sm_work); msm_otg_set_peripheral()
808 if (motg->pdata->mode == USB_DR_MODE_PERIPHERAL || otg->host) { msm_otg_set_peripheral()
810 schedule_work(&motg->sm_work); msm_otg_set_peripheral()
816 static bool msm_chg_check_secondary_det(struct msm_otg *motg) msm_chg_check_secondary_det() argument
818 struct usb_phy *phy = &motg->phy; msm_chg_check_secondary_det()
822 switch (motg->pdata->phy_type) { msm_chg_check_secondary_det()
837 static void msm_chg_enable_secondary_det(struct msm_otg *motg) msm_chg_enable_secondary_det() argument
839 struct usb_phy *phy = &motg->phy; msm_chg_enable_secondary_det()
842 switch (motg->pdata->phy_type) { msm_chg_enable_secondary_det()
877 static bool msm_chg_check_primary_det(struct msm_otg *motg) msm_chg_check_primary_det() argument
879 struct usb_phy *phy = &motg->phy; msm_chg_check_primary_det()
883 switch (motg->pdata->phy_type) { msm_chg_check_primary_det()
898 static void msm_chg_enable_primary_det(struct msm_otg *motg) msm_chg_enable_primary_det() argument
900 struct usb_phy *phy = &motg->phy; msm_chg_enable_primary_det()
903 switch (motg->pdata->phy_type) { msm_chg_enable_primary_det()
923 static bool msm_chg_check_dcd(struct msm_otg *motg) msm_chg_check_dcd() argument
925 struct usb_phy *phy = &motg->phy; msm_chg_check_dcd()
929 switch (motg->pdata->phy_type) { msm_chg_check_dcd()
944 static void msm_chg_disable_dcd(struct msm_otg *motg) msm_chg_disable_dcd() argument
946 struct usb_phy *phy = &motg->phy; msm_chg_disable_dcd()
949 switch (motg->pdata->phy_type) { msm_chg_disable_dcd()
963 static void msm_chg_enable_dcd(struct msm_otg *motg) msm_chg_enable_dcd() argument
965 struct usb_phy *phy = &motg->phy; msm_chg_enable_dcd()
968 switch (motg->pdata->phy_type) { msm_chg_enable_dcd()
984 static void msm_chg_block_on(struct msm_otg *motg) msm_chg_block_on() argument
986 struct usb_phy *phy = &motg->phy; msm_chg_block_on()
995 switch (motg->pdata->phy_type) { msm_chg_block_on()
1019 static void msm_chg_block_off(struct msm_otg *motg) msm_chg_block_off() argument
1021 struct usb_phy *phy = &motg->phy; msm_chg_block_off()
1024 switch (motg->pdata->phy_type) { msm_chg_block_off()
1055 struct msm_otg *motg = container_of(w, struct msm_otg, chg_work.work); msm_chg_detect_work() local
1056 struct usb_phy *phy = &motg->phy; msm_chg_detect_work()
1061 switch (motg->chg_state) { msm_chg_detect_work()
1064 msm_chg_block_on(motg); msm_chg_detect_work()
1065 msm_chg_enable_dcd(motg); msm_chg_detect_work()
1066 motg->chg_state = USB_CHG_STATE_WAIT_FOR_DCD; msm_chg_detect_work()
1067 motg->dcd_retries = 0; msm_chg_detect_work()
1071 is_dcd = msm_chg_check_dcd(motg); msm_chg_detect_work()
1072 tmout = ++motg->dcd_retries == MSM_CHG_DCD_MAX_RETRIES; msm_chg_detect_work()
1074 msm_chg_disable_dcd(motg); msm_chg_detect_work()
1075 msm_chg_enable_primary_det(motg); msm_chg_detect_work()
1077 motg->chg_state = USB_CHG_STATE_DCD_DONE; msm_chg_detect_work()
1083 vout = msm_chg_check_primary_det(motg); msm_chg_detect_work()
1085 msm_chg_enable_secondary_det(motg); msm_chg_detect_work()
1087 motg->chg_state = USB_CHG_STATE_PRIMARY_DONE; msm_chg_detect_work()
1089 motg->chg_type = USB_SDP_CHARGER; msm_chg_detect_work()
1090 motg->chg_state = USB_CHG_STATE_DETECTED; msm_chg_detect_work()
1095 vout = msm_chg_check_secondary_det(motg); msm_chg_detect_work()
1097 motg->chg_type = USB_DCP_CHARGER; msm_chg_detect_work()
1099 motg->chg_type = USB_CDP_CHARGER; msm_chg_detect_work()
1100 motg->chg_state = USB_CHG_STATE_SECONDARY_DONE; msm_chg_detect_work()
1103 motg->chg_state = USB_CHG_STATE_DETECTED; msm_chg_detect_work()
1105 msm_chg_block_off(motg); msm_chg_detect_work()
1106 dev_dbg(phy->dev, "charger = %d\n", motg->chg_type); msm_chg_detect_work()
1107 schedule_work(&motg->sm_work); msm_chg_detect_work()
1113 schedule_delayed_work(&motg->chg_work, delay); msm_chg_detect_work()
1123 static void msm_otg_init_sm(struct msm_otg *motg) msm_otg_init_sm() argument
1125 struct msm_otg_platform_data *pdata = motg->pdata; msm_otg_init_sm()
1132 set_bit(ID, &motg->inputs); msm_otg_init_sm()
1134 clear_bit(ID, &motg->inputs); msm_otg_init_sm()
1137 set_bit(B_SESS_VLD, &motg->inputs); msm_otg_init_sm()
1139 clear_bit(B_SESS_VLD, &motg->inputs); msm_otg_init_sm()
1141 set_bit(ID, &motg->inputs); msm_otg_init_sm()
1142 clear_bit(B_SESS_VLD, &motg->inputs); msm_otg_init_sm()
1146 clear_bit(ID, &motg->inputs); msm_otg_init_sm()
1149 set_bit(ID, &motg->inputs); msm_otg_init_sm()
1151 set_bit(B_SESS_VLD, &motg->inputs); msm_otg_init_sm()
1153 clear_bit(B_SESS_VLD, &motg->inputs); msm_otg_init_sm()
1162 struct msm_otg *motg = container_of(w, struct msm_otg, sm_work); msm_otg_sm_work() local
1163 struct usb_otg *otg = motg->phy.otg; msm_otg_sm_work()
1169 msm_otg_init_sm(motg); msm_otg_sm_work()
1174 if (!test_bit(ID, &motg->inputs) && otg->host) { msm_otg_sm_work()
1179 } else if (test_bit(B_SESS_VLD, &motg->inputs)) { msm_otg_sm_work()
1180 switch (motg->chg_state) { msm_otg_sm_work()
1182 msm_chg_detect_work(&motg->chg_work.work); msm_otg_sm_work()
1185 switch (motg->chg_type) { msm_otg_sm_work()
1187 msm_otg_notify_charger(motg, msm_otg_sm_work()
1191 msm_otg_notify_charger(motg, msm_otg_sm_work()
1199 msm_otg_notify_charger(motg, IUNIT); msm_otg_sm_work()
1218 if (cancel_delayed_work_sync(&motg->chg_work)) { msm_otg_sm_work()
1222 msm_otg_notify_charger(motg, 0); msm_otg_sm_work()
1223 motg->chg_state = USB_CHG_STATE_UNDEFINED; msm_otg_sm_work()
1224 motg->chg_type = USB_INVALID_CHARGER; msm_otg_sm_work()
1232 if (!test_bit(B_SESS_VLD, &motg->inputs) || msm_otg_sm_work()
1233 !test_bit(ID, &motg->inputs)) { msm_otg_sm_work()
1234 msm_otg_notify_charger(motg, 0); msm_otg_sm_work()
1236 motg->chg_state = USB_CHG_STATE_UNDEFINED; msm_otg_sm_work()
1237 motg->chg_type = USB_INVALID_CHARGER; msm_otg_sm_work()
1245 if (test_bit(ID, &motg->inputs)) { msm_otg_sm_work()
1259 struct msm_otg *motg = data; msm_otg_irq() local
1260 struct usb_phy *phy = &motg->phy; msm_otg_irq()
1263 if (atomic_read(&motg->in_lpm)) { msm_otg_irq()
1265 motg->async_int = 1; msm_otg_irq()
1276 set_bit(ID, &motg->inputs); msm_otg_irq()
1278 clear_bit(ID, &motg->inputs); msm_otg_irq()
1283 set_bit(B_SESS_VLD, &motg->inputs); msm_otg_irq()
1285 clear_bit(B_SESS_VLD, &motg->inputs); msm_otg_irq()
1291 schedule_work(&motg->sm_work); msm_otg_irq()
1297 struct msm_otg *motg = s->private; msm_otg_mode_show() local
1298 struct usb_otg *otg = motg->phy.otg; msm_otg_mode_show()
1324 struct msm_otg *motg = s->private; msm_otg_mode_write() local
1326 struct usb_otg *otg = motg->phy.otg; msm_otg_mode_write()
1353 set_bit(ID, &motg->inputs); msm_otg_mode_write()
1354 clear_bit(B_SESS_VLD, &motg->inputs); msm_otg_mode_write()
1364 set_bit(ID, &motg->inputs); msm_otg_mode_write()
1365 set_bit(B_SESS_VLD, &motg->inputs); msm_otg_mode_write()
1375 clear_bit(ID, &motg->inputs); msm_otg_mode_write()
1386 schedule_work(&motg->sm_work); msm_otg_mode_write()
1402 static int msm_otg_debugfs_init(struct msm_otg *motg) msm_otg_debugfs_init() argument
1410 msm_otg_dbg_root, motg, &msm_otg_mode_fops); msm_otg_debugfs_init()
1439 static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) msm_otg_read_dt() argument
1452 motg->pdata = pdata; msm_otg_read_dt()
1457 motg->link_rst = devm_reset_control_get(&pdev->dev, "link"); msm_otg_read_dt()
1458 if (IS_ERR(motg->link_rst)) msm_otg_read_dt()
1459 return PTR_ERR(motg->link_rst); msm_otg_read_dt()
1461 motg->phy_rst = devm_reset_control_get(&pdev->dev, "phy"); msm_otg_read_dt()
1462 if (IS_ERR(motg->phy_rst)) msm_otg_read_dt()
1463 motg->phy_rst = NULL; msm_otg_read_dt()
1475 motg->phy_number = val; msm_otg_read_dt()
1477 motg->vdd_levels[VDD_LEVEL_NONE] = USB_PHY_SUSP_DIG_VOL; msm_otg_read_dt()
1478 motg->vdd_levels[VDD_LEVEL_MIN] = USB_PHY_VDD_DIG_VOL_MIN; msm_otg_read_dt()
1479 motg->vdd_levels[VDD_LEVEL_MAX] = USB_PHY_VDD_DIG_VOL_MAX; msm_otg_read_dt()
1485 motg->vdd_levels[VDD_LEVEL_NONE] = tmp[VDD_LEVEL_NONE]; msm_otg_read_dt()
1486 motg->vdd_levels[VDD_LEVEL_MIN] = tmp[VDD_LEVEL_MIN]; msm_otg_read_dt()
1487 motg->vdd_levels[VDD_LEVEL_MAX] = tmp[VDD_LEVEL_MAX]; msm_otg_read_dt()
1520 struct msm_otg *motg; msm_otg_probe() local
1524 motg = devm_kzalloc(&pdev->dev, sizeof(struct msm_otg), GFP_KERNEL); msm_otg_probe()
1525 if (!motg) msm_otg_probe()
1532 ret = msm_otg_read_dt(pdev, motg); msm_otg_probe()
1537 motg->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg), msm_otg_probe()
1539 if (!motg->phy.otg) msm_otg_probe()
1542 phy = &motg->phy; msm_otg_probe()
1545 motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk"); msm_otg_probe()
1546 if (IS_ERR(motg->clk)) { msm_otg_probe()
1548 return PTR_ERR(motg->clk); msm_otg_probe()
1557 motg->pclk = devm_clk_get(&pdev->dev, np ? "iface" : "usb_hs_pclk"); msm_otg_probe()
1558 if (IS_ERR(motg->pclk)) { msm_otg_probe()
1560 return PTR_ERR(motg->pclk); msm_otg_probe()
1568 motg->core_clk = devm_clk_get(&pdev->dev, msm_otg_probe()
1574 motg->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res)); msm_otg_probe()
1575 if (!motg->regs) msm_otg_probe()
1583 if (motg->phy_number) { msm_otg_probe()
1591 dev_info(&pdev->dev, "OTG regs = %p\n", motg->regs); msm_otg_probe()
1593 motg->irq = platform_get_irq(pdev, 0); msm_otg_probe()
1594 if (motg->irq < 0) { msm_otg_probe()
1596 return motg->irq; msm_otg_probe()
1603 ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(regs), regs); msm_otg_probe()
1607 motg->vddcx = regs[0].consumer; msm_otg_probe()
1608 motg->v3p3 = regs[1].consumer; msm_otg_probe()
1609 motg->v1p8 = regs[2].consumer; msm_otg_probe()
1611 clk_set_rate(motg->clk, 60000000); msm_otg_probe()
1613 clk_prepare_enable(motg->clk); msm_otg_probe()
1614 clk_prepare_enable(motg->pclk); msm_otg_probe()
1616 if (!IS_ERR(motg->core_clk)) msm_otg_probe()
1617 clk_prepare_enable(motg->core_clk); msm_otg_probe()
1619 ret = msm_hsusb_init_vddcx(motg, 1); msm_otg_probe()
1625 ret = msm_hsusb_ldo_init(motg, 1); msm_otg_probe()
1630 ret = msm_hsusb_ldo_set_mode(motg, 1); msm_otg_probe()
1639 INIT_WORK(&motg->sm_work, msm_otg_sm_work); msm_otg_probe()
1640 INIT_DELAYED_WORK(&motg->chg_work, msm_chg_detect_work); msm_otg_probe()
1641 ret = devm_request_irq(&pdev->dev, motg->irq, msm_otg_irq, IRQF_SHARED, msm_otg_probe()
1642 "msm_otg", motg); msm_otg_probe()
1655 phy->otg->usb_phy = &motg->phy; msm_otg_probe()
1661 ret = usb_add_phy_dev(&motg->phy); msm_otg_probe()
1667 platform_set_drvdata(pdev, motg); msm_otg_probe()
1670 if (motg->pdata->mode == USB_DR_MODE_OTG && msm_otg_probe()
1671 motg->pdata->otg_control == OTG_USER_CONTROL) { msm_otg_probe()
1672 ret = msm_otg_debugfs_init(motg); msm_otg_probe()
1683 msm_hsusb_ldo_init(motg, 0); msm_otg_probe()
1685 msm_hsusb_init_vddcx(motg, 0); msm_otg_probe()
1687 clk_disable_unprepare(motg->pclk); msm_otg_probe()
1688 clk_disable_unprepare(motg->clk); msm_otg_probe()
1689 if (!IS_ERR(motg->core_clk)) msm_otg_probe()
1690 clk_disable_unprepare(motg->core_clk); msm_otg_probe()
1696 struct msm_otg *motg = platform_get_drvdata(pdev); msm_otg_remove() local
1697 struct usb_phy *phy = &motg->phy; msm_otg_remove()
1704 cancel_delayed_work_sync(&motg->chg_work); msm_otg_remove()
1705 cancel_work_sync(&motg->sm_work); msm_otg_remove()
1713 disable_irq(motg->irq); msm_otg_remove()
1731 clk_disable_unprepare(motg->pclk); msm_otg_remove()
1732 clk_disable_unprepare(motg->clk); msm_otg_remove()
1733 if (!IS_ERR(motg->core_clk)) msm_otg_remove()
1734 clk_disable_unprepare(motg->core_clk); msm_otg_remove()
1735 msm_hsusb_ldo_init(motg, 0); msm_otg_remove()
1745 struct msm_otg *motg = dev_get_drvdata(dev); msm_otg_runtime_idle() local
1746 struct usb_otg *otg = motg->phy.otg; msm_otg_runtime_idle()
1764 struct msm_otg *motg = dev_get_drvdata(dev); msm_otg_runtime_suspend() local
1767 return msm_otg_suspend(motg); msm_otg_runtime_suspend()
1772 struct msm_otg *motg = dev_get_drvdata(dev); msm_otg_runtime_resume() local
1775 return msm_otg_resume(motg); msm_otg_runtime_resume()
1782 struct msm_otg *motg = dev_get_drvdata(dev); msm_otg_pm_suspend() local
1785 return msm_otg_suspend(motg); msm_otg_pm_suspend()
1790 struct msm_otg *motg = dev_get_drvdata(dev); msm_otg_pm_resume() local
1795 ret = msm_otg_resume(motg); msm_otg_pm_resume()

Completed in 105 milliseconds