From 11f3971328e37dd1976eb26da47d01e297211a5b Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Mon, 24 Nov 2014 17:56:13 +1000 Subject: linux-xlnx_3.14: Move patches to linux-xlnx/3.14 subdir * Manage patches on a per version basis Signed-off-by: Nathan Rossi --- ...sb-host-zynq-dr-of-PHY-reset-during-probe.patch | 58 ++++++++++++++++++++++ ...sb-host-zynq-dr-of-PHY-reset-during-probe.patch | 58 ---------------------- recipes-kernel/linux/linux-xlnx_3.14.bb | 1 + 3 files changed, 59 insertions(+), 58 deletions(-) create mode 100644 recipes-kernel/linux/linux-xlnx/3.14/usb-host-zynq-dr-of-PHY-reset-during-probe.patch delete mode 100644 recipes-kernel/linux/linux-xlnx/usb-host-zynq-dr-of-PHY-reset-during-probe.patch diff --git a/recipes-kernel/linux/linux-xlnx/3.14/usb-host-zynq-dr-of-PHY-reset-during-probe.patch b/recipes-kernel/linux/linux-xlnx/3.14/usb-host-zynq-dr-of-PHY-reset-during-probe.patch new file mode 100644 index 00000000..6ef36098 --- /dev/null +++ b/recipes-kernel/linux/linux-xlnx/3.14/usb-host-zynq-dr-of-PHY-reset-during-probe.patch @@ -0,0 +1,58 @@ +From: Mike Looijmans +Date: Thu, 25 Sep 2014 07:53:49 +0200 +Subject: [PATCH] usb/host/zynq-dr-of: PHY reset during probe + +--- + drivers/usb/host/zynq-dr-of.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/drivers/usb/host/zynq-dr-of.c b/drivers/usb/host/zynq-dr-of.c +index 9ab936a..2765894 100644 +--- a/drivers/usb/host/zynq-dr-of.c ++++ b/drivers/usb/host/zynq-dr-of.c +@@ -26,6 +26,8 @@ + #include + #include + #include ++#include ++#include + + #include "ehci-zynq.h" + +@@ -152,11 +154,33 @@ static int zynq_dr_of_probe(struct platform_device *ofdev) + static unsigned int idx; + struct resource *res; + int i, phy_init; ++ int reset_gpio; + int ret; + + pdata = &data; + memset(pdata, 0, sizeof(data)); + ++ reset_gpio = of_get_named_gpio(np, "xlnx,phy-reset-gpio", 0); ++ if (gpio_is_valid(reset_gpio)) { ++ ret = devm_gpio_request_one(&ofdev->dev, reset_gpio, ++ GPIOF_INIT_LOW, "ulpi resetb"); ++ if (ret) { ++ dev_err(&ofdev->dev, "Failed to request ULPI reset gpio: %d\n", ret); ++ return ret; ++ } ++ udelay(1); /* ULPI Datasheet specifies a 1us pulse width for reset */ ++ if (of_property_read_bool(np, "xlnx,phy-reset-gpio-tristate")) ++ gpio_direction_input(reset_gpio); ++ else ++ gpio_set_value_cansleep(reset_gpio, 1); ++ udelay(1); /* ULPI will assert the DIR line, give it time to do so */ ++ } else { ++ /* GPIO controller is not yet available, try again later. */ ++ if (reset_gpio == -EPROBE_DEFER) { ++ return -EPROBE_DEFER; ++ } ++ } ++ + res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); + if (IS_ERR(res)) { + dev_err(&ofdev->dev, +-- +2.1.1 + diff --git a/recipes-kernel/linux/linux-xlnx/usb-host-zynq-dr-of-PHY-reset-during-probe.patch b/recipes-kernel/linux/linux-xlnx/usb-host-zynq-dr-of-PHY-reset-during-probe.patch deleted file mode 100644 index 6ef36098..00000000 --- a/recipes-kernel/linux/linux-xlnx/usb-host-zynq-dr-of-PHY-reset-during-probe.patch +++ /dev/null @@ -1,58 +0,0 @@ -From: Mike Looijmans -Date: Thu, 25 Sep 2014 07:53:49 +0200 -Subject: [PATCH] usb/host/zynq-dr-of: PHY reset during probe - ---- - drivers/usb/host/zynq-dr-of.c | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - -diff --git a/drivers/usb/host/zynq-dr-of.c b/drivers/usb/host/zynq-dr-of.c -index 9ab936a..2765894 100644 ---- a/drivers/usb/host/zynq-dr-of.c -+++ b/drivers/usb/host/zynq-dr-of.c -@@ -26,6 +26,8 @@ - #include - #include - #include -+#include -+#include - - #include "ehci-zynq.h" - -@@ -152,11 +154,33 @@ static int zynq_dr_of_probe(struct platform_device *ofdev) - static unsigned int idx; - struct resource *res; - int i, phy_init; -+ int reset_gpio; - int ret; - - pdata = &data; - memset(pdata, 0, sizeof(data)); - -+ reset_gpio = of_get_named_gpio(np, "xlnx,phy-reset-gpio", 0); -+ if (gpio_is_valid(reset_gpio)) { -+ ret = devm_gpio_request_one(&ofdev->dev, reset_gpio, -+ GPIOF_INIT_LOW, "ulpi resetb"); -+ if (ret) { -+ dev_err(&ofdev->dev, "Failed to request ULPI reset gpio: %d\n", ret); -+ return ret; -+ } -+ udelay(1); /* ULPI Datasheet specifies a 1us pulse width for reset */ -+ if (of_property_read_bool(np, "xlnx,phy-reset-gpio-tristate")) -+ gpio_direction_input(reset_gpio); -+ else -+ gpio_set_value_cansleep(reset_gpio, 1); -+ udelay(1); /* ULPI will assert the DIR line, give it time to do so */ -+ } else { -+ /* GPIO controller is not yet available, try again later. */ -+ if (reset_gpio == -EPROBE_DEFER) { -+ return -EPROBE_DEFER; -+ } -+ } -+ - res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0); - if (IS_ERR(res)) { - dev_err(&ofdev->dev, --- -2.1.1 - diff --git a/recipes-kernel/linux/linux-xlnx_3.14.bb b/recipes-kernel/linux/linux-xlnx_3.14.bb index a941c4a7..d33b3a58 100644 --- a/recipes-kernel/linux/linux-xlnx_3.14.bb +++ b/recipes-kernel/linux/linux-xlnx_3.14.bb @@ -5,6 +5,7 @@ SRCREV ?= "2b48a8aeea7367359f9eebe55c4a09a05227f32b" include linux-xlnx.inc +FILESEXTRAPATHS_prepend := "${THISDIR}/linux-xlnx/3.14:" SRC_URI_append += " \ file://usb-host-zynq-dr-of-PHY-reset-during-probe.patch \ " -- cgit v1.2.3-54-g00ecf