Lines Matching refs:ab
150 static void ab8500_usb_wd_workaround(struct ab8500_usb *ab) in ab8500_usb_wd_workaround() argument
152 abx500_set_register_interruptible(ab->dev, in ab8500_usb_wd_workaround()
159 abx500_set_register_interruptible(ab->dev, in ab8500_usb_wd_workaround()
167 abx500_set_register_interruptible(ab->dev, in ab8500_usb_wd_workaround()
173 static void ab8500_usb_regulator_enable(struct ab8500_usb *ab) in ab8500_usb_regulator_enable() argument
177 ret = regulator_enable(ab->v_ape); in ab8500_usb_regulator_enable()
179 dev_err(ab->dev, "Failed to enable v-ape\n"); in ab8500_usb_regulator_enable()
181 if (ab->flags & AB8500_USB_FLAG_REGULATOR_SET_VOLTAGE) { in ab8500_usb_regulator_enable()
182 ab->saved_v_ulpi = regulator_get_voltage(ab->v_ulpi); in ab8500_usb_regulator_enable()
183 if (ab->saved_v_ulpi < 0) in ab8500_usb_regulator_enable()
184 dev_err(ab->dev, "Failed to get v_ulpi voltage\n"); in ab8500_usb_regulator_enable()
186 ret = regulator_set_voltage(ab->v_ulpi, 1300000, 1350000); in ab8500_usb_regulator_enable()
188 dev_err(ab->dev, "Failed to set the Vintcore to 1.3V, ret=%d\n", in ab8500_usb_regulator_enable()
191 ret = regulator_set_load(ab->v_ulpi, 28000); in ab8500_usb_regulator_enable()
193 dev_err(ab->dev, "Failed to set optimum mode (ret=%d)\n", in ab8500_usb_regulator_enable()
197 ret = regulator_enable(ab->v_ulpi); in ab8500_usb_regulator_enable()
199 dev_err(ab->dev, "Failed to enable vddulpivio18\n"); in ab8500_usb_regulator_enable()
201 if (ab->flags & AB8500_USB_FLAG_REGULATOR_SET_VOLTAGE) { in ab8500_usb_regulator_enable()
202 volt = regulator_get_voltage(ab->v_ulpi); in ab8500_usb_regulator_enable()
204 dev_err(ab->dev, "Vintcore is not set to 1.3V volt=%d\n", in ab8500_usb_regulator_enable()
208 ret = regulator_enable(ab->v_musb); in ab8500_usb_regulator_enable()
210 dev_err(ab->dev, "Failed to enable musb_1v8\n"); in ab8500_usb_regulator_enable()
213 static void ab8500_usb_regulator_disable(struct ab8500_usb *ab) in ab8500_usb_regulator_disable() argument
217 regulator_disable(ab->v_musb); in ab8500_usb_regulator_disable()
219 regulator_disable(ab->v_ulpi); in ab8500_usb_regulator_disable()
222 if (ab->flags & AB8500_USB_FLAG_REGULATOR_SET_VOLTAGE) { in ab8500_usb_regulator_disable()
223 if (ab->saved_v_ulpi > 0) { in ab8500_usb_regulator_disable()
224 ret = regulator_set_voltage(ab->v_ulpi, in ab8500_usb_regulator_disable()
225 ab->saved_v_ulpi, ab->saved_v_ulpi); in ab8500_usb_regulator_disable()
227 dev_err(ab->dev, "Failed to set the Vintcore to %duV, ret=%d\n", in ab8500_usb_regulator_disable()
228 ab->saved_v_ulpi, ret); in ab8500_usb_regulator_disable()
231 ret = regulator_set_load(ab->v_ulpi, 0); in ab8500_usb_regulator_disable()
233 dev_err(ab->dev, "Failed to set optimum mode (ret=%d)\n", in ab8500_usb_regulator_disable()
237 regulator_disable(ab->v_ape); in ab8500_usb_regulator_disable()
240 static void ab8500_usb_wd_linkstatus(struct ab8500_usb *ab, u8 bit) in ab8500_usb_wd_linkstatus() argument
243 if (is_ab8500_2p0(ab->ab8500)) { in ab8500_usb_wd_linkstatus()
244 abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_wd_linkstatus()
251 static void ab8500_usb_phy_enable(struct ab8500_usb *ab, bool sel_host) in ab8500_usb_phy_enable() argument
258 ab->pinctrl = pinctrl_get_select(ab->dev, PINCTRL_STATE_DEFAULT); in ab8500_usb_phy_enable()
259 if (IS_ERR(ab->pinctrl)) in ab8500_usb_phy_enable()
260 dev_err(ab->dev, "could not get/set default pinstate\n"); in ab8500_usb_phy_enable()
262 if (clk_prepare_enable(ab->sysclk)) in ab8500_usb_phy_enable()
263 dev_err(ab->dev, "can't prepare/enable clock\n"); in ab8500_usb_phy_enable()
265 ab8500_usb_regulator_enable(ab); in ab8500_usb_phy_enable()
267 abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_phy_enable()
272 static void ab8500_usb_phy_disable(struct ab8500_usb *ab, bool sel_host) in ab8500_usb_phy_disable() argument
278 ab8500_usb_wd_linkstatus(ab, bit); in ab8500_usb_phy_disable()
280 abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_phy_disable()
285 ab8500_usb_wd_workaround(ab); in ab8500_usb_phy_disable()
287 clk_disable_unprepare(ab->sysclk); in ab8500_usb_phy_disable()
289 ab8500_usb_regulator_disable(ab); in ab8500_usb_phy_disable()
291 if (!IS_ERR(ab->pinctrl)) { in ab8500_usb_phy_disable()
293 ab->pins_sleep = pinctrl_lookup_state(ab->pinctrl, in ab8500_usb_phy_disable()
296 if (IS_ERR(ab->pins_sleep)) in ab8500_usb_phy_disable()
297 dev_dbg(ab->dev, "could not get sleep pinstate\n"); in ab8500_usb_phy_disable()
298 else if (pinctrl_select_state(ab->pinctrl, ab->pins_sleep)) in ab8500_usb_phy_disable()
299 dev_err(ab->dev, "could not set pins to sleep state\n"); in ab8500_usb_phy_disable()
305 pinctrl_put(ab->pinctrl); in ab8500_usb_phy_disable()
309 #define ab8500_usb_host_phy_en(ab) ab8500_usb_phy_enable(ab, true) argument
310 #define ab8500_usb_host_phy_dis(ab) ab8500_usb_phy_disable(ab, true) argument
311 #define ab8500_usb_peri_phy_en(ab) ab8500_usb_phy_enable(ab, false) argument
312 #define ab8500_usb_peri_phy_dis(ab) ab8500_usb_phy_disable(ab, false) argument
314 static int ab8505_usb_link_status_update(struct ab8500_usb *ab, in ab8505_usb_link_status_update() argument
319 dev_dbg(ab->dev, "ab8505_usb_link_status_update %d\n", lsts); in ab8505_usb_link_status_update()
325 if (ab->previous_link_status_state == USB_LINK_ACA_RID_A_8505 && in ab8505_usb_link_status_update()
329 ab->previous_link_status_state = lsts; in ab8505_usb_link_status_update()
340 ab->mode = USB_IDLE; in ab8505_usb_link_status_update()
341 ab->phy.otg->default_a = false; in ab8505_usb_link_status_update()
342 ab->vbus_draw = 0; in ab8505_usb_link_status_update()
349 ab->phy.otg->state = OTG_STATE_B_IDLE; in ab8505_usb_link_status_update()
350 usb_phy_set_event(&ab->phy, USB_EVENT_NONE); in ab8505_usb_link_status_update()
360 if (ab->mode == USB_IDLE) { in ab8505_usb_link_status_update()
361 ab->mode = USB_PERIPHERAL; in ab8505_usb_link_status_update()
362 ab8500_usb_peri_phy_en(ab); in ab8505_usb_link_status_update()
363 atomic_notifier_call_chain(&ab->phy.notifier, in ab8505_usb_link_status_update()
364 UX500_MUSB_PREPARE, &ab->vbus_draw); in ab8505_usb_link_status_update()
365 usb_phy_set_event(&ab->phy, USB_EVENT_ENUMERATED); in ab8505_usb_link_status_update()
376 if (ab->mode == USB_IDLE) { in ab8505_usb_link_status_update()
377 ab->mode = USB_HOST; in ab8505_usb_link_status_update()
378 ab8500_usb_host_phy_en(ab); in ab8505_usb_link_status_update()
379 atomic_notifier_call_chain(&ab->phy.notifier, in ab8505_usb_link_status_update()
380 UX500_MUSB_PREPARE, &ab->vbus_draw); in ab8505_usb_link_status_update()
382 ab->phy.otg->default_a = true; in ab8505_usb_link_status_update()
385 atomic_notifier_call_chain(&ab->phy.notifier, in ab8505_usb_link_status_update()
386 event, &ab->vbus_draw); in ab8505_usb_link_status_update()
390 ab->mode = USB_DEDICATED_CHG; in ab8505_usb_link_status_update()
392 atomic_notifier_call_chain(&ab->phy.notifier, in ab8505_usb_link_status_update()
393 event, &ab->vbus_draw); in ab8505_usb_link_status_update()
394 usb_phy_set_event(&ab->phy, USB_EVENT_CHARGER); in ab8505_usb_link_status_update()
408 if (ab->mode == USB_IDLE) { in ab8505_usb_link_status_update()
409 ab->mode = USB_UART; in ab8505_usb_link_status_update()
410 ab8500_usb_peri_phy_en(ab); in ab8505_usb_link_status_update()
422 static int ab8500_usb_link_status_update(struct ab8500_usb *ab, in ab8500_usb_link_status_update() argument
427 dev_dbg(ab->dev, "ab8500_usb_link_status_update %d\n", lsts); in ab8500_usb_link_status_update()
433 if (ab->previous_link_status_state == USB_LINK_HM_IDGND_8500 && in ab8500_usb_link_status_update()
438 if (ab->previous_link_status_state == USB_LINK_ACA_RID_A_8500 && in ab8500_usb_link_status_update()
442 ab->previous_link_status_state = lsts; in ab8500_usb_link_status_update()
450 ab->mode = USB_IDLE; in ab8500_usb_link_status_update()
451 ab->phy.otg->default_a = false; in ab8500_usb_link_status_update()
452 ab->vbus_draw = 0; in ab8500_usb_link_status_update()
456 ab->phy.otg->state = OTG_STATE_B_IDLE; in ab8500_usb_link_status_update()
457 usb_phy_set_event(&ab->phy, USB_EVENT_NONE); in ab8500_usb_link_status_update()
471 if (ab->mode == USB_IDLE) { in ab8500_usb_link_status_update()
472 ab->mode = USB_PERIPHERAL; in ab8500_usb_link_status_update()
473 ab8500_usb_peri_phy_en(ab); in ab8500_usb_link_status_update()
474 atomic_notifier_call_chain(&ab->phy.notifier, in ab8500_usb_link_status_update()
475 UX500_MUSB_PREPARE, &ab->vbus_draw); in ab8500_usb_link_status_update()
476 usb_phy_set_event(&ab->phy, USB_EVENT_ENUMERATED); in ab8500_usb_link_status_update()
486 if (ab->mode == USB_IDLE) { in ab8500_usb_link_status_update()
487 ab->mode = USB_HOST; in ab8500_usb_link_status_update()
488 ab8500_usb_host_phy_en(ab); in ab8500_usb_link_status_update()
489 atomic_notifier_call_chain(&ab->phy.notifier, in ab8500_usb_link_status_update()
490 UX500_MUSB_PREPARE, &ab->vbus_draw); in ab8500_usb_link_status_update()
492 ab->phy.otg->default_a = true; in ab8500_usb_link_status_update()
495 atomic_notifier_call_chain(&ab->phy.notifier, in ab8500_usb_link_status_update()
496 event, &ab->vbus_draw); in ab8500_usb_link_status_update()
500 ab->mode = USB_DEDICATED_CHG; in ab8500_usb_link_status_update()
502 atomic_notifier_call_chain(&ab->phy.notifier, in ab8500_usb_link_status_update()
503 event, &ab->vbus_draw); in ab8500_usb_link_status_update()
504 usb_phy_set_event(&ab->phy, USB_EVENT_CHARGER); in ab8500_usb_link_status_update()
525 static int abx500_usb_link_status_update(struct ab8500_usb *ab) in abx500_usb_link_status_update() argument
530 if (is_ab8500(ab->ab8500)) { in abx500_usb_link_status_update()
533 ret = abx500_get_register_interruptible(ab->dev, in abx500_usb_link_status_update()
538 ret = ab8500_usb_link_status_update(ab, lsts); in abx500_usb_link_status_update()
539 } else if (is_ab8505(ab->ab8500)) { in abx500_usb_link_status_update()
542 ret = abx500_get_register_interruptible(ab->dev, in abx500_usb_link_status_update()
547 ret = ab8505_usb_link_status_update(ab, lsts); in abx500_usb_link_status_update()
564 struct ab8500_usb *ab = (struct ab8500_usb *) data; in ab8500_usb_disconnect_irq() local
568 if (ab->mode == USB_HOST) { in ab8500_usb_disconnect_irq()
569 ab->phy.otg->default_a = false; in ab8500_usb_disconnect_irq()
570 ab->vbus_draw = 0; in ab8500_usb_disconnect_irq()
571 atomic_notifier_call_chain(&ab->phy.notifier, in ab8500_usb_disconnect_irq()
572 event, &ab->vbus_draw); in ab8500_usb_disconnect_irq()
573 ab8500_usb_host_phy_dis(ab); in ab8500_usb_disconnect_irq()
574 ab->mode = USB_IDLE; in ab8500_usb_disconnect_irq()
577 if (ab->mode == USB_PERIPHERAL) { in ab8500_usb_disconnect_irq()
578 atomic_notifier_call_chain(&ab->phy.notifier, in ab8500_usb_disconnect_irq()
579 event, &ab->vbus_draw); in ab8500_usb_disconnect_irq()
580 ab8500_usb_peri_phy_dis(ab); in ab8500_usb_disconnect_irq()
581 atomic_notifier_call_chain(&ab->phy.notifier, in ab8500_usb_disconnect_irq()
582 UX500_MUSB_CLEAN, &ab->vbus_draw); in ab8500_usb_disconnect_irq()
583 ab->mode = USB_IDLE; in ab8500_usb_disconnect_irq()
584 ab->phy.otg->default_a = false; in ab8500_usb_disconnect_irq()
585 ab->vbus_draw = 0; in ab8500_usb_disconnect_irq()
588 if (ab->mode == USB_UART) { in ab8500_usb_disconnect_irq()
589 ab8500_usb_peri_phy_dis(ab); in ab8500_usb_disconnect_irq()
590 ab->mode = USB_IDLE; in ab8500_usb_disconnect_irq()
593 if (is_ab8500_2p0(ab->ab8500)) { in ab8500_usb_disconnect_irq()
594 if (ab->mode == USB_DEDICATED_CHG) { in ab8500_usb_disconnect_irq()
595 ab8500_usb_wd_linkstatus(ab, in ab8500_usb_disconnect_irq()
597 abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_disconnect_irq()
608 struct ab8500_usb *ab = (struct ab8500_usb *)data; in ab8500_usb_link_status_irq() local
610 abx500_usb_link_status_update(ab); in ab8500_usb_link_status_irq()
617 struct ab8500_usb *ab = container_of(work, struct ab8500_usb, in ab8500_usb_phy_disable_work() local
620 if (!ab->phy.otg->host) in ab8500_usb_phy_disable_work()
621 ab8500_usb_host_phy_dis(ab); in ab8500_usb_phy_disable_work()
623 if (!ab->phy.otg->gadget) in ab8500_usb_phy_disable_work()
624 ab8500_usb_peri_phy_dis(ab); in ab8500_usb_phy_disable_work()
636 struct ab8500_usb *ab; in ab8500_usb_set_peripheral() local
641 ab = phy_to_ab(otg->usb_phy); in ab8500_usb_set_peripheral()
643 ab->phy.otg->gadget = gadget; in ab8500_usb_set_peripheral()
650 if ((ab->mode != USB_IDLE) && !gadget) { in ab8500_usb_set_peripheral()
651 ab->mode = USB_IDLE; in ab8500_usb_set_peripheral()
652 schedule_work(&ab->phy_dis_work); in ab8500_usb_set_peripheral()
660 struct ab8500_usb *ab; in ab8500_usb_set_host() local
665 ab = phy_to_ab(otg->usb_phy); in ab8500_usb_set_host()
667 ab->phy.otg->host = host; in ab8500_usb_set_host()
674 if ((ab->mode != USB_IDLE) && !host) { in ab8500_usb_set_host()
675 ab->mode = USB_IDLE; in ab8500_usb_set_host()
676 schedule_work(&ab->phy_dis_work); in ab8500_usb_set_host()
682 static void ab8500_usb_restart_phy(struct ab8500_usb *ab) in ab8500_usb_restart_phy() argument
684 abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_restart_phy()
691 abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_restart_phy()
696 abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_restart_phy()
703 abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_restart_phy()
709 static int ab8500_usb_regulator_get(struct ab8500_usb *ab) in ab8500_usb_regulator_get() argument
713 ab->v_ape = devm_regulator_get(ab->dev, "v-ape"); in ab8500_usb_regulator_get()
714 if (IS_ERR(ab->v_ape)) { in ab8500_usb_regulator_get()
715 dev_err(ab->dev, "Could not get v-ape supply\n"); in ab8500_usb_regulator_get()
716 err = PTR_ERR(ab->v_ape); in ab8500_usb_regulator_get()
720 ab->v_ulpi = devm_regulator_get(ab->dev, "vddulpivio18"); in ab8500_usb_regulator_get()
721 if (IS_ERR(ab->v_ulpi)) { in ab8500_usb_regulator_get()
722 dev_err(ab->dev, "Could not get vddulpivio18 supply\n"); in ab8500_usb_regulator_get()
723 err = PTR_ERR(ab->v_ulpi); in ab8500_usb_regulator_get()
727 ab->v_musb = devm_regulator_get(ab->dev, "musb_1v8"); in ab8500_usb_regulator_get()
728 if (IS_ERR(ab->v_musb)) { in ab8500_usb_regulator_get()
729 dev_err(ab->dev, "Could not get musb_1v8 supply\n"); in ab8500_usb_regulator_get()
730 err = PTR_ERR(ab->v_musb); in ab8500_usb_regulator_get()
738 struct ab8500_usb *ab) in ab8500_usb_irq_setup() argument
743 if (ab->flags & AB8500_USB_FLAG_USE_LINK_STATUS_IRQ) { in ab8500_usb_irq_setup()
750 "usb-link-status", ab); in ab8500_usb_irq_setup()
752 dev_err(ab->dev, "request_irq failed for link status irq\n"); in ab8500_usb_irq_setup()
757 if (ab->flags & AB8500_USB_FLAG_USE_ID_WAKEUP_IRQ) { in ab8500_usb_irq_setup()
764 "usb-id-fall", ab); in ab8500_usb_irq_setup()
766 dev_err(ab->dev, "request_irq failed for ID fall irq\n"); in ab8500_usb_irq_setup()
771 if (ab->flags & AB8500_USB_FLAG_USE_VBUS_DET_IRQ) { in ab8500_usb_irq_setup()
778 "usb-vbus-fall", ab); in ab8500_usb_irq_setup()
780 dev_err(ab->dev, "request_irq failed for Vbus fall irq\n"); in ab8500_usb_irq_setup()
788 static void ab8500_usb_set_ab8500_tuning_values(struct ab8500_usb *ab) in ab8500_usb_set_ab8500_tuning_values() argument
793 err = abx500_set_register_interruptible(ab->dev, in ab8500_usb_set_ab8500_tuning_values()
796 dev_err(ab->dev, "Failed to enable bank12 access err=%d\n", in ab8500_usb_set_ab8500_tuning_values()
799 err = abx500_set_register_interruptible(ab->dev, in ab8500_usb_set_ab8500_tuning_values()
802 dev_err(ab->dev, "Failed to set PHY_TUNE1 register err=%d\n", in ab8500_usb_set_ab8500_tuning_values()
805 err = abx500_set_register_interruptible(ab->dev, in ab8500_usb_set_ab8500_tuning_values()
808 dev_err(ab->dev, "Failed to set PHY_TUNE2 register err=%d\n", in ab8500_usb_set_ab8500_tuning_values()
811 err = abx500_set_register_interruptible(ab->dev, in ab8500_usb_set_ab8500_tuning_values()
814 dev_err(ab->dev, "Failed to set PHY_TUNE3 register err=%d\n", in ab8500_usb_set_ab8500_tuning_values()
818 err = abx500_set_register_interruptible(ab->dev, in ab8500_usb_set_ab8500_tuning_values()
821 dev_err(ab->dev, "Failed to switch bank12 access err=%d\n", in ab8500_usb_set_ab8500_tuning_values()
825 static void ab8500_usb_set_ab8505_tuning_values(struct ab8500_usb *ab) in ab8500_usb_set_ab8505_tuning_values() argument
830 err = abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_set_ab8505_tuning_values()
834 dev_err(ab->dev, "Failed to enable bank12 access err=%d\n", in ab8500_usb_set_ab8505_tuning_values()
837 err = abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_set_ab8505_tuning_values()
841 dev_err(ab->dev, "Failed to set PHY_TUNE1 register err=%d\n", in ab8500_usb_set_ab8505_tuning_values()
844 err = abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_set_ab8505_tuning_values()
848 dev_err(ab->dev, "Failed to set PHY_TUNE2 register err=%d\n", in ab8500_usb_set_ab8505_tuning_values()
851 err = abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_set_ab8505_tuning_values()
856 dev_err(ab->dev, "Failed to set PHY_TUNE3 register err=%d\n", in ab8500_usb_set_ab8505_tuning_values()
860 err = abx500_mask_and_set_register_interruptible(ab->dev, in ab8500_usb_set_ab8505_tuning_values()
864 dev_err(ab->dev, "Failed to switch bank12 access err=%d\n", in ab8500_usb_set_ab8505_tuning_values()
870 struct ab8500_usb *ab; in ab8500_usb_probe() local
884 ab = devm_kzalloc(&pdev->dev, sizeof(*ab), GFP_KERNEL); in ab8500_usb_probe()
885 if (!ab) in ab8500_usb_probe()
892 ab->dev = &pdev->dev; in ab8500_usb_probe()
893 ab->ab8500 = ab8500; in ab8500_usb_probe()
894 ab->phy.dev = ab->dev; in ab8500_usb_probe()
895 ab->phy.otg = otg; in ab8500_usb_probe()
896 ab->phy.label = "ab8500"; in ab8500_usb_probe()
897 ab->phy.set_suspend = ab8500_usb_set_suspend; in ab8500_usb_probe()
898 ab->phy.otg->state = OTG_STATE_UNDEFINED; in ab8500_usb_probe()
900 otg->usb_phy = &ab->phy; in ab8500_usb_probe()
904 if (is_ab8500(ab->ab8500)) { in ab8500_usb_probe()
905 ab->flags |= AB8500_USB_FLAG_USE_LINK_STATUS_IRQ | in ab8500_usb_probe()
909 } else if (is_ab8505(ab->ab8500)) { in ab8500_usb_probe()
910 ab->flags |= AB8500_USB_FLAG_USE_LINK_STATUS_IRQ | in ab8500_usb_probe()
917 if (is_ab8500_2p0_or_earlier(ab->ab8500)) in ab8500_usb_probe()
918 ab->flags &= ~AB8500_USB_FLAG_REGULATOR_SET_VOLTAGE; in ab8500_usb_probe()
920 platform_set_drvdata(pdev, ab); in ab8500_usb_probe()
923 INIT_WORK(&ab->phy_dis_work, ab8500_usb_phy_disable_work); in ab8500_usb_probe()
925 err = ab8500_usb_regulator_get(ab); in ab8500_usb_probe()
929 ab->sysclk = devm_clk_get(ab->dev, "sysclk"); in ab8500_usb_probe()
930 if (IS_ERR(ab->sysclk)) { in ab8500_usb_probe()
931 dev_err(ab->dev, "Could not get sysclk.\n"); in ab8500_usb_probe()
932 return PTR_ERR(ab->sysclk); in ab8500_usb_probe()
935 err = ab8500_usb_irq_setup(pdev, ab); in ab8500_usb_probe()
939 err = usb_add_phy(&ab->phy, USB_PHY_TYPE_USB2); in ab8500_usb_probe()
945 if (is_ab8500(ab->ab8500) && !is_ab8500_2p0_or_earlier(ab->ab8500)) in ab8500_usb_probe()
947 ab8500_usb_set_ab8500_tuning_values(ab); in ab8500_usb_probe()
948 else if (is_ab8505(ab->ab8500)) in ab8500_usb_probe()
950 ab8500_usb_set_ab8505_tuning_values(ab); in ab8500_usb_probe()
953 ab8500_usb_wd_workaround(ab); in ab8500_usb_probe()
959 ab8500_usb_restart_phy(ab); in ab8500_usb_probe()
961 abx500_usb_link_status_update(ab); in ab8500_usb_probe()
970 struct ab8500_usb *ab = platform_get_drvdata(pdev); in ab8500_usb_remove() local
972 cancel_work_sync(&ab->phy_dis_work); in ab8500_usb_remove()
974 usb_remove_phy(&ab->phy); in ab8500_usb_remove()
976 if (ab->mode == USB_HOST) in ab8500_usb_remove()
977 ab8500_usb_host_phy_dis(ab); in ab8500_usb_remove()
978 else if (ab->mode == USB_PERIPHERAL) in ab8500_usb_remove()
979 ab8500_usb_peri_phy_dis(ab); in ab8500_usb_remove()