diff options
| -rw-r--r-- | drivers/usb/host/ehci-tegra.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index c1c1024a054c..9a3d7db5be57 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c | |||
| @@ -81,15 +81,23 @@ static int tegra_reset_usb_controller(struct platform_device *pdev) | |||
| 81 | struct usb_hcd *hcd = platform_get_drvdata(pdev); | 81 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 82 | struct tegra_ehci_hcd *tegra = | 82 | struct tegra_ehci_hcd *tegra = |
| 83 | (struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv; | 83 | (struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv; |
| 84 | bool has_utmi_pad_registers = false; | ||
| 84 | 85 | ||
| 85 | phy_np = of_parse_phandle(pdev->dev.of_node, "nvidia,phy", 0); | 86 | phy_np = of_parse_phandle(pdev->dev.of_node, "nvidia,phy", 0); |
| 86 | if (!phy_np) | 87 | if (!phy_np) |
| 87 | return -ENOENT; | 88 | return -ENOENT; |
| 88 | 89 | ||
| 90 | if (of_property_read_bool(phy_np, "nvidia,has-utmi-pad-registers")) | ||
| 91 | has_utmi_pad_registers = true; | ||
| 92 | |||
| 89 | if (!usb1_reset_attempted) { | 93 | if (!usb1_reset_attempted) { |
| 90 | struct reset_control *usb1_reset; | 94 | struct reset_control *usb1_reset; |
| 91 | 95 | ||
| 92 | usb1_reset = of_reset_control_get(phy_np, "utmi-pads"); | 96 | if (!has_utmi_pad_registers) |
| 97 | usb1_reset = of_reset_control_get(phy_np, "utmi-pads"); | ||
| 98 | else | ||
| 99 | usb1_reset = tegra->rst; | ||
| 100 | |||
| 93 | if (IS_ERR(usb1_reset)) { | 101 | if (IS_ERR(usb1_reset)) { |
| 94 | dev_warn(&pdev->dev, | 102 | dev_warn(&pdev->dev, |
| 95 | "can't get utmi-pads reset from the PHY\n"); | 103 | "can't get utmi-pads reset from the PHY\n"); |
| @@ -99,13 +107,15 @@ static int tegra_reset_usb_controller(struct platform_device *pdev) | |||
| 99 | reset_control_assert(usb1_reset); | 107 | reset_control_assert(usb1_reset); |
| 100 | udelay(1); | 108 | udelay(1); |
| 101 | reset_control_deassert(usb1_reset); | 109 | reset_control_deassert(usb1_reset); |
| 110 | |||
| 111 | if (!has_utmi_pad_registers) | ||
| 112 | reset_control_put(usb1_reset); | ||
| 102 | } | 113 | } |
| 103 | 114 | ||
| 104 | reset_control_put(usb1_reset); | ||
| 105 | usb1_reset_attempted = true; | 115 | usb1_reset_attempted = true; |
| 106 | } | 116 | } |
| 107 | 117 | ||
| 108 | if (!of_property_read_bool(phy_np, "nvidia,has-utmi-pad-registers")) { | 118 | if (!has_utmi_pad_registers) { |
| 109 | reset_control_assert(tegra->rst); | 119 | reset_control_assert(tegra->rst); |
| 110 | udelay(1); | 120 | udelay(1); |
| 111 | reset_control_deassert(tegra->rst); | 121 | reset_control_deassert(tegra->rst); |
