Lines Matching refs:phy
82 dev_err(motg->phy.dev, "Cannot set vddcx voltage\n"); in msm_hsusb_init_vddcx()
88 dev_err(motg->phy.dev, "unable to enable hsusb vddcx\n"); in msm_hsusb_init_vddcx()
93 dev_err(motg->phy.dev, "Cannot set vddcx voltage\n"); in msm_hsusb_init_vddcx()
96 dev_err(motg->phy.dev, "unable to disable hsusb vddcx\n"); in msm_hsusb_init_vddcx()
110 dev_err(motg->phy.dev, "Cannot set v3p3 voltage\n"); in msm_hsusb_ldo_init()
115 dev_err(motg->phy.dev, "unable to enable the hsusb 3p3\n"); in msm_hsusb_ldo_init()
121 dev_err(motg->phy.dev, "Cannot set v1p8 voltage\n"); in msm_hsusb_ldo_init()
126 dev_err(motg->phy.dev, "unable to enable the hsusb 1p8\n"); in msm_hsusb_ldo_init()
169 static int ulpi_read(struct usb_phy *phy, u32 reg) in ulpi_read() argument
171 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in ulpi_read()
187 dev_err(phy->dev, "ulpi_read: timeout %08x\n", in ulpi_read()
194 static int ulpi_write(struct usb_phy *phy, u32 val, u32 reg) in ulpi_write() argument
196 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in ulpi_write()
213 dev_err(phy->dev, "ulpi_write: timeout\n"); in ulpi_write()
234 dev_vdbg(motg->phy.dev, "ulpi: write 0x%02x to 0x%02x\n", in ulpi_init()
236 ulpi_write(&motg->phy, seq[idx], addr + idx); in ulpi_init()
240 static int msm_phy_notify_disconnect(struct usb_phy *phy, in msm_phy_notify_disconnect() argument
249 val = ulpi_read(phy, ULPI_FUNC_CTRL); in msm_phy_notify_disconnect()
252 ulpi_write(phy, val, ULPI_FUNC_CTRL); in msm_phy_notify_disconnect()
267 dev_err(motg->phy.dev, "usb link clk reset %s failed\n", in msm_otg_link_clk_reset()
281 dev_err(motg->phy.dev, "usb phy clk reset failed\n"); in msm_otg_phy_clk_reset()
312 static int msm_otg_reset(struct usb_phy *phy) in msm_otg_reset() argument
314 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_otg_reset()
365 static int msm_usb_reset(struct usb_phy *phy) in msm_usb_reset() argument
367 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_usb_reset()
375 dev_err(phy->dev, "phy_reset failed\n"); in msm_usb_reset()
379 ret = msm_otg_reset(&motg->phy); in msm_usb_reset()
381 dev_err(phy->dev, "link reset failed\n"); in msm_usb_reset()
396 static int msm_phy_init(struct usb_phy *phy) in msm_phy_init() argument
398 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_phy_init()
421 ulpi_write(phy, ulpi_val, ULPI_USB_INT_EN_RISE); in msm_phy_init()
422 ulpi_write(phy, ulpi_val, ULPI_USB_INT_EN_FALL); in msm_phy_init()
460 struct usb_phy *phy = &motg->phy; in msm_otg_suspend() local
461 struct usb_bus *bus = phy->otg->host; in msm_otg_suspend()
488 ulpi_read(phy, 0x14); in msm_otg_suspend()
490 ulpi_write(phy, 0x01, 0x30); in msm_otg_suspend()
491 ulpi_write(phy, 0x08, 0x09); in msm_otg_suspend()
508 dev_err(phy->dev, "Unable to suspend PHY\n"); in msm_otg_suspend()
509 msm_otg_reset(phy); in msm_otg_suspend()
542 if (device_may_wakeup(phy->dev)) in msm_otg_suspend()
550 dev_info(phy->dev, "USB in low power mode\n"); in msm_otg_suspend()
557 struct usb_phy *phy = &motg->phy; in msm_otg_resume() local
558 struct usb_bus *bus = phy->otg->host; in msm_otg_resume()
609 dev_err(phy->dev, "Unable to resume USB. Re-plugin the cable\n"); in msm_otg_resume()
610 msm_otg_reset(phy); in msm_otg_resume()
614 if (device_may_wakeup(phy->dev)) in msm_otg_resume()
623 pm_runtime_put(phy->dev); in msm_otg_resume()
627 dev_info(phy->dev, "USB exited from low power mode\n"); in msm_otg_resume()
639 dev_info(motg->phy.dev, "Avail curr from USB = %u\n", mA); in msm_otg_notify_charger()
643 static int msm_otg_set_power(struct usb_phy *phy, unsigned mA) in msm_otg_set_power() argument
645 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_otg_set_power()
660 static void msm_otg_start_host(struct usb_phy *phy, int on) in msm_otg_start_host() argument
662 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_otg_start_host()
666 if (!phy->otg->host) in msm_otg_start_host()
669 hcd = bus_to_hcd(phy->otg->host); in msm_otg_start_host()
672 dev_dbg(phy->dev, "host on\n"); in msm_otg_start_host()
688 dev_dbg(phy->dev, "host off\n"); in msm_otg_start_host()
702 struct msm_otg *motg = container_of(otg->usb_phy, struct msm_otg, phy); in msm_otg_set_host()
746 static void msm_otg_start_peripheral(struct usb_phy *phy, int on) in msm_otg_start_peripheral() argument
748 struct msm_otg *motg = container_of(phy, struct msm_otg, phy); in msm_otg_start_peripheral()
751 if (!phy->otg->gadget) in msm_otg_start_peripheral()
755 dev_dbg(phy->dev, "gadget on\n"); in msm_otg_start_peripheral()
763 usb_gadget_vbus_connect(phy->otg->gadget); in msm_otg_start_peripheral()
765 dev_dbg(phy->dev, "gadget off\n"); in msm_otg_start_peripheral()
766 usb_gadget_vbus_disconnect(phy->otg->gadget); in msm_otg_start_peripheral()
776 struct msm_otg *motg = container_of(otg->usb_phy, struct msm_otg, phy); in msm_otg_set_peripheral()
818 struct usb_phy *phy = &motg->phy; in msm_chg_check_secondary_det() local
824 chg_det = ulpi_read(phy, 0x34); in msm_chg_check_secondary_det()
828 chg_det = ulpi_read(phy, 0x87); in msm_chg_check_secondary_det()
839 struct usb_phy *phy = &motg->phy; in msm_chg_enable_secondary_det() local
844 chg_det = ulpi_read(phy, 0x34); in msm_chg_enable_secondary_det()
847 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_secondary_det()
851 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_secondary_det()
854 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_secondary_det()
857 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_secondary_det()
861 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_secondary_det()
868 ulpi_write(phy, 0x8, 0x85); in msm_chg_enable_secondary_det()
869 ulpi_write(phy, 0x2, 0x85); in msm_chg_enable_secondary_det()
870 ulpi_write(phy, 0x1, 0x85); in msm_chg_enable_secondary_det()
879 struct usb_phy *phy = &motg->phy; in msm_chg_check_primary_det() local
885 chg_det = ulpi_read(phy, 0x34); in msm_chg_check_primary_det()
889 chg_det = ulpi_read(phy, 0x87); in msm_chg_check_primary_det()
900 struct usb_phy *phy = &motg->phy; in msm_chg_enable_primary_det() local
905 chg_det = ulpi_read(phy, 0x34); in msm_chg_enable_primary_det()
908 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_primary_det()
915 ulpi_write(phy, 0x2, 0x85); in msm_chg_enable_primary_det()
916 ulpi_write(phy, 0x1, 0x85); in msm_chg_enable_primary_det()
925 struct usb_phy *phy = &motg->phy; in msm_chg_check_dcd() local
931 line_state = ulpi_read(phy, 0x15); in msm_chg_check_dcd()
935 line_state = ulpi_read(phy, 0x87); in msm_chg_check_dcd()
946 struct usb_phy *phy = &motg->phy; in msm_chg_disable_dcd() local
951 chg_det = ulpi_read(phy, 0x34); in msm_chg_disable_dcd()
953 ulpi_write(phy, chg_det, 0x34); in msm_chg_disable_dcd()
956 ulpi_write(phy, 0x10, 0x86); in msm_chg_disable_dcd()
965 struct usb_phy *phy = &motg->phy; in msm_chg_enable_dcd() local
970 chg_det = ulpi_read(phy, 0x34); in msm_chg_enable_dcd()
973 ulpi_write(phy, chg_det, 0x34); in msm_chg_enable_dcd()
977 ulpi_write(phy, 0x10, 0x85); in msm_chg_enable_dcd()
986 struct usb_phy *phy = &motg->phy; in msm_chg_block_on() local
990 func_ctrl = ulpi_read(phy, ULPI_FUNC_CTRL); in msm_chg_block_on()
993 ulpi_write(phy, func_ctrl, ULPI_FUNC_CTRL); in msm_chg_block_on()
997 chg_det = ulpi_read(phy, 0x34); in msm_chg_block_on()
1000 ulpi_write(phy, chg_det, 0x34); in msm_chg_block_on()
1003 ulpi_write(phy, chg_det, 0x34); in msm_chg_block_on()
1008 ulpi_write(phy, 0x3F, 0x86); in msm_chg_block_on()
1010 ulpi_write(phy, 0x1F, 0x92); in msm_chg_block_on()
1011 ulpi_write(phy, 0x1F, 0x95); in msm_chg_block_on()
1021 struct usb_phy *phy = &motg->phy; in msm_chg_block_off() local
1026 chg_det = ulpi_read(phy, 0x34); in msm_chg_block_off()
1029 ulpi_write(phy, chg_det, 0x34); in msm_chg_block_off()
1033 ulpi_write(phy, 0x3F, 0x86); in msm_chg_block_off()
1035 ulpi_write(phy, 0x1F, 0x92); in msm_chg_block_off()
1036 ulpi_write(phy, 0x1F, 0x95); in msm_chg_block_off()
1043 func_ctrl = ulpi_read(phy, ULPI_FUNC_CTRL); in msm_chg_block_off()
1046 ulpi_write(phy, func_ctrl, ULPI_FUNC_CTRL); in msm_chg_block_off()
1056 struct usb_phy *phy = &motg->phy; in msm_chg_detect_work() local
1060 dev_dbg(phy->dev, "chg detection work\n"); in msm_chg_detect_work()
1063 pm_runtime_get_sync(phy->dev); in msm_chg_detect_work()
1106 dev_dbg(phy->dev, "charger = %d\n", motg->chg_type); in msm_chg_detect_work()
1163 struct usb_otg *otg = motg->phy.otg; in msm_otg_sm_work()
1260 struct usb_phy *phy = &motg->phy; in msm_otg_irq() local
1266 pm_runtime_get(phy->dev); in msm_otg_irq()
1279 dev_dbg(phy->dev, "ID set/clear\n"); in msm_otg_irq()
1280 pm_runtime_get_noresume(phy->dev); in msm_otg_irq()
1286 dev_dbg(phy->dev, "BSV set/clear\n"); in msm_otg_irq()
1287 pm_runtime_get_noresume(phy->dev); in msm_otg_irq()
1298 struct usb_otg *otg = motg->phy.otg; in msm_otg_mode_show()
1326 struct usb_otg *otg = motg->phy.otg; in msm_otg_mode_write()
1521 struct usb_phy *phy; in msm_otg_probe() local
1537 motg->phy.otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg), in msm_otg_probe()
1539 if (!motg->phy.otg) in msm_otg_probe()
1542 phy = &motg->phy; in msm_otg_probe()
1543 phy->dev = &pdev->dev; in msm_otg_probe()
1603 ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(regs), regs); in msm_otg_probe()
1648 phy->init = msm_phy_init; in msm_otg_probe()
1649 phy->set_power = msm_otg_set_power; in msm_otg_probe()
1650 phy->notify_disconnect = msm_phy_notify_disconnect; in msm_otg_probe()
1651 phy->type = USB_PHY_TYPE_USB2; in msm_otg_probe()
1653 phy->io_ops = &msm_otg_io_ops; in msm_otg_probe()
1655 phy->otg->usb_phy = &motg->phy; in msm_otg_probe()
1656 phy->otg->set_host = msm_otg_set_host; in msm_otg_probe()
1657 phy->otg->set_peripheral = msm_otg_set_peripheral; in msm_otg_probe()
1659 msm_usb_reset(phy); in msm_otg_probe()
1661 ret = usb_add_phy_dev(&motg->phy); in msm_otg_probe()
1697 struct usb_phy *phy = &motg->phy; in msm_otg_remove() local
1700 if (phy->otg->host || phy->otg->gadget) in msm_otg_remove()
1712 usb_remove_phy(phy); in msm_otg_remove()
1718 ulpi_read(phy, 0x14); in msm_otg_remove()
1719 ulpi_write(phy, 0x08, 0x09); in msm_otg_remove()
1729 dev_err(phy->dev, "Unable to suspend PHY\n"); in msm_otg_remove()
1746 struct usb_otg *otg = motg->phy.otg; in msm_otg_runtime_idle()