All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <50F037C9.40306@ti.com>

diff --git a/a/1.txt b/N1/1.txt
index f7c99a6..398d3fc 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -231,19 +231,3 @@ index d63eb7d..927b8a1 100644
  /*-------------------------------------------------------------------------*/
 -- 
 1.7.4.1
-
-
--------------- next part --------------
-A non-text attachment was scrubbed...
-Name: 0001-USB-ehci-omap-Convert-to-platform-driver.patch
-Type: text/x-patch
-Size: 5842 bytes
-Desc: not available
-URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130111/84d5647c/attachment-0002.bin>
--------------- next part --------------
-A non-text attachment was scrubbed...
-Name: 0002-usb-ehci-omap-Instantiate-PHY-devices-if-required.patch
-Type: text/x-patch
-Size: 5784 bytes
-Desc: not available
-URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130111/84d5647c/attachment-0003.bin>
diff --git a/N1/2.hdr b/N1/2.hdr
new file mode 100644
index 0000000..22f0d35
--- /dev/null
+++ b/N1/2.hdr
@@ -0,0 +1,5 @@
+Content-Type: text/x-patch;
+	name="0001-USB-ehci-omap-Convert-to-platform-driver.patch"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="0001-USB-ehci-omap-Convert-to-platform-driver.patch"
diff --git a/N1/2.txt b/N1/2.txt
new file mode 100644
index 0000000..e5f7aa0
--- /dev/null
+++ b/N1/2.txt
@@ -0,0 +1,194 @@
+>From fafa9c787bcf2ff3f46c07c045997614d7a8a417 Mon Sep 17 00:00:00 2001
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Fri, 11 Jan 2013 12:37:01 +0200
+Subject: [PATCH] USB: ehci-omap: Convert to platform driver
+
+Convert ehci-omap into a platform driver and use ehci-hcd
+as a library.
+
+CC: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Roger Quadros <rogerq@ti.com>
+---
+ drivers/usb/host/Kconfig     |    2 +-
+ drivers/usb/host/Makefile    |    1 +
+ drivers/usb/host/ehci-hcd.c  |    6 +---
+ drivers/usb/host/ehci-omap.c |   76 +++++++++++++++++++-----------------------
+ 4 files changed, 37 insertions(+), 48 deletions(-)
+
+diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
+index d6bb128..432a463 100644
+--- a/drivers/usb/host/Kconfig
++++ b/drivers/usb/host/Kconfig
+@@ -155,7 +155,7 @@ config USB_EHCI_MXC
+ 	  Variation of ARC USB block used in some Freescale chips.
+ 
+ config USB_EHCI_HCD_OMAP
+-	bool "EHCI support for OMAP3 and later chips"
++	tristate "EHCI support for OMAP3 and later chips"
+ 	depends on USB_EHCI_HCD && ARCH_OMAP
+ 	default y
+ 	---help---
+diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
+index 1eb4c30..8a8d079 100644
+--- a/drivers/usb/host/Makefile
++++ b/drivers/usb/host/Makefile
+@@ -26,6 +26,7 @@ obj-$(CONFIG_PCI)		+= pci-quirks.o
+ obj-$(CONFIG_USB_EHCI_HCD)	+= ehci-hcd.o
+ obj-$(CONFIG_USB_EHCI_PCI)	+= ehci-pci.o
+ obj-$(CONFIG_USB_EHCI_HCD_PLATFORM)	+= ehci-platform.o
++obj-$(CONFIG_USB_EHCI_HCD_OMAP)	+= ehci-omap.o
+ 
+ obj-$(CONFIG_USB_OXU210HP_HCD)	+= oxu210hp-hcd.o
+ obj-$(CONFIG_USB_ISP116X_HCD)	+= isp116x-hcd.o
+diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
+index c97503b..c44ef1d 100644
+--- a/drivers/usb/host/ehci-hcd.c
++++ b/drivers/usb/host/ehci-hcd.c
+@@ -1260,11 +1260,6 @@ MODULE_LICENSE ("GPL");
+ #define PLATFORM_DRIVER		ehci_hcd_sh_driver
+ #endif
+ 
+-#ifdef CONFIG_USB_EHCI_HCD_OMAP
+-#include "ehci-omap.c"
+-#define        PLATFORM_DRIVER         ehci_hcd_omap_driver
+-#endif
+-
+ #ifdef CONFIG_PPC_PS3
+ #include "ehci-ps3.c"
+ #define	PS3_SYSTEM_BUS_DRIVER	ps3_ehci_driver
+@@ -1352,6 +1347,7 @@ MODULE_LICENSE ("GPL");
+ 
+ #if !IS_ENABLED(CONFIG_USB_EHCI_PCI) && \
+ 	!IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \
++	!IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) && \
+ 	!defined(CONFIG_USB_CHIPIDEA_HOST) && \
+ 	!defined(PLATFORM_DRIVER) && \
+ 	!defined(PS3_SYSTEM_BUS_DRIVER) && \
+diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
+index b96a4bf..6388aa6 100644
+--- a/drivers/usb/host/ehci-omap.c
++++ b/drivers/usb/host/ehci-omap.c
+@@ -36,6 +36,9 @@
+  *	- convert to use hwmod and runtime PM
+  */
+ 
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/io.h>
+ #include <linux/platform_device.h>
+ #include <linux/slab.h>
+ #include <linux/usb/ulpi.h>
+@@ -43,6 +46,10 @@
+ #include <linux/pm_runtime.h>
+ #include <linux/gpio.h>
+ #include <linux/clk.h>
++#include <linux/usb.h>
++#include <linux/usb/hcd.h>
++
++#include "ehci.h"
+ 
+ #include <linux/platform_data/usb-omap.h>
+ 
+@@ -57,9 +64,11 @@
+ #define	EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT		8
+ #define	EHCI_INSNREG05_ULPI_WRDATA_SHIFT		0
+ 
+-/*-------------------------------------------------------------------------*/
++#define DRIVER_DESC "OMAP-EHCI Host Controller driver"
+ 
+-static const struct hc_driver ehci_omap_hc_driver;
++static const char hcd_name[] = "ehci-omap";
++
++/*-------------------------------------------------------------------------*/
+ 
+ 
+ static inline void ehci_write(void __iomem *base, u32 reg, u32 val)
+@@ -166,6 +175,12 @@ static void disable_put_regulator(
+ /* configure so an HC device and id are always provided */
+ /* always called with process context; sleeping is OK */
+ 
++static struct hc_driver __read_mostly ehci_omap_hc_driver;
++
++static const struct ehci_driver_overrides ehci_omap_overrides __initdata = {
++	.reset =	omap_ehci_init,
++};
++
+ /**
+  * ehci_hcd_omap_probe - initialize TI-based HCDs
+  *
+@@ -315,56 +330,33 @@ static struct platform_driver ehci_hcd_omap_driver = {
+ 	/*.suspend		= ehci_hcd_omap_suspend, */
+ 	/*.resume		= ehci_hcd_omap_resume, */
+ 	.driver = {
+-		.name		= "ehci-omap",
++		.name		= hcd_name,
+ 	}
+ };
+ 
+ /*-------------------------------------------------------------------------*/
+ 
+-static const struct hc_driver ehci_omap_hc_driver = {
+-	.description		= hcd_name,
+-	.product_desc		= "OMAP-EHCI Host Controller",
+-	.hcd_priv_size		= sizeof(struct ehci_hcd),
+-
+-	/*
+-	 * generic hardware linkage
+-	 */
+-	.irq			= ehci_irq,
+-	.flags			= HCD_MEMORY | HCD_USB2,
+-
+-	/*
+-	 * basic lifecycle operations
+-	 */
+-	.reset			= omap_ehci_init,
+-	.start			= ehci_run,
+-	.stop			= ehci_stop,
+-	.shutdown		= ehci_shutdown,
+-
+-	/*
+-	 * managing i/o requests and associated device resources
+-	 */
+-	.urb_enqueue		= ehci_urb_enqueue,
+-	.urb_dequeue		= ehci_urb_dequeue,
+-	.endpoint_disable	= ehci_endpoint_disable,
+-	.endpoint_reset		= ehci_endpoint_reset,
++static int __init ehci_omap_init(void)
++{
++	if (usb_disabled())
++		return -ENODEV;
+ 
+-	/*
+-	 * scheduling support
+-	 */
+-	.get_frame_number	= ehci_get_frame,
++	pr_info("%s: " DRIVER_DESC "\n", hcd_name);
+ 
+-	/*
+-	 * root hub support
+-	 */
+-	.hub_status_data	= ehci_hub_status_data,
+-	.hub_control		= ehci_hub_control,
+-	.bus_suspend		= ehci_bus_suspend,
+-	.bus_resume		= ehci_bus_resume,
++	ehci_init_driver(&ehci_omap_hc_driver, &ehci_omap_overrides);
++	return platform_driver_register(&ehci_hcd_omap_driver);
++}
++module_init(ehci_omap_init);
+ 
+-	.clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
+-};
++static void __exit ehci_omap_cleanup(void)
++{
++	platform_driver_unregister(&ehci_hcd_omap_driver);
++}
++module_exit(ehci_omap_cleanup);
+ 
+ MODULE_ALIAS("platform:omap-ehci");
+ MODULE_AUTHOR("Texas Instruments, Inc.");
+ MODULE_AUTHOR("Felipe Balbi <felipe.balbi@nokia.com>");
+ 
++MODULE_DESCRIPTION(DRIVER_DESC);
++MODULE_LICENSE("GPL");
+-- 
+1.7.4.1
diff --git a/N1/3.hdr b/N1/3.hdr
new file mode 100644
index 0000000..21179c7
--- /dev/null
+++ b/N1/3.hdr
@@ -0,0 +1,5 @@
+Content-Type: text/x-patch;
+	name="0002-usb-ehci-omap-Instantiate-PHY-devices-if-required.patch"
+Content-Transfer-Encoding: 7bit
+Content-Disposition: attachment;
+	filename="0002-usb-ehci-omap-Instantiate-PHY-devices-if-required.patch"
diff --git a/N1/3.txt b/N1/3.txt
new file mode 100644
index 0000000..8a78336
--- /dev/null
+++ b/N1/3.txt
@@ -0,0 +1,194 @@
+>From 1f0e3fdaeda35c96edfdc551434cc841f3b65363 Mon Sep 17 00:00:00 2001
+From: Roger Quadros <rogerq@ti.com>
+Date: Tue, 8 Jan 2013 16:05:16 +0200
+Subject: [PATCH] usb: ehci-omap: Instantiate PHY devices if required
+
+If the OMAP's Host controller is in PHY mode then we instantiate
+a platform device for the PHY (one for each port in PHY mode) and
+hold a reference to it so that we can use the usb_phy API, e.g.
+while suspend/resume.
+
+The platform data for the PHY must be supplied in the newly added
+.phy_config parameter in struct usbhs_omap_platform_data.
+
+The end goal is to move the PHY's reset and power handling code
+out of the ehci-omap driver and into the phy driver.
+
+Signed-off-by: Roger Quadros <rogerq@ti.com>
+---
+ drivers/usb/host/ehci-omap.c           |   83 ++++++++++++++++++++++++++++++-
+ include/linux/platform_data/usb-omap.h |    8 +++
+ 2 files changed, 88 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
+index 6388aa6..23c9b9c 100644
+--- a/drivers/usb/host/ehci-omap.c
++++ b/drivers/usb/host/ehci-omap.c
+@@ -70,6 +70,11 @@ static const char hcd_name[] = "ehci-omap";
+ 
+ /*-------------------------------------------------------------------------*/
+ 
++struct omap_ehci_hcd {
++	struct usb_hcd *hcd;
++	struct usb_phy **phy;	/* one PHY for each port */
++	int nports;
++};
+ 
+ static inline void ehci_write(void __iomem *base, u32 reg, u32 val)
+ {
+@@ -194,6 +199,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
+ 	struct usbhs_omap_platform_data		*pdata = dev->platform_data;
+ 	struct resource				*res;
+ 	struct usb_hcd				*hcd;
++	struct omap_ehci_hcd			*omap_hcd;
++	struct usb_phy				*phy;
+ 	void __iomem				*regs;
+ 	int					ret = -ENODEV;
+ 	int					irq;
+@@ -208,6 +215,25 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
+ 		return -ENODEV;
+ 	}
+ 
++	if (!pdata) {
++		dev_err(dev, "Missing platform data\n");
++		return -ENODEV;
++	}
++
++	omap_hcd = devm_kzalloc(&pdev->dev, sizeof(*omap_hcd), GFP_KERNEL);
++	if (!omap_hcd) {
++		dev_err(dev, "Memory allocation failed\n");
++		return -ENOMEM;
++	}
++
++	omap_hcd->nports = pdata->nports;
++	i = sizeof(struct usb_phy *) * omap_hcd->nports;
++	omap_hcd->phy = devm_kzalloc(&pdev->dev, i, GFP_KERNEL);
++	if (!omap_hcd->phy) {
++		dev_err(dev, "Memory allocation failed\n");
++		return -ENOMEM;
++	}
++
+ 	irq = platform_get_irq_byname(pdev, "ehci-irq");
+ 	if (irq < 0) {
+ 		dev_err(dev, "EHCI irq failed\n");
+@@ -238,9 +264,15 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
+ 	hcd->rsrc_start = res->start;
+ 	hcd->rsrc_len = resource_size(res);
+ 	hcd->regs = regs;
++	omap_hcd->hcd = hcd;
++
++	platform_set_drvdata(pdev, omap_hcd);
+ 
+ 	/* get ehci regulator and enable */
+-	for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
++	for (i = 0 ; i < omap_hcd->nports ; i++) {
++		struct platform_device *phy_pdev;
++		struct usbhs_phy_config *phy_config;
++
+ 		if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) {
+ 			pdata->regulator[i] = NULL;
+ 			continue;
+@@ -254,6 +286,33 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
+ 		} else {
+ 			regulator_enable(pdata->regulator[i]);
+ 		}
++
++		/* instantiate PHY */
++		if (!pdata->phy_config[i]) {
++			dev_dbg(dev, "missing phy_config for port %d\n", i);
++			continue;
++		}
++
++		phy_config = pdata->phy_config[i];
++		phy_pdev = platform_device_register_data(&pdev->dev,
++				phy_config->name, i, phy_config->pdata,
++				phy_config->pdata_size);
++		if (IS_ERR(phy_pdev)) {
++			dev_dbg(dev, "error creating PHY device for port %d\n",
++					i);
++		}
++
++		phy = usb_get_phy_from_dev(&phy_pdev->dev);
++		if (IS_ERR(phy)) {
++			dev_dbg(dev, "could not get USB PHY for port %d\n", i);
++			platform_device_unregister(phy_pdev);
++			continue;
++		}
++
++		usb_phy_init(phy);
++		omap_hcd->phy[i] = phy;
++		/* bring PHY out of suspend */
++		usb_phy_set_suspend(omap_hcd->phy[i], 0);
+ 	}
+ 
+ 	pm_runtime_enable(dev);
+@@ -284,6 +343,12 @@ err_pm_runtime:
+ 	disable_put_regulator(pdata);
+ 	pm_runtime_put_sync(dev);
+ 	usb_put_hcd(hcd);
++	for (i = 0 ; i < omap_hcd->nports ; i++) {
++		phy = omap_hcd->phy[i];
++		if (!phy)
++			continue;
++		platform_device_unregister(to_platform_device(phy->dev));
++	}
+ 
+ err_io:
+ 	iounmap(regs);
+@@ -301,14 +366,26 @@ err_io:
+  */
+ static int ehci_hcd_omap_remove(struct platform_device *pdev)
+ {
+-	struct device *dev				= &pdev->dev;
+-	struct usb_hcd *hcd				= dev_get_drvdata(dev);
++	struct device *dev		= &pdev->dev;
++	struct omap_ehci_hcd *omap_hcd	= dev_get_drvdata(dev);
++	struct usb_hcd *hcd		= omap_hcd->hcd;
++	int i;
+ 
+ 	usb_remove_hcd(hcd);
+ 	disable_put_regulator(dev->platform_data);
+ 	iounmap(hcd->regs);
+ 	usb_put_hcd(hcd);
+ 
++	for (i = 0; i < omap_hcd->nports; i++) {
++		struct usb_phy *phy = omap_hcd->phy[i];
++
++		if (!phy)
++			continue;
++
++		usb_phy_shutdown(phy);
++		platform_device_unregister(to_platform_device(phy->dev));
++	}
++
+ 	pm_runtime_put_sync(dev);
+ 	pm_runtime_disable(dev);
+ 
+diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h
+index d63eb7d..927b8a1 100644
+--- a/include/linux/platform_data/usb-omap.h
++++ b/include/linux/platform_data/usb-omap.h
+@@ -38,6 +38,12 @@ enum usbhs_omap_port_mode {
+ 	OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM
+ };
+ 
++struct usbhs_phy_config {
++	char *name;		/* binds to device driver */
++	void *pdata;		/* platform data for the phy */
++	size_t pdata_size;
++};
++
+ struct usbhs_omap_platform_data {
+ 	int				nports;
+ 	enum usbhs_omap_port_mode	port_mode[OMAP3_HS_USB_PORTS];
+@@ -49,6 +55,8 @@ struct usbhs_omap_platform_data {
+ 	unsigned			single_ulpi_bypass:1;
+ 	unsigned			es2_compatibility:1;
+ 	unsigned			phy_reset:1;
++
++	struct usbhs_phy_config		*phy_config[OMAP3_HS_USB_PORTS];
+ };
+ 
+ /*-------------------------------------------------------------------------*/
+-- 
+1.7.4.1
diff --git a/a/content_digest b/N1/content_digest
index 048ac50..8a522cc 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,9 +1,17 @@
  "ref\0Pine.LNX.4.44L0.1301111019340.1730-100000@iolanthe.rowland.org\0"
- "From\0rogerq@ti.com (Roger Quadros)\0"
- "Subject\0[PATCH 07/14] usb: ehci-omap: Instantiate PHY devices if required\0"
+ "From\0Roger Quadros <rogerq@ti.com>\0"
+ "Subject\0Re: [PATCH 07/14] usb: ehci-omap: Instantiate PHY devices if required\0"
  "Date\0Fri, 11 Jan 2013 18:03:21 +0200\0"
- "To\0linux-arm-kernel@lists.infradead.org\0"
- "\00:1\0"
+ "To\0Alan Stern <stern@rowland.harvard.edu>\0"
+ "Cc\0Felipe Balbi <balbi@ti.com>"
+  <gregkh@linuxfoundation.org>
+  <sameo@linux.intel.com>
+  <tony@atomide.com>
+  <kishon@ti.com>
+  USB list <linux-usb@vger.kernel.org>
+  Kernel development list <linux-kernel@vger.kernel.org>
+ " <linux-arm-kernel@lists.infradead.org>\0"
+ "\01:1\0"
  "b\0"
  "On 01/11/2013 05:28 PM, Alan Stern wrote:\n"
  "> On Fri, 11 Jan 2013, Roger Quadros wrote:\n"
@@ -237,22 +245,400 @@
  "\n"
  " /*-------------------------------------------------------------------------*/\n"
  "-- \n"
- "1.7.4.1\n"
- "\n"
- "\n"
- "-------------- next part --------------\n"
- "A non-text attachment was scrubbed...\n"
- "Name: 0001-USB-ehci-omap-Convert-to-platform-driver.patch\n"
- "Type: text/x-patch\n"
- "Size: 5842 bytes\n"
- "Desc: not available\n"
- "URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130111/84d5647c/attachment-0002.bin>\n"
- "-------------- next part --------------\n"
- "A non-text attachment was scrubbed...\n"
- "Name: 0002-usb-ehci-omap-Instantiate-PHY-devices-if-required.patch\n"
- "Type: text/x-patch\n"
- "Size: 5784 bytes\n"
- "Desc: not available\n"
- URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130111/84d5647c/attachment-0003.bin>
+ 1.7.4.1
+ "\01:2\0"
+ "fn\00001-USB-ehci-omap-Convert-to-platform-driver.patch\0"
+ "b\0"
+ ">From fafa9c787bcf2ff3f46c07c045997614d7a8a417 Mon Sep 17 00:00:00 2001\n"
+ "From: Alan Stern <stern@rowland.harvard.edu>\n"
+ "Date: Fri, 11 Jan 2013 12:37:01 +0200\n"
+ "Subject: [PATCH] USB: ehci-omap: Convert to platform driver\n"
+ "\n"
+ "Convert ehci-omap into a platform driver and use ehci-hcd\n"
+ "as a library.\n"
+ "\n"
+ "CC: Alan Stern <stern@rowland.harvard.edu>\n"
+ "Signed-off-by: Roger Quadros <rogerq@ti.com>\n"
+ "---\n"
+ " drivers/usb/host/Kconfig     |    2 +-\n"
+ " drivers/usb/host/Makefile    |    1 +\n"
+ " drivers/usb/host/ehci-hcd.c  |    6 +---\n"
+ " drivers/usb/host/ehci-omap.c |   76 +++++++++++++++++++-----------------------\n"
+ " 4 files changed, 37 insertions(+), 48 deletions(-)\n"
+ "\n"
+ "diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig\n"
+ "index d6bb128..432a463 100644\n"
+ "--- a/drivers/usb/host/Kconfig\n"
+ "+++ b/drivers/usb/host/Kconfig\n"
+ "@@ -155,7 +155,7 @@ config USB_EHCI_MXC\n"
+ " \t  Variation of ARC USB block used in some Freescale chips.\n"
+ " \n"
+ " config USB_EHCI_HCD_OMAP\n"
+ "-\tbool \"EHCI support for OMAP3 and later chips\"\n"
+ "+\ttristate \"EHCI support for OMAP3 and later chips\"\n"
+ " \tdepends on USB_EHCI_HCD && ARCH_OMAP\n"
+ " \tdefault y\n"
+ " \t---help---\n"
+ "diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile\n"
+ "index 1eb4c30..8a8d079 100644\n"
+ "--- a/drivers/usb/host/Makefile\n"
+ "+++ b/drivers/usb/host/Makefile\n"
+ "@@ -26,6 +26,7 @@ obj-$(CONFIG_PCI)\t\t+= pci-quirks.o\n"
+ " obj-$(CONFIG_USB_EHCI_HCD)\t+= ehci-hcd.o\n"
+ " obj-$(CONFIG_USB_EHCI_PCI)\t+= ehci-pci.o\n"
+ " obj-$(CONFIG_USB_EHCI_HCD_PLATFORM)\t+= ehci-platform.o\n"
+ "+obj-$(CONFIG_USB_EHCI_HCD_OMAP)\t+= ehci-omap.o\n"
+ " \n"
+ " obj-$(CONFIG_USB_OXU210HP_HCD)\t+= oxu210hp-hcd.o\n"
+ " obj-$(CONFIG_USB_ISP116X_HCD)\t+= isp116x-hcd.o\n"
+ "diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c\n"
+ "index c97503b..c44ef1d 100644\n"
+ "--- a/drivers/usb/host/ehci-hcd.c\n"
+ "+++ b/drivers/usb/host/ehci-hcd.c\n"
+ "@@ -1260,11 +1260,6 @@ MODULE_LICENSE (\"GPL\");\n"
+ " #define PLATFORM_DRIVER\t\tehci_hcd_sh_driver\n"
+ " #endif\n"
+ " \n"
+ "-#ifdef CONFIG_USB_EHCI_HCD_OMAP\n"
+ "-#include \"ehci-omap.c\"\n"
+ "-#define        PLATFORM_DRIVER         ehci_hcd_omap_driver\n"
+ "-#endif\n"
+ "-\n"
+ " #ifdef CONFIG_PPC_PS3\n"
+ " #include \"ehci-ps3.c\"\n"
+ " #define\tPS3_SYSTEM_BUS_DRIVER\tps3_ehci_driver\n"
+ "@@ -1352,6 +1347,7 @@ MODULE_LICENSE (\"GPL\");\n"
+ " \n"
+ " #if !IS_ENABLED(CONFIG_USB_EHCI_PCI) && \\\n"
+ " \t!IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \\\n"
+ "+\t!IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) && \\\n"
+ " \t!defined(CONFIG_USB_CHIPIDEA_HOST) && \\\n"
+ " \t!defined(PLATFORM_DRIVER) && \\\n"
+ " \t!defined(PS3_SYSTEM_BUS_DRIVER) && \\\n"
+ "diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c\n"
+ "index b96a4bf..6388aa6 100644\n"
+ "--- a/drivers/usb/host/ehci-omap.c\n"
+ "+++ b/drivers/usb/host/ehci-omap.c\n"
+ "@@ -36,6 +36,9 @@\n"
+ "  *\t- convert to use hwmod and runtime PM\n"
+ "  */\n"
+ " \n"
+ "+#include <linux/kernel.h>\n"
+ "+#include <linux/module.h>\n"
+ "+#include <linux/io.h>\n"
+ " #include <linux/platform_device.h>\n"
+ " #include <linux/slab.h>\n"
+ " #include <linux/usb/ulpi.h>\n"
+ "@@ -43,6 +46,10 @@\n"
+ " #include <linux/pm_runtime.h>\n"
+ " #include <linux/gpio.h>\n"
+ " #include <linux/clk.h>\n"
+ "+#include <linux/usb.h>\n"
+ "+#include <linux/usb/hcd.h>\n"
+ "+\n"
+ "+#include \"ehci.h\"\n"
+ " \n"
+ " #include <linux/platform_data/usb-omap.h>\n"
+ " \n"
+ "@@ -57,9 +64,11 @@\n"
+ " #define\tEHCI_INSNREG05_ULPI_EXTREGADD_SHIFT\t\t8\n"
+ " #define\tEHCI_INSNREG05_ULPI_WRDATA_SHIFT\t\t0\n"
+ " \n"
+ "-/*-------------------------------------------------------------------------*/\n"
+ "+#define DRIVER_DESC \"OMAP-EHCI Host Controller driver\"\n"
+ " \n"
+ "-static const struct hc_driver ehci_omap_hc_driver;\n"
+ "+static const char hcd_name[] = \"ehci-omap\";\n"
+ "+\n"
+ "+/*-------------------------------------------------------------------------*/\n"
+ " \n"
+ " \n"
+ " static inline void ehci_write(void __iomem *base, u32 reg, u32 val)\n"
+ "@@ -166,6 +175,12 @@ static void disable_put_regulator(\n"
+ " /* configure so an HC device and id are always provided */\n"
+ " /* always called with process context; sleeping is OK */\n"
+ " \n"
+ "+static struct hc_driver __read_mostly ehci_omap_hc_driver;\n"
+ "+\n"
+ "+static const struct ehci_driver_overrides ehci_omap_overrides __initdata = {\n"
+ "+\t.reset =\tomap_ehci_init,\n"
+ "+};\n"
+ "+\n"
+ " /**\n"
+ "  * ehci_hcd_omap_probe - initialize TI-based HCDs\n"
+ "  *\n"
+ "@@ -315,56 +330,33 @@ static struct platform_driver ehci_hcd_omap_driver = {\n"
+ " \t/*.suspend\t\t= ehci_hcd_omap_suspend, */\n"
+ " \t/*.resume\t\t= ehci_hcd_omap_resume, */\n"
+ " \t.driver = {\n"
+ "-\t\t.name\t\t= \"ehci-omap\",\n"
+ "+\t\t.name\t\t= hcd_name,\n"
+ " \t}\n"
+ " };\n"
+ " \n"
+ " /*-------------------------------------------------------------------------*/\n"
+ " \n"
+ "-static const struct hc_driver ehci_omap_hc_driver = {\n"
+ "-\t.description\t\t= hcd_name,\n"
+ "-\t.product_desc\t\t= \"OMAP-EHCI Host Controller\",\n"
+ "-\t.hcd_priv_size\t\t= sizeof(struct ehci_hcd),\n"
+ "-\n"
+ "-\t/*\n"
+ "-\t * generic hardware linkage\n"
+ "-\t */\n"
+ "-\t.irq\t\t\t= ehci_irq,\n"
+ "-\t.flags\t\t\t= HCD_MEMORY | HCD_USB2,\n"
+ "-\n"
+ "-\t/*\n"
+ "-\t * basic lifecycle operations\n"
+ "-\t */\n"
+ "-\t.reset\t\t\t= omap_ehci_init,\n"
+ "-\t.start\t\t\t= ehci_run,\n"
+ "-\t.stop\t\t\t= ehci_stop,\n"
+ "-\t.shutdown\t\t= ehci_shutdown,\n"
+ "-\n"
+ "-\t/*\n"
+ "-\t * managing i/o requests and associated device resources\n"
+ "-\t */\n"
+ "-\t.urb_enqueue\t\t= ehci_urb_enqueue,\n"
+ "-\t.urb_dequeue\t\t= ehci_urb_dequeue,\n"
+ "-\t.endpoint_disable\t= ehci_endpoint_disable,\n"
+ "-\t.endpoint_reset\t\t= ehci_endpoint_reset,\n"
+ "+static int __init ehci_omap_init(void)\n"
+ "+{\n"
+ "+\tif (usb_disabled())\n"
+ "+\t\treturn -ENODEV;\n"
+ " \n"
+ "-\t/*\n"
+ "-\t * scheduling support\n"
+ "-\t */\n"
+ "-\t.get_frame_number\t= ehci_get_frame,\n"
+ "+\tpr_info(\"%s: \" DRIVER_DESC \"\\n\", hcd_name);\n"
+ " \n"
+ "-\t/*\n"
+ "-\t * root hub support\n"
+ "-\t */\n"
+ "-\t.hub_status_data\t= ehci_hub_status_data,\n"
+ "-\t.hub_control\t\t= ehci_hub_control,\n"
+ "-\t.bus_suspend\t\t= ehci_bus_suspend,\n"
+ "-\t.bus_resume\t\t= ehci_bus_resume,\n"
+ "+\tehci_init_driver(&ehci_omap_hc_driver, &ehci_omap_overrides);\n"
+ "+\treturn platform_driver_register(&ehci_hcd_omap_driver);\n"
+ "+}\n"
+ "+module_init(ehci_omap_init);\n"
+ " \n"
+ "-\t.clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,\n"
+ "-};\n"
+ "+static void __exit ehci_omap_cleanup(void)\n"
+ "+{\n"
+ "+\tplatform_driver_unregister(&ehci_hcd_omap_driver);\n"
+ "+}\n"
+ "+module_exit(ehci_omap_cleanup);\n"
+ " \n"
+ " MODULE_ALIAS(\"platform:omap-ehci\");\n"
+ " MODULE_AUTHOR(\"Texas Instruments, Inc.\");\n"
+ " MODULE_AUTHOR(\"Felipe Balbi <felipe.balbi@nokia.com>\");\n"
+ " \n"
+ "+MODULE_DESCRIPTION(DRIVER_DESC);\n"
+ "+MODULE_LICENSE(\"GPL\");\n"
+ "-- \n"
+ 1.7.4.1
+ "\01:3\0"
+ "fn\00002-usb-ehci-omap-Instantiate-PHY-devices-if-required.patch\0"
+ "b\0"
+ ">From 1f0e3fdaeda35c96edfdc551434cc841f3b65363 Mon Sep 17 00:00:00 2001\n"
+ "From: Roger Quadros <rogerq@ti.com>\n"
+ "Date: Tue, 8 Jan 2013 16:05:16 +0200\n"
+ "Subject: [PATCH] usb: ehci-omap: Instantiate PHY devices if required\n"
+ "\n"
+ "If the OMAP's Host controller is in PHY mode then we instantiate\n"
+ "a platform device for the PHY (one for each port in PHY mode) and\n"
+ "hold a reference to it so that we can use the usb_phy API, e.g.\n"
+ "while suspend/resume.\n"
+ "\n"
+ "The platform data for the PHY must be supplied in the newly added\n"
+ ".phy_config parameter in struct usbhs_omap_platform_data.\n"
+ "\n"
+ "The end goal is to move the PHY's reset and power handling code\n"
+ "out of the ehci-omap driver and into the phy driver.\n"
+ "\n"
+ "Signed-off-by: Roger Quadros <rogerq@ti.com>\n"
+ "---\n"
+ " drivers/usb/host/ehci-omap.c           |   83 ++++++++++++++++++++++++++++++-\n"
+ " include/linux/platform_data/usb-omap.h |    8 +++\n"
+ " 2 files changed, 88 insertions(+), 3 deletions(-)\n"
+ "\n"
+ "diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c\n"
+ "index 6388aa6..23c9b9c 100644\n"
+ "--- a/drivers/usb/host/ehci-omap.c\n"
+ "+++ b/drivers/usb/host/ehci-omap.c\n"
+ "@@ -70,6 +70,11 @@ static const char hcd_name[] = \"ehci-omap\";\n"
+ " \n"
+ " /*-------------------------------------------------------------------------*/\n"
+ " \n"
+ "+struct omap_ehci_hcd {\n"
+ "+\tstruct usb_hcd *hcd;\n"
+ "+\tstruct usb_phy **phy;\t/* one PHY for each port */\n"
+ "+\tint nports;\n"
+ "+};\n"
+ " \n"
+ " static inline void ehci_write(void __iomem *base, u32 reg, u32 val)\n"
+ " {\n"
+ "@@ -194,6 +199,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)\n"
+ " \tstruct usbhs_omap_platform_data\t\t*pdata = dev->platform_data;\n"
+ " \tstruct resource\t\t\t\t*res;\n"
+ " \tstruct usb_hcd\t\t\t\t*hcd;\n"
+ "+\tstruct omap_ehci_hcd\t\t\t*omap_hcd;\n"
+ "+\tstruct usb_phy\t\t\t\t*phy;\n"
+ " \tvoid __iomem\t\t\t\t*regs;\n"
+ " \tint\t\t\t\t\tret = -ENODEV;\n"
+ " \tint\t\t\t\t\tirq;\n"
+ "@@ -208,6 +215,25 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)\n"
+ " \t\treturn -ENODEV;\n"
+ " \t}\n"
+ " \n"
+ "+\tif (!pdata) {\n"
+ "+\t\tdev_err(dev, \"Missing platform data\\n\");\n"
+ "+\t\treturn -ENODEV;\n"
+ "+\t}\n"
+ "+\n"
+ "+\tomap_hcd = devm_kzalloc(&pdev->dev, sizeof(*omap_hcd), GFP_KERNEL);\n"
+ "+\tif (!omap_hcd) {\n"
+ "+\t\tdev_err(dev, \"Memory allocation failed\\n\");\n"
+ "+\t\treturn -ENOMEM;\n"
+ "+\t}\n"
+ "+\n"
+ "+\tomap_hcd->nports = pdata->nports;\n"
+ "+\ti = sizeof(struct usb_phy *) * omap_hcd->nports;\n"
+ "+\tomap_hcd->phy = devm_kzalloc(&pdev->dev, i, GFP_KERNEL);\n"
+ "+\tif (!omap_hcd->phy) {\n"
+ "+\t\tdev_err(dev, \"Memory allocation failed\\n\");\n"
+ "+\t\treturn -ENOMEM;\n"
+ "+\t}\n"
+ "+\n"
+ " \tirq = platform_get_irq_byname(pdev, \"ehci-irq\");\n"
+ " \tif (irq < 0) {\n"
+ " \t\tdev_err(dev, \"EHCI irq failed\\n\");\n"
+ "@@ -238,9 +264,15 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)\n"
+ " \thcd->rsrc_start = res->start;\n"
+ " \thcd->rsrc_len = resource_size(res);\n"
+ " \thcd->regs = regs;\n"
+ "+\tomap_hcd->hcd = hcd;\n"
+ "+\n"
+ "+\tplatform_set_drvdata(pdev, omap_hcd);\n"
+ " \n"
+ " \t/* get ehci regulator and enable */\n"
+ "-\tfor (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {\n"
+ "+\tfor (i = 0 ; i < omap_hcd->nports ; i++) {\n"
+ "+\t\tstruct platform_device *phy_pdev;\n"
+ "+\t\tstruct usbhs_phy_config *phy_config;\n"
+ "+\n"
+ " \t\tif (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) {\n"
+ " \t\t\tpdata->regulator[i] = NULL;\n"
+ " \t\t\tcontinue;\n"
+ "@@ -254,6 +286,33 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)\n"
+ " \t\t} else {\n"
+ " \t\t\tregulator_enable(pdata->regulator[i]);\n"
+ " \t\t}\n"
+ "+\n"
+ "+\t\t/* instantiate PHY */\n"
+ "+\t\tif (!pdata->phy_config[i]) {\n"
+ "+\t\t\tdev_dbg(dev, \"missing phy_config for port %d\\n\", i);\n"
+ "+\t\t\tcontinue;\n"
+ "+\t\t}\n"
+ "+\n"
+ "+\t\tphy_config = pdata->phy_config[i];\n"
+ "+\t\tphy_pdev = platform_device_register_data(&pdev->dev,\n"
+ "+\t\t\t\tphy_config->name, i, phy_config->pdata,\n"
+ "+\t\t\t\tphy_config->pdata_size);\n"
+ "+\t\tif (IS_ERR(phy_pdev)) {\n"
+ "+\t\t\tdev_dbg(dev, \"error creating PHY device for port %d\\n\",\n"
+ "+\t\t\t\t\ti);\n"
+ "+\t\t}\n"
+ "+\n"
+ "+\t\tphy = usb_get_phy_from_dev(&phy_pdev->dev);\n"
+ "+\t\tif (IS_ERR(phy)) {\n"
+ "+\t\t\tdev_dbg(dev, \"could not get USB PHY for port %d\\n\", i);\n"
+ "+\t\t\tplatform_device_unregister(phy_pdev);\n"
+ "+\t\t\tcontinue;\n"
+ "+\t\t}\n"
+ "+\n"
+ "+\t\tusb_phy_init(phy);\n"
+ "+\t\tomap_hcd->phy[i] = phy;\n"
+ "+\t\t/* bring PHY out of suspend */\n"
+ "+\t\tusb_phy_set_suspend(omap_hcd->phy[i], 0);\n"
+ " \t}\n"
+ " \n"
+ " \tpm_runtime_enable(dev);\n"
+ "@@ -284,6 +343,12 @@ err_pm_runtime:\n"
+ " \tdisable_put_regulator(pdata);\n"
+ " \tpm_runtime_put_sync(dev);\n"
+ " \tusb_put_hcd(hcd);\n"
+ "+\tfor (i = 0 ; i < omap_hcd->nports ; i++) {\n"
+ "+\t\tphy = omap_hcd->phy[i];\n"
+ "+\t\tif (!phy)\n"
+ "+\t\t\tcontinue;\n"
+ "+\t\tplatform_device_unregister(to_platform_device(phy->dev));\n"
+ "+\t}\n"
+ " \n"
+ " err_io:\n"
+ " \tiounmap(regs);\n"
+ "@@ -301,14 +366,26 @@ err_io:\n"
+ "  */\n"
+ " static int ehci_hcd_omap_remove(struct platform_device *pdev)\n"
+ " {\n"
+ "-\tstruct device *dev\t\t\t\t= &pdev->dev;\n"
+ "-\tstruct usb_hcd *hcd\t\t\t\t= dev_get_drvdata(dev);\n"
+ "+\tstruct device *dev\t\t= &pdev->dev;\n"
+ "+\tstruct omap_ehci_hcd *omap_hcd\t= dev_get_drvdata(dev);\n"
+ "+\tstruct usb_hcd *hcd\t\t= omap_hcd->hcd;\n"
+ "+\tint i;\n"
+ " \n"
+ " \tusb_remove_hcd(hcd);\n"
+ " \tdisable_put_regulator(dev->platform_data);\n"
+ " \tiounmap(hcd->regs);\n"
+ " \tusb_put_hcd(hcd);\n"
+ " \n"
+ "+\tfor (i = 0; i < omap_hcd->nports; i++) {\n"
+ "+\t\tstruct usb_phy *phy = omap_hcd->phy[i];\n"
+ "+\n"
+ "+\t\tif (!phy)\n"
+ "+\t\t\tcontinue;\n"
+ "+\n"
+ "+\t\tusb_phy_shutdown(phy);\n"
+ "+\t\tplatform_device_unregister(to_platform_device(phy->dev));\n"
+ "+\t}\n"
+ "+\n"
+ " \tpm_runtime_put_sync(dev);\n"
+ " \tpm_runtime_disable(dev);\n"
+ " \n"
+ "diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h\n"
+ "index d63eb7d..927b8a1 100644\n"
+ "--- a/include/linux/platform_data/usb-omap.h\n"
+ "+++ b/include/linux/platform_data/usb-omap.h\n"
+ "@@ -38,6 +38,12 @@ enum usbhs_omap_port_mode {\n"
+ " \tOMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM\n"
+ " };\n"
+ " \n"
+ "+struct usbhs_phy_config {\n"
+ "+\tchar *name;\t\t/* binds to device driver */\n"
+ "+\tvoid *pdata;\t\t/* platform data for the phy */\n"
+ "+\tsize_t pdata_size;\n"
+ "+};\n"
+ "+\n"
+ " struct usbhs_omap_platform_data {\n"
+ " \tint\t\t\t\tnports;\n"
+ " \tenum usbhs_omap_port_mode\tport_mode[OMAP3_HS_USB_PORTS];\n"
+ "@@ -49,6 +55,8 @@ struct usbhs_omap_platform_data {\n"
+ " \tunsigned\t\t\tsingle_ulpi_bypass:1;\n"
+ " \tunsigned\t\t\tes2_compatibility:1;\n"
+ " \tunsigned\t\t\tphy_reset:1;\n"
+ "+\n"
+ "+\tstruct usbhs_phy_config\t\t*phy_config[OMAP3_HS_USB_PORTS];\n"
+ " };\n"
+ " \n"
+ " /*-------------------------------------------------------------------------*/\n"
+ "-- \n"
+ 1.7.4.1
 
-4fd393b02d09db96b34dd2aa451275979024baf4d7cbb812c0237590d0f6148a
+02da2bca93fea09ae3d85dff6609599d854f28410da5bbd6bf9deab1fdd65a24

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.