Commit 75606f5d authored by Stephen Warren's avatar Stephen Warren

USB: EHCI: tegra: use reset framework

Tegra's clock driver now provides an implementation of the common
reset API (include/linux/reset.h). Use this instead of the old Tegra-
specific API; that will soon be removed.
Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarThierry Reding <treding@nvidia.com>
parent fe6b0dfa
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
*/ */
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/clk/tegra.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/gpio.h> #include <linux/gpio.h>
...@@ -29,6 +28,7 @@ ...@@ -29,6 +28,7 @@
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/reset.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/usb/ehci_def.h> #include <linux/usb/ehci_def.h>
#include <linux/usb/tegra_usb_phy.h> #include <linux/usb/tegra_usb_phy.h>
...@@ -62,6 +62,7 @@ static int (*orig_hub_control)(struct usb_hcd *hcd, ...@@ -62,6 +62,7 @@ static int (*orig_hub_control)(struct usb_hcd *hcd,
struct tegra_ehci_hcd { struct tegra_ehci_hcd {
struct tegra_usb_phy *phy; struct tegra_usb_phy *phy;
struct clk *clk; struct clk *clk;
struct reset_control *rst;
int port_resuming; int port_resuming;
bool needs_double_reset; bool needs_double_reset;
enum tegra_usb_phy_port_speed port_speed; enum tegra_usb_phy_port_speed port_speed;
...@@ -385,13 +386,20 @@ static int tegra_ehci_probe(struct platform_device *pdev) ...@@ -385,13 +386,20 @@ static int tegra_ehci_probe(struct platform_device *pdev)
goto cleanup_hcd_create; goto cleanup_hcd_create;
} }
tegra->rst = devm_reset_control_get(&pdev->dev, "usb");
if (IS_ERR(tegra->rst)) {
dev_err(&pdev->dev, "Can't get ehci reset\n");
err = PTR_ERR(tegra->rst);
goto cleanup_hcd_create;
}
err = clk_prepare_enable(tegra->clk); err = clk_prepare_enable(tegra->clk);
if (err) if (err)
goto cleanup_hcd_create; goto cleanup_hcd_create;
tegra_periph_reset_assert(tegra->clk); reset_control_assert(tegra->rst);
udelay(1); udelay(1);
tegra_periph_reset_deassert(tegra->clk); reset_control_deassert(tegra->rst);
u_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0); u_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0);
if (IS_ERR(u_phy)) { if (IS_ERR(u_phy)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment