Lines Matching refs:phy
84 dev_err(motg->phy.dev, "Cannot set vddcx voltage\n"); in msm_hsusb_init_vddcx()
90 dev_err(motg->phy.dev, "unable to enable hsusb vddcx\n"); in msm_hsusb_init_vddcx()
95 dev_err(motg->phy.dev, "Cannot set vddcx voltage\n"); in msm_hsusb_init_vddcx()
98 dev_err(motg->phy.dev, "unable to disable hsusb vddcx\n"); in msm_hsusb_init_vddcx()
112 dev_err(motg->phy.dev, "Cannot set v3p3 voltage\n"); in msm_hsusb_ldo_init()
117 dev_err(motg->phy.dev, "unable to enable the hsusb 3p3\n"); in msm_hsusb_ldo_init()
123 dev_err(motg->phy.dev, "Cannot set v1p8 voltage\n"); in msm_hsusb_ldo_init()
128 dev_err(motg->phy.dev, "unable to enable the hsusb 1p8\n"); in msm_hsusb_ldo_init()
171 static int ulpi_read(struct usb_phy *phy, u32 reg) in ulpi_read() argument
173 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in ulpi_read()
189 dev_err(phy->dev, "ulpi_read: timeout %08x\n", in ulpi_read()
196 static int ulpi_write(struct usb_phy *phy, u32 val, u32 reg) in ulpi_write() argument
198 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in ulpi_write()
215 dev_err(phy->dev, "ulpi_write: timeout\n"); in ulpi_write()
236 dev_vdbg(motg->phy.dev, "ulpi: write 0x%02x to 0x%02x\n", in ulpi_init()
238 ulpi_write(&motg->phy, seq[idx], addr + idx); in ulpi_init()
242 static int msm_phy_notify_disconnect(struct usb_phy *phy, in msm_phy_notify_disconnect() argument
245 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_phy_notify_disconnect()
250 usb_phy_io_write(phy, val, ULPI_CLR(ULPI_MISC_A)); in msm_phy_notify_disconnect()
257 val = ulpi_read(phy, ULPI_FUNC_CTRL); in msm_phy_notify_disconnect()
260 ulpi_write(phy, val, ULPI_FUNC_CTRL); in msm_phy_notify_disconnect()
275 dev_err(motg->phy.dev, "usb link clk reset %s failed\n", in msm_otg_link_clk_reset()
289 dev_err(motg->phy.dev, "usb phy clk reset failed\n"); in msm_otg_phy_clk_reset()
320 static int msm_otg_reset(struct usb_phy *phy) in msm_otg_reset() argument
322 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_otg_reset()
373 static int msm_usb_reset(struct usb_phy *phy) in msm_usb_reset() argument
375 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_usb_reset()
383 dev_err(phy->dev, "phy_reset failed\n"); in msm_usb_reset()
387 ret = msm_otg_reset(&motg->phy); in msm_usb_reset()
389 dev_err(phy->dev, "link reset failed\n"); in msm_usb_reset()
404 static int msm_phy_init(struct usb_phy *phy) in msm_phy_init() argument
406 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_phy_init()
429 ulpi_write(phy, ulpi_val, ULPI_USB_INT_EN_RISE); in msm_phy_init()
430 ulpi_write(phy, ulpi_val, ULPI_USB_INT_EN_FALL); in msm_phy_init()
435 ulpi_write(phy, val, ULPI_SET(ULPI_MISC_A)); in msm_phy_init()
445 val = ulpi_read(phy, ULPI_FUNC_CTRL); in msm_phy_init()
448 ulpi_write(phy, val, ULPI_FUNC_CTRL); in msm_phy_init()
486 struct usb_phy *phy = &motg->phy; in msm_otg_suspend() local
487 struct usb_bus *bus = phy->otg->host; in msm_otg_suspend()
514 ulpi_read(phy, 0x14); in msm_otg_suspend()
516 ulpi_write(phy, 0x01, 0x30); in msm_otg_suspend()
517 ulpi_write(phy, 0x08, 0x09); in msm_otg_suspend()
534 dev_err(phy->dev, "Unable to suspend PHY\n"); in msm_otg_suspend()
535 msm_otg_reset(phy); in msm_otg_suspend()
568 if (device_may_wakeup(phy->dev)) in msm_otg_suspend()
576 dev_info(phy->dev, "USB in low power mode\n"); in msm_otg_suspend()
583 struct usb_phy *phy = &motg->phy; in msm_otg_resume() local
584 struct usb_bus *bus = phy->otg->host; in msm_otg_resume()
635 dev_err(phy->dev, "Unable to resume USB. Re-plugin the cable\n"); in msm_otg_resume()
636 msm_otg_reset(phy); in msm_otg_resume()
640 if (device_may_wakeup(phy->dev)) in msm_otg_resume()
649 pm_runtime_put(phy->dev); in msm_otg_resume()
653 dev_info(phy->dev, "USB exited from low power mode\n"); in msm_otg_resume()
665 dev_info(motg->phy.dev, "Avail curr from USB = %u\n", mA); in msm_otg_notify_charger()
669 static int msm_otg_set_power(struct usb_phy *phy, unsigned mA) in msm_otg_set_power() argument
671 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_otg_set_power()
686 static void msm_otg_start_host(struct usb_phy *phy, int on) in msm_otg_start_host() argument
688 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_otg_start_host()
692 if (!phy->otg->host) in msm_otg_start_host()
695 hcd = bus_to_hcd(phy->otg->host); in msm_otg_start_host()
698 dev_dbg(phy->dev, "host on\n"); in msm_otg_start_host()
714 dev_dbg(phy->dev, "host off\n"); in msm_otg_start_host()
728 struct msm_otg *motg = container_of(otg->usb_phy, struct msm_otg, phy); in msm_otg_set_host()
772 static void msm_otg_start_peripheral(struct usb_phy *phy, int on) in msm_otg_start_peripheral() argument
774 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_otg_start_peripheral()
777 if (!phy->otg->gadget) in msm_otg_start_peripheral()
781 dev_dbg(phy->dev, "gadget on\n"); in msm_otg_start_peripheral()
789 usb_gadget_vbus_connect(phy->otg->gadget); in msm_otg_start_peripheral()
791 dev_dbg(phy->dev, "gadget off\n"); in msm_otg_start_peripheral()
792 usb_gadget_vbus_disconnect(phy->otg->gadget); in msm_otg_start_peripheral()
802 struct msm_otg *motg = container_of(otg->usb_phy, struct msm_otg, phy); in msm_otg_set_peripheral()
844 struct usb_phy *phy = &motg->phy; in msm_chg_check_secondary_det() local
850 chg_det = ulpi_read(phy, 0x34); in msm_chg_check_secondary_det()
854 chg_det = ulpi_read(phy, 0x87); in msm_chg_check_secondary_det()
865 struct usb_phy *phy = &motg->phy; in msm_chg_enable_secondary_det() local
870 chg_det = ulpi_read(phy, 0x34); in msm_chg_enable_secondary_det()
873 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_secondary_det()
877 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_secondary_det()
880 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_secondary_det()
883 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_secondary_det()
887 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_secondary_det()
894 ulpi_write(phy, 0x8, 0x85); in msm_chg_enable_secondary_det()
895 ulpi_write(phy, 0x2, 0x85); in msm_chg_enable_secondary_det()
896 ulpi_write(phy, 0x1, 0x85); in msm_chg_enable_secondary_det()
905 struct usb_phy *phy = &motg->phy; in msm_chg_check_primary_det() local
911 chg_det = ulpi_read(phy, 0x34); in msm_chg_check_primary_det()
915 chg_det = ulpi_read(phy, 0x87); in msm_chg_check_primary_det()
926 struct usb_phy *phy = &motg->phy; in msm_chg_enable_primary_det() local
931 chg_det = ulpi_read(phy, 0x34); in msm_chg_enable_primary_det()
934 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_primary_det()
941 ulpi_write(phy, 0x2, 0x85); in msm_chg_enable_primary_det()
942 ulpi_write(phy, 0x1, 0x85); in msm_chg_enable_primary_det()
951 struct usb_phy *phy = &motg->phy; in msm_chg_check_dcd() local
957 line_state = ulpi_read(phy, 0x15); in msm_chg_check_dcd()
961 line_state = ulpi_read(phy, 0x87); in msm_chg_check_dcd()
972 struct usb_phy *phy = &motg->phy; in msm_chg_disable_dcd() local
977 chg_det = ulpi_read(phy, 0x34); in msm_chg_disable_dcd()
979 ulpi_write(phy, chg_det, 0x34); in msm_chg_disable_dcd()
982 ulpi_write(phy, 0x10, 0x86); in msm_chg_disable_dcd()
991 struct usb_phy *phy = &motg->phy; in msm_chg_enable_dcd() local
996 chg_det = ulpi_read(phy, 0x34); in msm_chg_enable_dcd()
999 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_dcd()
1003 ulpi_write(phy, 0x10, 0x85); in msm_chg_enable_dcd()
1012 struct usb_phy *phy = &motg->phy; in msm_chg_block_on() local
1016 func_ctrl = ulpi_read(phy, ULPI_FUNC_CTRL); in msm_chg_block_on()
1019 ulpi_write(phy, func_ctrl, ULPI_FUNC_CTRL); in msm_chg_block_on()
1023 chg_det = ulpi_read(phy, 0x34); in msm_chg_block_on()
1026 ulpi_write(phy, chg_det, 0x34); in msm_chg_block_on()
1029 ulpi_write(phy, chg_det, 0x34); in msm_chg_block_on()
1034 ulpi_write(phy, 0x3F, 0x86); in msm_chg_block_on()
1036 ulpi_write(phy, 0x1F, 0x92); in msm_chg_block_on()
1037 ulpi_write(phy, 0x1F, 0x95); in msm_chg_block_on()
1047 struct usb_phy *phy = &motg->phy; in msm_chg_block_off() local
1052 chg_det = ulpi_read(phy, 0x34); in msm_chg_block_off()
1055 ulpi_write(phy, chg_det, 0x34); in msm_chg_block_off()
1059 ulpi_write(phy, 0x3F, 0x86); in msm_chg_block_off()
1061 ulpi_write(phy, 0x1F, 0x92); in msm_chg_block_off()
1062 ulpi_write(phy, 0x1F, 0x95); in msm_chg_block_off()
1069 func_ctrl = ulpi_read(phy, ULPI_FUNC_CTRL); in msm_chg_block_off()
1072 ulpi_write(phy, func_ctrl, ULPI_FUNC_CTRL); in msm_chg_block_off()
1082 struct usb_phy *phy = &motg->phy; in msm_chg_detect_work() local
1086 dev_dbg(phy->dev, "chg detection work\n"); in msm_chg_detect_work()
1089 pm_runtime_get_sync(phy->dev); in msm_chg_detect_work()
1132 dev_dbg(phy->dev, "charger = %d\n", motg->chg_type); in msm_chg_detect_work()
1189 struct usb_otg *otg = motg->phy.otg; in msm_otg_sm_work()
1286 struct usb_phy *phy = &motg->phy; in msm_otg_irq() local
1292 pm_runtime_get(phy->dev); in msm_otg_irq()
1305 dev_dbg(phy->dev, "ID set/clear\n"); in msm_otg_irq()
1306 pm_runtime_get_noresume(phy->dev); in msm_otg_irq()
1312 dev_dbg(phy->dev, "BSV set/clear\n"); in msm_otg_irq()
1313 pm_runtime_get_noresume(phy->dev); in msm_otg_irq()
1324 struct usb_otg *otg = motg->phy.otg; in msm_otg_mode_show()
1352 struct usb_otg *otg = motg->phy.otg; in msm_otg_mode_write()
1658 struct usb_phy *phy; in msm_otg_probe() local
1665 motg->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg), in msm_otg_probe()
1667 if (!motg->phy.otg) in msm_otg_probe()
1670 phy = &motg->phy; in msm_otg_probe()
1671 phy->dev = &pdev->dev; in msm_otg_probe()
1743 ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(regs), regs); in msm_otg_probe()
1788 phy->init = msm_phy_init; in msm_otg_probe()
1789 phy->set_power = msm_otg_set_power; in msm_otg_probe()
1790 phy->notify_disconnect = msm_phy_notify_disconnect; in msm_otg_probe()
1791 phy->type = USB_PHY_TYPE_USB2; in msm_otg_probe()
1793 phy->io_ops = &msm_otg_io_ops; in msm_otg_probe()
1795 phy->otg->usb_phy = &motg->phy; in msm_otg_probe()
1796 phy->otg->set_host = msm_otg_set_host; in msm_otg_probe()
1797 phy->otg->set_peripheral = msm_otg_set_peripheral; in msm_otg_probe()
1799 msm_usb_reset(phy); in msm_otg_probe()
1801 ret = usb_add_phy_dev(&motg->phy); in msm_otg_probe()
1854 struct usb_phy *phy = &motg->phy; in msm_otg_remove() local
1857 if (phy->otg->host || phy->otg->gadget) in msm_otg_remove()
1880 usb_remove_phy(phy); in msm_otg_remove()
1886 ulpi_read(phy, 0x14); in msm_otg_remove()
1887 ulpi_write(phy, 0x08, 0x09); in msm_otg_remove()
1897 dev_err(phy->dev, "Unable to suspend PHY\n"); in msm_otg_remove()
1914 struct usb_otg *otg = motg->phy.otg; in msm_otg_runtime_idle()