Lines Matching +full:need +full:- +full:phy +full:- +full:for +full:- +full:wake
1 // SPDX-License-Identifier: GPL-2.0
155 /* For Tegra30 and above only, the address is different in Tegra20 */
213 static void set_pts(struct tegra_usb_phy *phy, u8 pts_val) in set_pts() argument
215 void __iomem *base = phy->regs; in set_pts()
218 if (phy->soc_config->has_hostpc) { in set_pts()
232 static void set_phcd(struct tegra_usb_phy *phy, bool enable) in set_phcd() argument
234 void __iomem *base = phy->regs; in set_phcd()
237 if (phy->soc_config->has_hostpc) { in set_phcd()
254 static int utmip_pad_open(struct tegra_usb_phy *phy) in utmip_pad_open() argument
258 ret = clk_prepare_enable(phy->pad_clk); in utmip_pad_open()
260 dev_err(phy->u_phy.dev, in utmip_pad_open()
261 "Failed to enable UTMI-pads clock: %d\n", ret); in utmip_pad_open()
267 ret = reset_control_deassert(phy->pad_rst); in utmip_pad_open()
269 dev_err(phy->u_phy.dev, in utmip_pad_open()
270 "Failed to initialize UTMI-pads reset: %d\n", ret); in utmip_pad_open()
274 ret = reset_control_assert(phy->pad_rst); in utmip_pad_open()
276 dev_err(phy->u_phy.dev, in utmip_pad_open()
277 "Failed to assert UTMI-pads reset: %d\n", ret); in utmip_pad_open()
283 ret = reset_control_deassert(phy->pad_rst); in utmip_pad_open()
285 dev_err(phy->u_phy.dev, in utmip_pad_open()
286 "Failed to deassert UTMI-pads reset: %d\n", ret); in utmip_pad_open()
290 clk_disable_unprepare(phy->pad_clk); in utmip_pad_open()
295 static int utmip_pad_close(struct tegra_usb_phy *phy) in utmip_pad_close() argument
299 ret = clk_prepare_enable(phy->pad_clk); in utmip_pad_close()
301 dev_err(phy->u_phy.dev, in utmip_pad_close()
302 "Failed to enable UTMI-pads clock: %d\n", ret); in utmip_pad_close()
306 ret = reset_control_assert(phy->pad_rst); in utmip_pad_close()
308 dev_err(phy->u_phy.dev, in utmip_pad_close()
309 "Failed to assert UTMI-pads reset: %d\n", ret); in utmip_pad_close()
313 clk_disable_unprepare(phy->pad_clk); in utmip_pad_close()
318 static int utmip_pad_power_on(struct tegra_usb_phy *phy) in utmip_pad_power_on() argument
320 struct tegra_utmip_config *config = phy->config; in utmip_pad_power_on()
321 void __iomem *base = phy->pad_regs; in utmip_pad_power_on()
325 err = clk_prepare_enable(phy->pad_clk); in utmip_pad_power_on()
335 if (phy->soc_config->requires_extra_tuning_parameters) { in utmip_pad_power_on()
340 val |= UTMIP_HSSQUELCH_LEVEL(config->hssquelch_level); in utmip_pad_power_on()
341 val |= UTMIP_HSDISCON_LEVEL(config->hsdiscon_level); in utmip_pad_power_on()
342 val |= UTMIP_HSDISCON_LEVEL_MSB(config->hsdiscon_level); in utmip_pad_power_on()
347 if (phy->pad_wakeup) { in utmip_pad_power_on()
348 phy->pad_wakeup = false; in utmip_pad_power_on()
349 utmip_pad_count--; in utmip_pad_power_on()
354 clk_disable_unprepare(phy->pad_clk); in utmip_pad_power_on()
359 static int utmip_pad_power_off(struct tegra_usb_phy *phy) in utmip_pad_power_off() argument
361 void __iomem *base = phy->pad_regs; in utmip_pad_power_off()
365 ret = clk_prepare_enable(phy->pad_clk); in utmip_pad_power_off()
372 dev_err(phy->u_phy.dev, "UTMIP pad already powered off\n"); in utmip_pad_power_off()
373 ret = -EINVAL; in utmip_pad_power_off()
379 * to save power if wake is enabled, but the VBUS-change detection in utmip_pad_power_off()
380 * method is board-specific and these circuits may need to be enabled in utmip_pad_power_off()
383 if (phy->wakeup_enabled) { in utmip_pad_power_off()
384 phy->pad_wakeup = true; in utmip_pad_power_off()
388 if (--utmip_pad_count == 0) { in utmip_pad_power_off()
396 clk_disable_unprepare(phy->pad_clk); in utmip_pad_power_off()
409 static void utmi_phy_clk_disable(struct tegra_usb_phy *phy) in utmi_phy_clk_disable() argument
411 void __iomem *base = phy->regs; in utmi_phy_clk_disable()
415 * The USB driver may have already initiated the phy clock in utmi_phy_clk_disable()
422 if (phy->is_legacy_phy) { in utmi_phy_clk_disable()
433 set_phcd(phy, true); in utmi_phy_clk_disable()
437 dev_err(phy->u_phy.dev, in utmi_phy_clk_disable()
438 "Timeout waiting for PHY to stabilize on disable\n"); in utmi_phy_clk_disable()
441 static void utmi_phy_clk_enable(struct tegra_usb_phy *phy) in utmi_phy_clk_enable() argument
443 void __iomem *base = phy->regs; in utmi_phy_clk_enable()
447 * The USB driver may have already initiated the phy clock in utmi_phy_clk_enable()
455 if (phy->is_legacy_phy) { in utmi_phy_clk_enable()
466 set_phcd(phy, false); in utmi_phy_clk_enable()
471 dev_err(phy->u_phy.dev, in utmi_phy_clk_enable()
472 "Timeout waiting for PHY to stabilize on enable\n"); in utmi_phy_clk_enable()
475 static int utmi_phy_power_on(struct tegra_usb_phy *phy) in utmi_phy_power_on() argument
477 struct tegra_utmip_config *config = phy->config; in utmi_phy_power_on()
478 void __iomem *base = phy->regs; in utmi_phy_power_on()
486 if (phy->is_legacy_phy) { in utmi_phy_power_on()
498 val |= UTMIP_IDLE_WAIT(config->idle_wait_delay); in utmi_phy_power_on()
499 val |= UTMIP_ELASTIC_LIMIT(config->elastic_limit); in utmi_phy_power_on()
504 val |= UTMIP_HS_SYNC_START_DLY(config->hssync_start_delay); in utmi_phy_power_on()
509 val |= UTMIP_BIAS_DEBOUNCE_A(phy->freq->debounce); in utmi_phy_power_on()
516 if (!phy->soc_config->utmi_pll_config_in_car_module) { in utmi_phy_power_on()
520 val |= UTMIP_PLL_ACTIVE_DLY_COUNT(phy->freq->active_delay) | in utmi_phy_power_on()
521 UTMIP_PLLU_STABLE_COUNT(phy->freq->stable_count); in utmi_phy_power_on()
527 val |= UTMIP_XTAL_FREQ_COUNT(phy->freq->xtal_freq_count) | in utmi_phy_power_on()
528 UTMIP_PLLU_ENABLE_DLY_COUNT(phy->freq->enable_delay); in utmi_phy_power_on()
536 if (phy->mode == USB_DR_MODE_PERIPHERAL) { in utmi_phy_power_on()
559 err = utmip_pad_power_on(phy); in utmi_phy_power_on()
569 if (!config->xcvr_setup_use_fuses) { in utmi_phy_power_on()
570 val |= UTMIP_XCVR_SETUP(config->xcvr_setup); in utmi_phy_power_on()
571 val |= UTMIP_XCVR_SETUP_MSB(config->xcvr_setup); in utmi_phy_power_on()
573 val |= UTMIP_XCVR_LSFSLEW(config->xcvr_lsfslew); in utmi_phy_power_on()
574 val |= UTMIP_XCVR_LSRSLEW(config->xcvr_lsrslew); in utmi_phy_power_on()
576 if (phy->soc_config->requires_extra_tuning_parameters) { in utmi_phy_power_on()
578 val |= UTMIP_XCVR_HSSLEW(config->xcvr_hsslew); in utmi_phy_power_on()
579 val |= UTMIP_XCVR_HSSLEW_MSB(config->xcvr_hsslew); in utmi_phy_power_on()
586 val |= UTMIP_XCVR_TERM_RANGE_ADJ(config->term_range_adj); in utmi_phy_power_on()
595 if (config->xcvr_setup_use_fuses) in utmi_phy_power_on()
601 if (!phy->is_legacy_phy) { in utmi_phy_power_on()
611 if (phy->is_legacy_phy) { in utmi_phy_power_on()
622 utmi_phy_clk_enable(phy); in utmi_phy_power_on()
624 if (phy->soc_config->requires_usbmode_setup) { in utmi_phy_power_on()
627 if (phy->mode == USB_DR_MODE_HOST) in utmi_phy_power_on()
634 if (!phy->is_legacy_phy) in utmi_phy_power_on()
635 set_pts(phy, 0); in utmi_phy_power_on()
640 static int utmi_phy_power_off(struct tegra_usb_phy *phy) in utmi_phy_power_off() argument
642 void __iomem *base = phy->regs; in utmi_phy_power_off()
647 * otherwise PHY will immediately wake up from suspend. in utmi_phy_power_off()
649 if (phy->wakeup_enabled && phy->mode != USB_DR_MODE_HOST) in utmi_phy_power_off()
654 utmi_phy_clk_disable(phy); in utmi_phy_power_off()
656 /* PHY won't resume if reset is asserted */ in utmi_phy_power_off()
657 if (!phy->wakeup_enabled) { in utmi_phy_power_off()
667 if (!phy->wakeup_enabled) { in utmi_phy_power_off()
679 if (phy->wakeup_enabled) { in utmi_phy_power_off()
687 * Ask VBUS sensor to generate wake event once cable is in utmi_phy_power_off()
690 if (phy->mode == USB_DR_MODE_PERIPHERAL) { in utmi_phy_power_off()
701 return utmip_pad_power_off(phy); in utmi_phy_power_off()
704 static void utmi_phy_preresume(struct tegra_usb_phy *phy) in utmi_phy_preresume() argument
706 void __iomem *base = phy->regs; in utmi_phy_preresume()
714 static void utmi_phy_postresume(struct tegra_usb_phy *phy) in utmi_phy_postresume() argument
716 void __iomem *base = phy->regs; in utmi_phy_postresume()
724 static void utmi_phy_restore_start(struct tegra_usb_phy *phy, in utmi_phy_restore_start() argument
727 void __iomem *base = phy->regs; in utmi_phy_restore_start()
745 static void utmi_phy_restore_end(struct tegra_usb_phy *phy) in utmi_phy_restore_end() argument
747 void __iomem *base = phy->regs; in utmi_phy_restore_end()
756 static int ulpi_phy_power_on(struct tegra_usb_phy *phy) in ulpi_phy_power_on() argument
758 void __iomem *base = phy->regs; in ulpi_phy_power_on()
762 gpiod_set_value_cansleep(phy->reset_gpio, 1); in ulpi_phy_power_on()
764 err = clk_prepare_enable(phy->clk); in ulpi_phy_power_on()
770 gpiod_set_value_cansleep(phy->reset_gpio, 0); in ulpi_phy_power_on()
801 err = usb_phy_io_write(phy->ulpi, 0x40, 0x08); in ulpi_phy_power_on()
803 dev_err(phy->u_phy.dev, "ULPI write failed: %d\n", err); in ulpi_phy_power_on()
807 err = usb_phy_io_write(phy->ulpi, 0x80, 0x0B); in ulpi_phy_power_on()
809 dev_err(phy->u_phy.dev, "ULPI write failed: %d\n", err); in ulpi_phy_power_on()
825 clk_disable_unprepare(phy->clk); in ulpi_phy_power_on()
830 static int ulpi_phy_power_off(struct tegra_usb_phy *phy) in ulpi_phy_power_off() argument
832 gpiod_set_value_cansleep(phy->reset_gpio, 1); in ulpi_phy_power_off()
834 clk_disable_unprepare(phy->clk); in ulpi_phy_power_off()
837 * Wakeup currently unimplemented for ULPI, thus PHY needs to be in ulpi_phy_power_off()
838 * force-resumed. in ulpi_phy_power_off()
840 if (WARN_ON_ONCE(phy->wakeup_enabled)) { in ulpi_phy_power_off()
841 ulpi_phy_power_on(phy); in ulpi_phy_power_off()
842 return -EOPNOTSUPP; in ulpi_phy_power_off()
848 static int tegra_usb_phy_power_on(struct tegra_usb_phy *phy) in tegra_usb_phy_power_on() argument
852 if (phy->powered_on) in tegra_usb_phy_power_on()
855 if (phy->is_ulpi_phy) in tegra_usb_phy_power_on()
856 err = ulpi_phy_power_on(phy); in tegra_usb_phy_power_on()
858 err = utmi_phy_power_on(phy); in tegra_usb_phy_power_on()
862 phy->powered_on = true; in tegra_usb_phy_power_on()
864 /* Let PHY settle down */ in tegra_usb_phy_power_on()
870 static int tegra_usb_phy_power_off(struct tegra_usb_phy *phy) in tegra_usb_phy_power_off() argument
874 if (!phy->powered_on) in tegra_usb_phy_power_off()
877 if (phy->is_ulpi_phy) in tegra_usb_phy_power_off()
878 err = ulpi_phy_power_off(phy); in tegra_usb_phy_power_off()
880 err = utmi_phy_power_off(phy); in tegra_usb_phy_power_off()
884 phy->powered_on = false; in tegra_usb_phy_power_off()
891 struct tegra_usb_phy *phy = to_tegra_usb_phy(u_phy); in tegra_usb_phy_shutdown() local
893 if (WARN_ON(!phy->freq)) in tegra_usb_phy_shutdown()
896 tegra_usb_phy_power_off(phy); in tegra_usb_phy_shutdown()
898 if (!phy->is_ulpi_phy) in tegra_usb_phy_shutdown()
899 utmip_pad_close(phy); in tegra_usb_phy_shutdown()
901 regulator_disable(phy->vbus); in tegra_usb_phy_shutdown()
902 clk_disable_unprepare(phy->pll_u); in tegra_usb_phy_shutdown()
904 phy->freq = NULL; in tegra_usb_phy_shutdown()
909 struct tegra_usb_phy *phy = to_tegra_usb_phy(u_phy); in tegra_usb_phy_set_wakeup() local
911 phy->wakeup_enabled = enable; in tegra_usb_phy_set_wakeup()
918 struct tegra_usb_phy *phy = to_tegra_usb_phy(u_phy); in tegra_usb_phy_set_suspend() local
920 if (WARN_ON(!phy->freq)) in tegra_usb_phy_set_suspend()
921 return -EINVAL; in tegra_usb_phy_set_suspend()
924 return tegra_usb_phy_power_off(phy); in tegra_usb_phy_set_suspend()
926 return tegra_usb_phy_power_on(phy); in tegra_usb_phy_set_suspend()
931 struct tegra_usb_phy *phy = to_tegra_usb_phy(u_phy); in tegra_usb_phy_init() local
936 if (WARN_ON(phy->freq)) in tegra_usb_phy_init()
939 err = clk_prepare_enable(phy->pll_u); in tegra_usb_phy_init()
943 parent_rate = clk_get_rate(clk_get_parent(phy->pll_u)); in tegra_usb_phy_init()
944 for (i = 0; i < ARRAY_SIZE(tegra_freq_table); i++) { in tegra_usb_phy_init()
946 phy->freq = &tegra_freq_table[i]; in tegra_usb_phy_init()
950 if (!phy->freq) { in tegra_usb_phy_init()
951 dev_err(phy->u_phy.dev, "Invalid pll_u parent rate %ld\n", in tegra_usb_phy_init()
953 err = -EINVAL; in tegra_usb_phy_init()
957 err = regulator_enable(phy->vbus); in tegra_usb_phy_init()
959 dev_err(phy->u_phy.dev, in tegra_usb_phy_init()
964 if (!phy->is_ulpi_phy) { in tegra_usb_phy_init()
965 err = utmip_pad_open(phy); in tegra_usb_phy_init()
970 err = tegra_usb_phy_power_on(phy); in tegra_usb_phy_init()
977 if (!phy->is_ulpi_phy) in tegra_usb_phy_init()
978 utmip_pad_close(phy); in tegra_usb_phy_init()
981 regulator_disable(phy->vbus); in tegra_usb_phy_init()
984 clk_disable_unprepare(phy->pll_u); in tegra_usb_phy_init()
986 phy->freq = NULL; in tegra_usb_phy_init()
993 struct tegra_usb_phy *phy = to_tegra_usb_phy(u_phy); in tegra_usb_phy_preresume() local
995 if (!phy->is_ulpi_phy) in tegra_usb_phy_preresume()
996 utmi_phy_preresume(phy); in tegra_usb_phy_preresume()
1002 struct tegra_usb_phy *phy = to_tegra_usb_phy(u_phy); in tegra_usb_phy_postresume() local
1004 if (!phy->is_ulpi_phy) in tegra_usb_phy_postresume()
1005 utmi_phy_postresume(phy); in tegra_usb_phy_postresume()
1012 struct tegra_usb_phy *phy = to_tegra_usb_phy(u_phy); in tegra_ehci_phy_restore_start() local
1014 if (!phy->is_ulpi_phy) in tegra_ehci_phy_restore_start()
1015 utmi_phy_restore_start(phy, port_speed); in tegra_ehci_phy_restore_start()
1021 struct tegra_usb_phy *phy = to_tegra_usb_phy(u_phy); in tegra_ehci_phy_restore_end() local
1023 if (!phy->is_ulpi_phy) in tegra_ehci_phy_restore_end()
1024 utmi_phy_restore_end(phy); in tegra_ehci_phy_restore_end()
1034 err = of_property_read_u32(pdev->dev.of_node, param, &value); in read_utmi_param()
1036 dev_err(&pdev->dev, in read_utmi_param()
1052 tegra_phy->is_ulpi_phy = false; in utmi_phy_probe()
1056 dev_err(&pdev->dev, "Failed to get UTMI pad regs\n"); in utmi_phy_probe()
1057 return -ENXIO; in utmi_phy_probe()
1064 tegra_phy->pad_regs = devm_ioremap(&pdev->dev, res->start, in utmi_phy_probe()
1066 if (!tegra_phy->pad_regs) { in utmi_phy_probe()
1067 dev_err(&pdev->dev, "Failed to remap UTMI pad regs\n"); in utmi_phy_probe()
1068 return -ENOMEM; in utmi_phy_probe()
1071 tegra_phy->config = devm_kzalloc(&pdev->dev, sizeof(*config), in utmi_phy_probe()
1073 if (!tegra_phy->config) in utmi_phy_probe()
1074 return -ENOMEM; in utmi_phy_probe()
1076 config = tegra_phy->config; in utmi_phy_probe()
1078 err = read_utmi_param(pdev, "nvidia,hssync-start-delay", in utmi_phy_probe()
1079 &config->hssync_start_delay); in utmi_phy_probe()
1083 err = read_utmi_param(pdev, "nvidia,elastic-limit", in utmi_phy_probe()
1084 &config->elastic_limit); in utmi_phy_probe()
1088 err = read_utmi_param(pdev, "nvidia,idle-wait-delay", in utmi_phy_probe()
1089 &config->idle_wait_delay); in utmi_phy_probe()
1093 err = read_utmi_param(pdev, "nvidia,term-range-adj", in utmi_phy_probe()
1094 &config->term_range_adj); in utmi_phy_probe()
1098 err = read_utmi_param(pdev, "nvidia,xcvr-lsfslew", in utmi_phy_probe()
1099 &config->xcvr_lsfslew); in utmi_phy_probe()
1103 err = read_utmi_param(pdev, "nvidia,xcvr-lsrslew", in utmi_phy_probe()
1104 &config->xcvr_lsrslew); in utmi_phy_probe()
1108 if (tegra_phy->soc_config->requires_extra_tuning_parameters) { in utmi_phy_probe()
1109 err = read_utmi_param(pdev, "nvidia,xcvr-hsslew", in utmi_phy_probe()
1110 &config->xcvr_hsslew); in utmi_phy_probe()
1114 err = read_utmi_param(pdev, "nvidia,hssquelch-level", in utmi_phy_probe()
1115 &config->hssquelch_level); in utmi_phy_probe()
1119 err = read_utmi_param(pdev, "nvidia,hsdiscon-level", in utmi_phy_probe()
1120 &config->hsdiscon_level); in utmi_phy_probe()
1125 config->xcvr_setup_use_fuses = of_property_read_bool( in utmi_phy_probe()
1126 pdev->dev.of_node, "nvidia,xcvr-setup-use-fuses"); in utmi_phy_probe()
1128 if (!config->xcvr_setup_use_fuses) { in utmi_phy_probe()
1129 err = read_utmi_param(pdev, "nvidia,xcvr-setup", in utmi_phy_probe()
1130 &config->xcvr_setup); in utmi_phy_probe()
1153 { .compatible = "nvidia,tegra30-usb-phy", .data = &tegra30_soc_config },
1154 { .compatible = "nvidia,tegra20-usb-phy", .data = &tegra20_soc_config },
1161 struct device_node *np = pdev->dev.of_node; in tegra_usb_phy_probe()
1167 struct usb_phy *phy; in tegra_usb_phy_probe() local
1170 tegra_phy = devm_kzalloc(&pdev->dev, sizeof(*tegra_phy), GFP_KERNEL); in tegra_usb_phy_probe()
1172 return -ENOMEM; in tegra_usb_phy_probe()
1174 tegra_phy->soc_config = of_device_get_match_data(&pdev->dev); in tegra_usb_phy_probe()
1178 dev_err(&pdev->dev, "Failed to get I/O memory\n"); in tegra_usb_phy_probe()
1179 return -ENXIO; in tegra_usb_phy_probe()
1183 * Note that PHY and USB controller are using shared registers, in tegra_usb_phy_probe()
1186 tegra_phy->regs = devm_ioremap(&pdev->dev, res->start, in tegra_usb_phy_probe()
1188 if (!tegra_phy->regs) { in tegra_usb_phy_probe()
1189 dev_err(&pdev->dev, "Failed to remap I/O memory\n"); in tegra_usb_phy_probe()
1190 return -ENOMEM; in tegra_usb_phy_probe()
1193 tegra_phy->is_legacy_phy = in tegra_usb_phy_probe()
1194 of_property_read_bool(np, "nvidia,has-legacy-mode"); in tegra_usb_phy_probe()
1197 tegra_phy->mode = usb_get_dr_mode(&pdev->dev); in tegra_usb_phy_probe()
1199 tegra_phy->mode = USB_DR_MODE_HOST; in tegra_usb_phy_probe()
1201 if (tegra_phy->mode == USB_DR_MODE_UNKNOWN) { in tegra_usb_phy_probe()
1202 dev_err(&pdev->dev, "dr_mode is invalid\n"); in tegra_usb_phy_probe()
1203 return -EINVAL; in tegra_usb_phy_probe()
1206 /* On some boards, the VBUS regulator doesn't need to be controlled */ in tegra_usb_phy_probe()
1207 tegra_phy->vbus = devm_regulator_get(&pdev->dev, "vbus"); in tegra_usb_phy_probe()
1208 if (IS_ERR(tegra_phy->vbus)) in tegra_usb_phy_probe()
1209 return PTR_ERR(tegra_phy->vbus); in tegra_usb_phy_probe()
1211 tegra_phy->pll_u = devm_clk_get(&pdev->dev, "pll_u"); in tegra_usb_phy_probe()
1212 err = PTR_ERR_OR_ZERO(tegra_phy->pll_u); in tegra_usb_phy_probe()
1214 dev_err(&pdev->dev, "Failed to get pll_u clock: %d\n", err); in tegra_usb_phy_probe()
1225 tegra_phy->pad_clk = devm_clk_get(&pdev->dev, "utmi-pads"); in tegra_usb_phy_probe()
1226 err = PTR_ERR_OR_ZERO(tegra_phy->pad_clk); in tegra_usb_phy_probe()
1228 dev_err(&pdev->dev, in tegra_usb_phy_probe()
1233 reset = devm_reset_control_get_optional_shared(&pdev->dev, in tegra_usb_phy_probe()
1234 "utmi-pads"); in tegra_usb_phy_probe()
1237 dev_err(&pdev->dev, in tegra_usb_phy_probe()
1238 "Failed to get UTMI-pads reset: %d\n", err); in tegra_usb_phy_probe()
1241 tegra_phy->pad_rst = reset; in tegra_usb_phy_probe()
1245 tegra_phy->is_ulpi_phy = true; in tegra_usb_phy_probe()
1247 tegra_phy->clk = devm_clk_get(&pdev->dev, "ulpi-link"); in tegra_usb_phy_probe()
1248 err = PTR_ERR_OR_ZERO(tegra_phy->clk); in tegra_usb_phy_probe()
1250 dev_err(&pdev->dev, in tegra_usb_phy_probe()
1255 gpiod = devm_gpiod_get_from_of_node(&pdev->dev, np, in tegra_usb_phy_probe()
1256 "nvidia,phy-reset-gpio", in tegra_usb_phy_probe()
1261 dev_err(&pdev->dev, in tegra_usb_phy_probe()
1262 "Request failed for reset GPIO: %d\n", err); in tegra_usb_phy_probe()
1265 tegra_phy->reset_gpio = gpiod; in tegra_usb_phy_probe()
1267 phy = devm_otg_ulpi_create(&pdev->dev, in tegra_usb_phy_probe()
1269 if (!phy) { in tegra_usb_phy_probe()
1270 dev_err(&pdev->dev, "Failed to create ULPI OTG\n"); in tegra_usb_phy_probe()
1271 return -ENOMEM; in tegra_usb_phy_probe()
1274 tegra_phy->ulpi = phy; in tegra_usb_phy_probe()
1275 tegra_phy->ulpi->io_priv = tegra_phy->regs + ULPI_VIEWPORT; in tegra_usb_phy_probe()
1279 dev_err(&pdev->dev, "phy_type %u is invalid or unsupported\n", in tegra_usb_phy_probe()
1281 return -EINVAL; in tegra_usb_phy_probe()
1284 tegra_phy->u_phy.dev = &pdev->dev; in tegra_usb_phy_probe()
1285 tegra_phy->u_phy.init = tegra_usb_phy_init; in tegra_usb_phy_probe()
1286 tegra_phy->u_phy.shutdown = tegra_usb_phy_shutdown; in tegra_usb_phy_probe()
1287 tegra_phy->u_phy.set_wakeup = tegra_usb_phy_set_wakeup; in tegra_usb_phy_probe()
1288 tegra_phy->u_phy.set_suspend = tegra_usb_phy_set_suspend; in tegra_usb_phy_probe()
1292 return usb_add_phy_dev(&tegra_phy->u_phy); in tegra_usb_phy_probe()
1299 usb_remove_phy(&tegra_phy->u_phy); in tegra_usb_phy_remove()
1308 .name = "tegra-phy",
1314 MODULE_DESCRIPTION("Tegra USB PHY driver");