aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-06 17:42:17 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-06 17:42:17 +0200
commit53faf1cbc0ae9e427cdbe8431ad9a62e57766615 (patch)
tree0dc64f2f92b32d9c005d90e49cfe9f9dfe29856a
parent5677655a73ebe9b6e684ac5b03c4f09e4f42efe4 (diff)
downloadltsi-kernel-53faf1cbc0ae9e427cdbe8431ad9a62e57766615.tar.gz
add USB build fix patch
-rw-r--r--patches.renesas/usb-of-add-functions-to-bind-a-companion-controller.patch86
-rw-r--r--series1
2 files changed, 87 insertions, 0 deletions
diff --git a/patches.renesas/usb-of-add-functions-to-bind-a-companion-controller.patch b/patches.renesas/usb-of-add-functions-to-bind-a-companion-controller.patch
new file mode 100644
index 00000000000000..134aa491ac3585
--- /dev/null
+++ b/patches.renesas/usb-of-add-functions-to-bind-a-companion-controller.patch
@@ -0,0 +1,86 @@
+From 5095cb89c62acc78b4cfaeb9a4072979d010510a Mon Sep 17 00:00:00 2001
+From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Date: Tue, 21 Feb 2017 19:59:47 +0900
+Subject: [PATCH] usb: of: add functions to bind a companion controller
+
+EHCI controllers will have a companion controller. However, on platform
+bus, there was difficult to bind them in previous code. So, this
+patch adds helper functions to bind them using a "companion" property.
+
+Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
+Acked-by: Rob Herring <robh@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ Documentation/devicetree/bindings/usb/generic.txt | 1
+ drivers/usb/core/of.c | 23 ++++++++++++++++++++++
+ include/linux/usb/of.h | 5 ++++
+ 3 files changed, 29 insertions(+)
+
+--- a/Documentation/devicetree/bindings/usb/generic.txt
++++ b/Documentation/devicetree/bindings/usb/generic.txt
+@@ -22,6 +22,7 @@ Optional properties:
+ property is used if any real OTG features(HNP/SRP/ADP)
+ is enabled, if ADP is required, otg-rev should be
+ 0x0200 or above.
++ - companion: phandle of a companion
+ - hnp-disable: tells OTG controllers we want to disable OTG HNP, normally HNP
+ is the basic function of real OTG except you want it
+ to be a srp-capable only B device.
+--- a/drivers/usb/core/of.c
++++ b/drivers/usb/core/of.c
+@@ -18,6 +18,7 @@
+ */
+
+ #include <linux/of.h>
++#include <linux/of_platform.h>
+ #include <linux/usb/of.h>
+
+ /**
+@@ -46,3 +47,25 @@ struct device_node *usb_of_get_child_nod
+ }
+ EXPORT_SYMBOL_GPL(usb_of_get_child_node);
+
++/**
++ * usb_of_get_companion_dev - Find the companion device
++ * @dev: the device pointer to find a companion
++ *
++ * Find the companion device from platform bus.
++ *
++ * Return: On success, a pointer to the companion device, %NULL on failure.
++ */
++struct device *usb_of_get_companion_dev(struct device *dev)
++{
++ struct device_node *node;
++ struct platform_device *pdev = NULL;
++
++ node = of_parse_phandle(dev->of_node, "companion", 0);
++ if (node)
++ pdev = of_find_device_by_node(node);
++
++ of_node_put(node);
++
++ return pdev ? &pdev->dev : NULL;
++}
++EXPORT_SYMBOL_GPL(usb_of_get_companion_dev);
+--- a/include/linux/usb/of.h
++++ b/include/linux/usb/of.h
+@@ -18,6 +18,7 @@ int of_usb_update_otg_caps(struct device
+ struct usb_otg_caps *otg_caps);
+ struct device_node *usb_of_get_child_node(struct device_node *parent,
+ int portnum);
++struct device *usb_of_get_companion_dev(struct device *dev);
+ #else
+ static inline enum usb_dr_mode
+ of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0)
+@@ -38,6 +39,10 @@ static inline struct device_node *usb_of
+ {
+ return NULL;
+ }
++static inline struct device *usb_of_get_companion_dev(struct device *dev)
++{
++ return NULL;
++}
+ #endif
+
+ #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT)
diff --git a/series b/series
index 263018060e4afb..a618ca3ef632c3 100644
--- a/series
+++ b/series
@@ -859,6 +859,7 @@ patches.renesas/thermal-rcar_gen3_thermal-enable-hardware-interrupts-for-trip-po
patches.renesas/thermal-rcar_gen3_thermal-store-device-match-data-in-private-structure.patch
patches.renesas/thermal-rcar_gen3_thermal-add-suspend-and-resume-support.patch
patches.renesas/usb-host-ehci-platform-fix-usb-1.1-device-is-not-connected-in-system-resume.patch
+patches.renesas/usb-of-add-functions-to-bind-a-companion-controller.patch
patches.renesas/usb-host-ehci-platform-set-hcd-phy-to-avoid-phy_get-in-usb_add_hcd.patch
patches.renesas/usb-host-ohci-platform-set-hcd-phy-to-avoid-phy_get-in-usb_add_hcd.patch
patches.renesas/clk-cs2000-add-suspend-resume-feature.patch