diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2015-05-08 12:12:20 +0000 |
---|---|---|
committer | Imre Kaloz <kaloz@openwrt.org> | 2015-05-08 12:12:20 +0000 |
commit | da82db150179dbb5a403b5fd88741f309b03b01c (patch) | |
tree | 44a47ae9e3a492d9fb11710aeca814ec33dc820a /target/linux/mvebu | |
parent | 56a530ab1918673bc02d7543dcbd23551d8f5751 (diff) | |
download | upstream-da82db150179dbb5a403b5fd88741f309b03b01c.tar.gz upstream-da82db150179dbb5a403b5fd88741f309b03b01c.tar.bz2 upstream-da82db150179dbb5a403b5fd88741f309b03b01c.zip |
mvebu: add xhci phy support
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45629 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mvebu')
-rw-r--r-- | target/linux/mvebu/patches-3.18/700-usb_xhci_plat_phy_support.patch | 47 | ||||
-rw-r--r-- | target/linux/mvebu/patches-4.0/700-usb_xhci_plat_phy_support.patch | 47 |
2 files changed, 94 insertions, 0 deletions
diff --git a/target/linux/mvebu/patches-3.18/700-usb_xhci_plat_phy_support.patch b/target/linux/mvebu/patches-3.18/700-usb_xhci_plat_phy_support.patch new file mode 100644 index 0000000000..3ee9f5c990 --- /dev/null +++ b/target/linux/mvebu/patches-3.18/700-usb_xhci_plat_phy_support.patch @@ -0,0 +1,47 @@ +--- a/drivers/usb/host/xhci-plat.c ++++ b/drivers/usb/host/xhci-plat.c +@@ -16,6 +16,7 @@ + #include <linux/module.h> + #include <linux/of.h> + #include <linux/platform_device.h> ++#include <linux/usb/phy.h> + #include <linux/slab.h> + #include <linux/usb/xhci_pdriver.h> + +@@ -158,12 +159,27 @@ static int xhci_plat_probe(struct platfo + if (HCC_MAX_PSA(xhci->hcc_params) >= 4) + xhci->shared_hcd->can_do_streams = 1; + ++ hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0); ++ if (IS_ERR(hcd->usb_phy)) { ++ ret = PTR_ERR(hcd->usb_phy); ++ if (ret == -EPROBE_DEFER) ++ goto put_usb3_hcd; ++ hcd->usb_phy = NULL; ++ } else { ++ ret = usb_phy_init(hcd->usb_phy); ++ if (ret) ++ goto put_usb3_hcd; ++ } ++ + ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); + if (ret) +- goto put_usb3_hcd; ++ goto disable_usb_phy; + + return 0; + ++disable_usb_phy: ++ usb_phy_shutdown(hcd->usb_phy); ++ + put_usb3_hcd: + usb_put_hcd(xhci->shared_hcd); + +@@ -187,6 +203,7 @@ static int xhci_plat_remove(struct platf + struct clk *clk = xhci->clk; + + usb_remove_hcd(xhci->shared_hcd); ++ usb_phy_shutdown(hcd->usb_phy); + usb_put_hcd(xhci->shared_hcd); + + usb_remove_hcd(hcd); diff --git a/target/linux/mvebu/patches-4.0/700-usb_xhci_plat_phy_support.patch b/target/linux/mvebu/patches-4.0/700-usb_xhci_plat_phy_support.patch new file mode 100644 index 0000000000..a315b8775f --- /dev/null +++ b/target/linux/mvebu/patches-4.0/700-usb_xhci_plat_phy_support.patch @@ -0,0 +1,47 @@ +--- a/drivers/usb/host/xhci-plat.c ++++ b/drivers/usb/host/xhci-plat.c +@@ -16,6 +16,7 @@ + #include <linux/module.h> + #include <linux/of.h> + #include <linux/platform_device.h> ++#include <linux/usb/phy.h> + #include <linux/slab.h> + #include <linux/usb/xhci_pdriver.h> + +@@ -155,12 +156,27 @@ static int xhci_plat_probe(struct platfo + if (HCC_MAX_PSA(xhci->hcc_params) >= 4) + xhci->shared_hcd->can_do_streams = 1; + ++ hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0); ++ if (IS_ERR(hcd->usb_phy)) { ++ ret = PTR_ERR(hcd->usb_phy); ++ if (ret == -EPROBE_DEFER) ++ goto put_usb3_hcd; ++ hcd->usb_phy = NULL; ++ } else { ++ ret = usb_phy_init(hcd->usb_phy); ++ if (ret) ++ goto put_usb3_hcd; ++ } ++ + ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); + if (ret) +- goto put_usb3_hcd; ++ goto disable_usb_phy; + + return 0; + ++disable_usb_phy: ++ usb_phy_shutdown(hcd->usb_phy); ++ + put_usb3_hcd: + usb_put_hcd(xhci->shared_hcd); + +@@ -184,6 +200,7 @@ static int xhci_plat_remove(struct platf + struct clk *clk = xhci->clk; + + usb_remove_hcd(xhci->shared_hcd); ++ usb_phy_shutdown(hcd->usb_phy); + usb_put_hcd(xhci->shared_hcd); + + usb_remove_hcd(hcd); |