linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
@ 2013-01-28 11:30 Roger Quadros
  2013-01-28 11:30 ` [PATCH 01/30] USB: EHCI: split ehci-omap out to a separate driver Roger Quadros
                   ` (33 more replies)
  0 siblings, 34 replies; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Hi,

The OMAP's High Speed Host controller can interface to ULPI/UTMI
PHYs transparently i.e. whithout requiring the device drivers to
access the PHY. However, the OS must ensure that the PHY has the necessary
resources (power/clock/reset) enabled before it is used.

Till now, the omap-ehci driver was managing the power and reset of the PHY
whereas, clock enabling was left to the bootloader or board files.

In this patchset we make the NOP PHY driver (nop-usb-xceiv.c) handle
all the PHY resources that are available so that it can be used by
platforms like OMAP.

The board files add the PHY as a platform device and use usb_bind_phy()
(API introduced in [2]) to bind the PHY device to the controller's port.
The ehci-omap driver then uses usb_get_phy_dev() to get the PHY device
associated to the controller's port.

All this results in a much cleaner code and makes USB PHY resource management
work properly on OMAP.

NOTE: Tested on 4460ES-B1 Panda and BeagleBoard C4 only. Other boards are only
build tested.

Patches are based on Linux-3.8-rc5 and depend on

[1] [PATCH v9 00/20] OMAP USB Host cleanup
https://lkml.org/lkml/2013/1/23/155

[2] [PATCH v2 0/6] USB: Add support for multiple PHYs of same type
https://lkml.org/lkml/2013/1/24/876

v2:
- Added Alan's patch to split ehci-omap into separate driver
- Addressed Russell King's comments on usage of clk/regulator framework.
- Adapted all board using ehci-omap to using the PHY mechanism.

The following changes since commit e18d48b7f7e563664a41d4658b8cc15679ee4745:

  usb: otg: utils: add facilities in phy lib to support multiple PHYs of same type (2013-01-28 12:20:54 +0200)

  git://github.com/rogerq/linux.git linux-usbhost15

---
Alan Stern (1):
  USB: EHCI: split ehci-omap out to a separate driver

Roger Quadros (29):
  usb: phy: nop: use devm_kzalloc()
  usb: phy: nop: Manage PHY clock
  usb: phy: nop: Handle power supply regulator for the PHY
  usb: phy: nop: Handle RESET for the PHY
  usb: phy: nop: use new PHY API to register PHY
  mfd: omap-usb-host: update nports in platform_data
  mfd: omap-usb-host: Remove PHY reset handling code
  USB: ehci-omap: Use devm_request_and_ioremap()
  USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of
    suspend
  usb: ehci-omap: Remove PHY reset handling code
  usb: ehci-omap: Remove PHY regulator handling code
  ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data
  ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes
  ARM: OMAP3: Beagle: Adapt to ehci-omap changes
  ARM: OMAP3: 3430SDP: Adapt to ehci-omap changes
  ARM: OMAP3: 3630SDP: Adapt to ehci-omap changes
  ARM: OMAP: AM3517crane: Adapt to ehci-omap changes
  ARM: OMAP: AM3517evm: Adapt to ehci-omap changes
  ARM: OMAP3: cm-t35: Adapt to ehci-omap changes
  ARM: OMAP3: cm-t3517: Adapt to ehci-omap changes
  ARM: OMAP: devkit8000: Adapt to ehci-omap changes
  ARM: OMAP3: igep0020: Adapt to ehci-omap changes
  ARM: OMAP3: omap3evm: Adapt to ehci-omap changes
  ARM: OMAP3: omap3pandora: Adapt to ehci-omap changes
  ARM: OMAP3: omap3stalker: Adapt to ehci-omap changes
  ARM: OMAP3: omap3touchbook: Adapt to ehci-omap changes
  ARM: OMAP3: overo: Adapt to ehci-omap changes
  ARM: OMAP: zoom: Adapt to ehci-omap changes
  ARM: OMAP: USB: Remove unused fields from struct
    usbhs_omap_platform_data

 arch/arm/mach-omap2/board-3430sdp.c        |   99 +++++++++++-
 arch/arm/mach-omap2/board-3630sdp.c        |  100 +++++++++++-
 arch/arm/mach-omap2/board-am3517crane.c    |   95 ++++++++++--
 arch/arm/mach-omap2/board-am3517evm.c      |   66 +++++++-
 arch/arm/mach-omap2/board-cm-t35.c         |   95 ++++++++++-
 arch/arm/mach-omap2/board-cm-t3517.c       |   97 +++++++++++-
 arch/arm/mach-omap2/board-devkit8000.c     |   20 ++-
 arch/arm/mach-omap2/board-igep0020.c       |  112 +++++++++++--
 arch/arm/mach-omap2/board-omap3beagle.c    |   93 ++++++++++-
 arch/arm/mach-omap2/board-omap3evm.c       |   63 ++++++--
 arch/arm/mach-omap2/board-omap3pandora.c   |   54 +++++-
 arch/arm/mach-omap2/board-omap3stalker.c   |   52 +++++-
 arch/arm/mach-omap2/board-omap3touchbook.c |   62 ++++++-
 arch/arm/mach-omap2/board-omap4panda.c     |  123 ++++++++++----
 arch/arm/mach-omap2/board-overo.c          |   55 ++++++-
 arch/arm/mach-omap2/board-zoom.c           |   56 ++++++-
 drivers/mfd/omap-usb-host.c                |   48 +------
 drivers/usb/host/Kconfig                   |    2 +-
 drivers/usb/host/Makefile                  |    1 +
 drivers/usb/host/ehci-hcd.c                |    6 +-
 drivers/usb/host/ehci-omap.c               |  245 +++++++++++-----------------
 drivers/usb/otg/nop-usb-xceiv.c            |  106 +++++++++++--
 include/linux/platform_data/usb-omap.h     |    3 -
 include/linux/usb/nop-usb-xceiv.h          |    1 +
 24 files changed, 1288 insertions(+), 366 deletions(-)

-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 101+ messages in thread

* [PATCH 01/30] USB: EHCI: split ehci-omap out to a separate driver
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:11   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 02/30] usb: phy: nop: use devm_kzalloc() Roger Quadros
                   ` (32 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

From: Alan Stern <stern@rowland.harvard.edu>

This patch (as1645) converts ehci-omap over to the new "ehci-hcd is a
library" approach, so that it can coexist peacefully with other EHCI
platform drivers and can make use of the private area allocated at
the end of struct ehci_hcd.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
---
 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 3a21c5d..11e102e 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 001fbff..56de410 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -27,6 +27,7 @@ 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_MXC)	+= ehci-mxc.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 09537b2..5a35246 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1251,11 +1251,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
@@ -1345,6 +1340,7 @@ MODULE_LICENSE ("GPL");
 	!IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \
 	!IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \
 	!IS_ENABLED(CONFIG_USB_EHCI_MXC) && \
+	!IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) && \
 	!defined(PLATFORM_DRIVER) && \
 	!defined(PS3_SYSTEM_BUS_DRIVER) && \
 	!defined(OF_PLATFORM_DRIVER) && \
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index b96a4bf..30fc482 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


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 02/30] usb: phy: nop: use devm_kzalloc()
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
  2013-01-28 11:30 ` [PATCH 01/30] USB: EHCI: split ehci-omap out to a separate driver Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:14   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH v2 03/30] usb: phy: nop: Manage PHY clock Roger Quadros
                   ` (31 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Use resource managed kzalloc.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/otg/nop-usb-xceiv.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
index a3ce24b..7ffb0c8 100644
--- a/drivers/usb/otg/nop-usb-xceiv.c
+++ b/drivers/usb/otg/nop-usb-xceiv.c
@@ -100,15 +100,13 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
 	enum usb_phy_type	type = USB_PHY_TYPE_USB2;
 	int err;
 
-	nop = kzalloc(sizeof *nop, GFP_KERNEL);
+	nop = devm_kzalloc(&pdev->dev, sizeof *nop, GFP_KERNEL);
 	if (!nop)
 		return -ENOMEM;
 
-	nop->phy.otg = kzalloc(sizeof *nop->phy.otg, GFP_KERNEL);
-	if (!nop->phy.otg) {
-		kfree(nop);
+	nop->phy.otg = devm_kzalloc(&pdev->dev, sizeof *nop->phy.otg, GFP_KERNEL);
+	if (!nop->phy.otg)
 		return -ENOMEM;
-	}
 
 	if (pdata)
 		type = pdata->type;
@@ -127,7 +125,7 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
 	if (err) {
 		dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
 			err);
-		goto exit;
+		return err;
 	}
 
 	platform_set_drvdata(pdev, nop);
@@ -135,10 +133,6 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
 	ATOMIC_INIT_NOTIFIER_HEAD(&nop->phy.notifier);
 
 	return 0;
-exit:
-	kfree(nop->phy.otg);
-	kfree(nop);
-	return err;
 }
 
 static int nop_usb_xceiv_remove(struct platform_device *pdev)
@@ -148,8 +142,6 @@ static int nop_usb_xceiv_remove(struct platform_device *pdev)
 	usb_remove_phy(&nop->phy);
 
 	platform_set_drvdata(pdev, NULL);
-	kfree(nop->phy.otg);
-	kfree(nop);
 
 	return 0;
 }
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH v2 03/30] usb: phy: nop: Manage PHY clock
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
  2013-01-28 11:30 ` [PATCH 01/30] USB: EHCI: split ehci-omap out to a separate driver Roger Quadros
  2013-01-28 11:30 ` [PATCH 02/30] usb: phy: nop: use devm_kzalloc() Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:17   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH v2 04/30] usb: phy: nop: Handle power supply regulator for the PHY Roger Quadros
                   ` (30 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

If the PHY has a clock associated to it then manage the clock.
We just enable the clock in .init() and disable it in .shutdown().

Add clk_rate parameter in platform data and configure the
clock rate during probe if supplied.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/otg/nop-usb-xceiv.c   |   54 ++++++++++++++++++++++++++++++++++++-
 include/linux/usb/nop-usb-xceiv.h |    1 +
 2 files changed, 54 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
index 7ffb0c8..849eb9d 100644
--- a/drivers/usb/otg/nop-usb-xceiv.c
+++ b/drivers/usb/otg/nop-usb-xceiv.c
@@ -32,10 +32,12 @@
 #include <linux/usb/otg.h>
 #include <linux/usb/nop-usb-xceiv.h>
 #include <linux/slab.h>
+#include <linux/clk.h>
 
 struct nop_usb_xceiv {
 	struct usb_phy		phy;
 	struct device		*dev;
+	struct clk		*clk;
 };
 
 static struct platform_device *pd;
@@ -64,6 +66,24 @@ static int nop_set_suspend(struct usb_phy *x, int suspend)
 	return 0;
 }
 
+static int nop_init(struct usb_phy *phy)
+{
+	struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev);
+
+	if (!IS_ERR(nop->clk))
+		clk_enable(nop->clk);
+
+	return 0;
+}
+
+static void nop_shutdown(struct usb_phy *phy)
+{
+	struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev);
+
+	if (!IS_ERR(nop->clk))
+		clk_disable(nop->clk);
+}
+
 static int nop_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget)
 {
 	if (!otg)
@@ -111,10 +131,34 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
 	if (pdata)
 		type = pdata->type;
 
+	nop->clk = devm_clk_get(&pdev->dev, "main_clk");
+	if (IS_ERR(nop->clk)) {
+		dev_dbg(&pdev->dev, "Can't get phy clock: %ld\n",
+					PTR_ERR(nop->clk));
+	}
+
+	if (!IS_ERR(nop->clk) && pdata && pdata->clk_rate) {
+		err = clk_set_rate(nop->clk, pdata->clk_rate);
+		if (err) {
+			dev_err(&pdev->dev, "Error setting clock rate\n");
+			return err;
+		}
+	}
+
+	if (!IS_ERR(nop->clk)) {
+		err = clk_prepare(nop->clk);
+		if (err) {
+			dev_err(&pdev->dev, "Error preparing clock\n");
+			return err;
+		}
+	}
+
 	nop->dev		= &pdev->dev;
 	nop->phy.dev		= nop->dev;
 	nop->phy.label		= "nop-xceiv";
 	nop->phy.set_suspend	= nop_set_suspend;
+	nop->phy.init		= nop_init;
+	nop->phy.shutdown	= nop_shutdown;
 	nop->phy.state		= OTG_STATE_UNDEFINED;
 
 	nop->phy.otg->phy		= &nop->phy;
@@ -125,7 +169,7 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
 	if (err) {
 		dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
 			err);
-		return err;
+		goto err_add;
 	}
 
 	platform_set_drvdata(pdev, nop);
@@ -133,12 +177,20 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
 	ATOMIC_INIT_NOTIFIER_HEAD(&nop->phy.notifier);
 
 	return 0;
+
+err_add:
+	if (!IS_ERR(nop->clk))
+		clk_unprepare(nop->clk);
+	return err;
 }
 
 static int nop_usb_xceiv_remove(struct platform_device *pdev)
 {
 	struct nop_usb_xceiv *nop = platform_get_drvdata(pdev);
 
+	if (!IS_ERR(nop->clk))
+		clk_unprepare(nop->clk);
+
 	usb_remove_phy(&nop->phy);
 
 	platform_set_drvdata(pdev, NULL);
diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h
index 28884c7..3265b61 100644
--- a/include/linux/usb/nop-usb-xceiv.h
+++ b/include/linux/usb/nop-usb-xceiv.h
@@ -5,6 +5,7 @@
 
 struct nop_usb_xceiv_platform_data {
 	enum usb_phy_type type;
+	unsigned long clk_rate;
 };
 
 #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH v2 04/30] usb: phy: nop: Handle power supply regulator for the PHY
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (2 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH v2 03/30] usb: phy: nop: Manage PHY clock Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:20   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH v2 05/30] usb: phy: nop: Handle RESET " Roger Quadros
                   ` (29 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

We use "vcc" as the supply name for the PHY's power supply.
The power supply will be enabled during .init() and disabled
during .shutdown()

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/otg/nop-usb-xceiv.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
index 849eb9d..0a9628c 100644
--- a/drivers/usb/otg/nop-usb-xceiv.c
+++ b/drivers/usb/otg/nop-usb-xceiv.c
@@ -33,11 +33,13 @@
 #include <linux/usb/nop-usb-xceiv.h>
 #include <linux/slab.h>
 #include <linux/clk.h>
+#include <linux/regulator/consumer.h>
 
 struct nop_usb_xceiv {
 	struct usb_phy		phy;
 	struct device		*dev;
 	struct clk		*clk;
+	struct regulator	*vcc;
 };
 
 static struct platform_device *pd;
@@ -70,6 +72,11 @@ static int nop_init(struct usb_phy *phy)
 {
 	struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev);
 
+	if (!IS_ERR(nop->vcc)) {
+		if (regulator_enable(nop->vcc))
+			dev_err(phy->dev, "Failed to enable power\n");
+	}
+
 	if (!IS_ERR(nop->clk))
 		clk_enable(nop->clk);
 
@@ -82,6 +89,11 @@ static void nop_shutdown(struct usb_phy *phy)
 
 	if (!IS_ERR(nop->clk))
 		clk_disable(nop->clk);
+
+	if (!IS_ERR(nop->vcc)) {
+		if (regulator_disable(nop->vcc))
+			dev_err(phy->dev, "Failed to disable power\n");
+	}
 }
 
 static int nop_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget)
@@ -153,6 +165,12 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
 		}
 	}
 
+	nop->vcc = devm_regulator_get(&pdev->dev, "vcc");
+	if (IS_ERR(nop->vcc)) {
+		dev_dbg(&pdev->dev, "Error getting vcc regulator: %ld\n",
+					PTR_ERR(nop->vcc));
+	}
+
 	nop->dev		= &pdev->dev;
 	nop->phy.dev		= nop->dev;
 	nop->phy.label		= "nop-xceiv";
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH v2 05/30] usb: phy: nop: Handle RESET for the PHY
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (3 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH v2 04/30] usb: phy: nop: Handle power supply regulator for the PHY Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:22   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 06/30] usb: phy: nop: use new PHY API to register PHY Roger Quadros
                   ` (28 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

We expect the RESET line to be modeled as a regulator with supply
name "reset". The regulator should be modeled such that enabling
the regulator brings the PHY device out of RESET and disabling the
regulator holds the device in RESET.

They PHY will be held in RESET in .shutdown() and brought out of
RESET in .init().

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/otg/nop-usb-xceiv.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
index 0a9628c..3060ed0 100644
--- a/drivers/usb/otg/nop-usb-xceiv.c
+++ b/drivers/usb/otg/nop-usb-xceiv.c
@@ -40,6 +40,7 @@ struct nop_usb_xceiv {
 	struct device		*dev;
 	struct clk		*clk;
 	struct regulator	*vcc;
+	struct regulator	*reset;
 };
 
 static struct platform_device *pd;
@@ -80,6 +81,12 @@ static int nop_init(struct usb_phy *phy)
 	if (!IS_ERR(nop->clk))
 		clk_enable(nop->clk);
 
+	if (!IS_ERR(nop->reset)) {
+		/* De-assert RESET */
+		if (regulator_enable(nop->reset))
+			dev_err(phy->dev, "Failed to de-assert reset\n");
+	}
+
 	return 0;
 }
 
@@ -87,6 +94,12 @@ static void nop_shutdown(struct usb_phy *phy)
 {
 	struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev);
 
+	if (!IS_ERR(nop->reset)) {
+		/* Assert RESET */
+		if (regulator_disable(nop->reset))
+			dev_err(phy->dev, "Failed to assert reset\n");
+	}
+
 	if (!IS_ERR(nop->clk))
 		clk_disable(nop->clk);
 
@@ -171,6 +184,12 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
 					PTR_ERR(nop->vcc));
 	}
 
+	nop->reset = devm_regulator_get(&pdev->dev, "reset");
+	if (IS_ERR(nop->reset)) {
+		dev_dbg(&pdev->dev, "Error getting reset regulator: %ld\n",
+					PTR_ERR(nop->reset));
+	}
+
 	nop->dev		= &pdev->dev;
 	nop->phy.dev		= nop->dev;
 	nop->phy.label		= "nop-xceiv";
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 06/30] usb: phy: nop: use new PHY API to register PHY
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (4 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH v2 05/30] usb: phy: nop: Handle RESET " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:23   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 07/30] mfd: omap-usb-host: update nports in platform_data Roger Quadros
                   ` (27 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

We would need to support multiple PHYs of the same type
so use the new PHY API usb_add_phy_dev() to register the PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/otg/nop-usb-xceiv.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
index 3060ed0..ac027a1 100644
--- a/drivers/usb/otg/nop-usb-xceiv.c
+++ b/drivers/usb/otg/nop-usb-xceiv.c
@@ -197,12 +197,13 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
 	nop->phy.init		= nop_init;
 	nop->phy.shutdown	= nop_shutdown;
 	nop->phy.state		= OTG_STATE_UNDEFINED;
+	nop->phy.type		= type;
 
 	nop->phy.otg->phy		= &nop->phy;
 	nop->phy.otg->set_host		= nop_set_host;
 	nop->phy.otg->set_peripheral	= nop_set_peripheral;
 
-	err = usb_add_phy(&nop->phy, type);
+	err = usb_add_phy_dev(&nop->phy);
 	if (err) {
 		dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
 			err);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 07/30] mfd: omap-usb-host: update nports in platform_data
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (5 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 06/30] usb: phy: nop: use new PHY API to register PHY Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:24   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 08/30] mfd: omap-usb-host: Remove PHY reset handling code Roger Quadros
                   ` (26 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

EHCI driver would need to know the number of ports available
on the platform. We set the nports parameter of platform_data
based on IP version if it was not already provided.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/omap-usb-host.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 6b5edf6..0874352 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -575,6 +575,7 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 			 omap->usbhs_rev, omap->nports);
 			break;
 		}
+		pdata->nports = omap->nports;
 	}
 
 	i = sizeof(struct clk *) * omap->nports;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 08/30] mfd: omap-usb-host: Remove PHY reset handling code
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (6 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 07/30] mfd: omap-usb-host: update nports in platform_data Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:25   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap() Roger Quadros
                   ` (25 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

PHY reset GPIO handling will be done in the PHY driver

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/mfd/omap-usb-host.c |   47 -------------------------------------------
 1 files changed, 0 insertions(+), 47 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 0874352..502a779 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -430,24 +430,10 @@ static unsigned omap_usbhs_rev2_hostconfig(struct usbhs_hcd_omap *omap,
 static void omap_usbhs_init(struct device *dev)
 {
 	struct usbhs_hcd_omap		*omap = dev_get_drvdata(dev);
-	struct usbhs_omap_platform_data	*pdata = omap->pdata;
 	unsigned			reg;
 
 	dev_dbg(dev, "starting TI HSUSB Controller\n");
 
-	if (pdata->phy_reset) {
-		if (gpio_is_valid(pdata->reset_gpio_port[0]))
-			gpio_request_one(pdata->reset_gpio_port[0],
-					 GPIOF_OUT_INIT_LOW, "USB1 PHY reset");
-
-		if (gpio_is_valid(pdata->reset_gpio_port[1]))
-			gpio_request_one(pdata->reset_gpio_port[1],
-					 GPIOF_OUT_INIT_LOW, "USB2 PHY reset");
-
-		/* Hold the PHY in RESET for enough time till DIR is high */
-		udelay(10);
-	}
-
 	pm_runtime_get_sync(dev);
 
 	reg = usbhs_read(omap->uhh_base, OMAP_UHH_HOSTCONFIG);
@@ -476,37 +462,8 @@ static void omap_usbhs_init(struct device *dev)
 	dev_dbg(dev, "UHH setup done, uhh_hostconfig=%x\n", reg);
 
 	pm_runtime_put_sync(dev);
-	if (pdata->phy_reset) {
-		/* Hold the PHY in RESET for enough time till
-		 * PHY is settled and ready
-		 */
-		udelay(10);
-
-		if (gpio_is_valid(pdata->reset_gpio_port[0]))
-			gpio_set_value_cansleep
-				(pdata->reset_gpio_port[0], 1);
-
-		if (gpio_is_valid(pdata->reset_gpio_port[1]))
-			gpio_set_value_cansleep
-				(pdata->reset_gpio_port[1], 1);
-	}
-}
-
-static void omap_usbhs_deinit(struct device *dev)
-{
-	struct usbhs_hcd_omap		*omap = dev_get_drvdata(dev);
-	struct usbhs_omap_platform_data	*pdata = omap->pdata;
-
-	if (pdata->phy_reset) {
-		if (gpio_is_valid(pdata->reset_gpio_port[0]))
-			gpio_free(pdata->reset_gpio_port[0]);
-
-		if (gpio_is_valid(pdata->reset_gpio_port[1]))
-			gpio_free(pdata->reset_gpio_port[1]);
-	}
 }
 
-
 /**
  * usbhs_omap_probe - initialize TI-based HCDs
  *
@@ -710,8 +667,6 @@ static int usbhs_omap_probe(struct platform_device *pdev)
 	return 0;
 
 err_alloc:
-	omap_usbhs_deinit(&pdev->dev);
-
 	for (i = 0; i < omap->nports; i++) {
 		if (!IS_ERR(omap->utmi_clk[i]))
 			clk_put(omap->utmi_clk[i]);
@@ -756,8 +711,6 @@ static int usbhs_omap_remove(struct platform_device *pdev)
 	struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev);
 	int i;
 
-	omap_usbhs_deinit(&pdev->dev);
-
 	for (i = 0; i < omap->nports; i++) {
 		if (!IS_ERR(omap->utmi_clk[i]))
 			clk_put(omap->utmi_clk[i]);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (7 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 08/30] mfd: omap-usb-host: Remove PHY reset handling code Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-01-28 15:17   ` Alan Stern
  2013-02-05  9:25   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH v2 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend Roger Quadros
                   ` (24 subsequent siblings)
  33 siblings, 2 replies; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Make use of devm_request_and_ioremap() and correct comment.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/host/ehci-omap.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 30fc482..fd2f5450 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -216,23 +216,17 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 
 	res =  platform_get_resource_byname(pdev,
 				IORESOURCE_MEM, "ehci");
-	if (!res) {
-		dev_err(dev, "UHH EHCI get resource failed\n");
-		return -ENODEV;
-	}
-
-	regs = ioremap(res->start, resource_size(res));
+	regs = devm_request_and_ioremap(dev, res);
 	if (!regs) {
-		dev_err(dev, "UHH EHCI ioremap failed\n");
-		return -ENOMEM;
+		dev_err(dev, "Resource request/ioremap failed\n");
+		return -EADDRNOTAVAIL;
 	}
 
 	hcd = usb_create_hcd(&ehci_omap_hc_driver, dev,
 			dev_name(dev));
 	if (!hcd) {
-		dev_err(dev, "failed to create hcd with err %d\n", ret);
-		ret = -ENOMEM;
-		goto err_io;
+		dev_err(dev, "Failed to create HCD\n");
+		return -ENOMEM;
 	}
 
 	hcd->rsrc_start = res->start;
@@ -285,8 +279,6 @@ err_pm_runtime:
 	pm_runtime_put_sync(dev);
 	usb_put_hcd(hcd);
 
-err_io:
-	iounmap(regs);
 	return ret;
 }
 
@@ -306,7 +298,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
 
 	usb_remove_hcd(hcd);
 	disable_put_regulator(dev->platform_data);
-	iounmap(hcd->regs);
 	usb_put_hcd(hcd);
 
 	pm_runtime_put_sync(dev);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH v2 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (8 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap() Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-01-28 15:40   ` Alan Stern
  2013-01-29  9:50   ` [PATCH v3 " Roger Quadros
  2013-01-28 11:30 ` [PATCH v2 11/30] usb: ehci-omap: Remove PHY reset handling code Roger Quadros
                   ` (23 subsequent siblings)
  33 siblings, 2 replies; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

For each port that is in PHY mode we obtain a PHY device using the USB PHY
library and put it out of suspend.

It is upto platform code to associate the PHY to the controller's
port and it is upto the PHY driver to manage the PHY's resources.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/host/ehci-omap.c |   54 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index fd2f5450..a35e44e 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_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)
 {
@@ -179,6 +184,7 @@ static struct hc_driver __read_mostly ehci_omap_hc_driver;
 
 static const struct ehci_driver_overrides ehci_omap_overrides __initdata = {
 	.reset =		omap_ehci_init,
+	.extra_priv_size =	sizeof(struct omap_hcd),
 };
 
 /**
@@ -194,6 +200,7 @@ 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_hcd				*omap;
 	void __iomem				*regs;
 	int					ret = -ENODEV;
 	int					irq;
@@ -233,6 +240,39 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 	hcd->rsrc_len = resource_size(res);
 	hcd->regs = regs;
 
+	omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv;
+	omap->nports = pdata->nports;
+	i = sizeof(struct usb_phy *) * omap->nports;
+	omap->phy = devm_kzalloc(&pdev->dev, i, GFP_KERNEL);
+	if (!omap->phy) {
+		dev_err(dev, "Memory allocation failed\n");
+		return -ENOMEM;
+	}
+
+	platform_set_drvdata(pdev, hcd);
+
+	/* get the PHY devices if needed */
+	for (i = 0 ; i < omap->nports ; i++) {
+		struct usb_phy *phy;
+
+		if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY)
+			continue;
+
+		/* get the PHY device */
+		phy = devm_usb_get_phy_dev(dev, i);
+		if (IS_ERR(phy) || !phy) {
+			ret = IS_ERR(phy) ? PTR_ERR(phy) : -ENODEV;
+			dev_err(dev, "Can't get PHY device for port %d: %d\n",
+					i, ret);
+			goto err_phy;
+		}
+
+		omap->phy[i] = phy;
+		usb_phy_init(omap->phy[i]);
+		/* bring PHY out of suspend */
+		usb_phy_set_suspend(omap->phy[i], 0);
+	}
+
 	/* get ehci regulator and enable */
 	for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
 		if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) {
@@ -277,6 +317,13 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 err_pm_runtime:
 	disable_put_regulator(pdata);
 	pm_runtime_put_sync(dev);
+
+err_phy:
+	for (i = 0; i < omap->nports; i++) {
+		if (omap->phy[i])
+			usb_phy_shutdown(omap->phy[i]);
+	}
+
 	usb_put_hcd(hcd);
 
 	return ret;
@@ -295,11 +342,18 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
 {
 	struct device *dev				= &pdev->dev;
 	struct usb_hcd *hcd				= dev_get_drvdata(dev);
+	struct omap_hcd *omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv;
+	int i;
 
 	usb_remove_hcd(hcd);
 	disable_put_regulator(dev->platform_data);
 	usb_put_hcd(hcd);
 
+	for (i = 0; i < omap->nports; i++) {
+		if (omap->phy[i])
+			usb_phy_shutdown(omap->phy[i]);
+	}
+
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH v2 11/30] usb: ehci-omap: Remove PHY reset handling code
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (9 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH v2 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-01-28 17:34   ` Alan Stern
  2013-01-28 11:30 ` [PATCH v2 12/30] usb: ehci-omap: Remove PHY regulator " Roger Quadros
                   ` (22 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Reset GPIO handling for the PHY must be done in the PHY
driver. We use the PHY helpers instead to reset the PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/host/ehci-omap.c |   70 +++++------------------------------------
 1 files changed, 9 insertions(+), 61 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index a35e44e..3c63619 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -86,79 +86,27 @@ static inline u32 ehci_read(void __iomem *base, u32 reg)
 	return __raw_readl(base + reg);
 }
 
-
-static void omap_ehci_soft_phy_reset(struct usb_hcd *hcd, u8 port)
-{
-	unsigned long timeout = jiffies + msecs_to_jiffies(1000);
-	unsigned reg = 0;
-
-	reg = ULPI_FUNC_CTRL_RESET
-		/* FUNCTION_CTRL_SET register */
-		| (ULPI_SET(ULPI_FUNC_CTRL) << EHCI_INSNREG05_ULPI_REGADD_SHIFT)
-		/* Write */
-		| (2 << EHCI_INSNREG05_ULPI_OPSEL_SHIFT)
-		/* PORTn */
-		| ((port + 1) << EHCI_INSNREG05_ULPI_PORTSEL_SHIFT)
-		/* start ULPI access*/
-		| (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT);
-
-	ehci_write(hcd->regs, EHCI_INSNREG05_ULPI, reg);
-
-	/* Wait for ULPI access completion */
-	while ((ehci_read(hcd->regs, EHCI_INSNREG05_ULPI)
-			& (1 << EHCI_INSNREG05_ULPI_CONTROL_SHIFT))) {
-		cpu_relax();
-
-		if (time_after(jiffies, timeout)) {
-			dev_dbg(hcd->self.controller,
-					"phy reset operation timed out\n");
-			break;
-		}
-	}
-}
-
 static int omap_ehci_init(struct usb_hcd *hcd)
 {
 	struct ehci_hcd		*ehci = hcd_to_ehci(hcd);
-	int			rc;
-	struct usbhs_omap_platform_data	*pdata;
-
-	pdata = hcd->self.controller->platform_data;
+	struct omap_hcd		*omap = (struct omap_hcd *)ehci->priv;
+	int			rc, i;
 
 	/* Hold PHYs in reset while initializing EHCI controller */
-	if (pdata->phy_reset) {
-		if (gpio_is_valid(pdata->reset_gpio_port[0]))
-			gpio_set_value_cansleep(pdata->reset_gpio_port[0], 0);
-
-		if (gpio_is_valid(pdata->reset_gpio_port[1]))
-			gpio_set_value_cansleep(pdata->reset_gpio_port[1], 0);
-
-		/* Hold the PHY in RESET for enough time till DIR is high */
-		udelay(10);
+	for (i = 0; i < omap->nports; i++) {
+		if (omap->phy[i])
+			usb_phy_shutdown(omap->phy[i]);
 	}
 
-	/* Soft reset the PHY using PHY reset command over ULPI */
-	if (pdata->port_mode[0] == OMAP_EHCI_PORT_MODE_PHY)
-		omap_ehci_soft_phy_reset(hcd, 0);
-	if (pdata->port_mode[1] == OMAP_EHCI_PORT_MODE_PHY)
-		omap_ehci_soft_phy_reset(hcd, 1);
-
 	/* we know this is the memory we want, no need to ioremap again */
 	ehci->caps = hcd->regs;
 
 	rc = ehci_setup(hcd);
 
-	if (pdata->phy_reset) {
-		/* Hold the PHY in RESET for enough time till
-		 * PHY is settled and ready
-		 */
-		udelay(10);
-
-		if (gpio_is_valid(pdata->reset_gpio_port[0]))
-			gpio_set_value_cansleep(pdata->reset_gpio_port[0], 1);
-
-		if (gpio_is_valid(pdata->reset_gpio_port[1]))
-			gpio_set_value_cansleep(pdata->reset_gpio_port[1], 1);
+	/* Bring PHYs out of reset */
+	for (i = 0; i < omap->nports; i++) {
+		if (omap->phy[i])
+			usb_phy_init(omap->phy[i]);
 	}
 
 	return rc;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH v2 12/30] usb: ehci-omap: Remove PHY regulator handling code
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (10 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH v2 11/30] usb: ehci-omap: Remove PHY reset handling code Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-01-28 17:35   ` Alan Stern
  2013-01-28 11:30 ` [PATCH v2 13/30] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data Roger Quadros
                   ` (21 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

PHY regulator handling must be done in the PHY driver

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/host/ehci-omap.c |   34 ----------------------------------
 1 files changed, 0 insertions(+), 34 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 3c63619..da3e322 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -42,7 +42,6 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/usb/ulpi.h>
-#include <linux/regulator/consumer.h>
 #include <linux/pm_runtime.h>
 #include <linux/gpio.h>
 #include <linux/clk.h>
@@ -112,19 +111,6 @@ static int omap_ehci_init(struct usb_hcd *hcd)
 	return rc;
 }
 
-static void disable_put_regulator(
-		struct usbhs_omap_platform_data *pdata)
-{
-	int i;
-
-	for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
-		if (pdata->regulator[i]) {
-			regulator_disable(pdata->regulator[i]);
-			regulator_put(pdata->regulator[i]);
-		}
-	}
-}
-
 /* configure so an HC device and id are always provided */
 /* always called with process context; sleeping is OK */
 
@@ -153,7 +139,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 	int					ret = -ENODEV;
 	int					irq;
 	int					i;
-	char					supply[7];
 
 	if (usb_disabled())
 		return -ENODEV;
@@ -221,23 +206,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 		usb_phy_set_suspend(omap->phy[i], 0);
 	}
 
-	/* get ehci regulator and enable */
-	for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
-		if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) {
-			pdata->regulator[i] = NULL;
-			continue;
-		}
-		snprintf(supply, sizeof(supply), "hsusb%d", i);
-		pdata->regulator[i] = regulator_get(dev, supply);
-		if (IS_ERR(pdata->regulator[i])) {
-			pdata->regulator[i] = NULL;
-			dev_dbg(dev,
-			"failed to get ehci port%d regulator\n", i);
-		} else {
-			regulator_enable(pdata->regulator[i]);
-		}
-	}
-
 	pm_runtime_enable(dev);
 	pm_runtime_get_sync(dev);
 
@@ -263,7 +231,6 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 	return 0;
 
 err_pm_runtime:
-	disable_put_regulator(pdata);
 	pm_runtime_put_sync(dev);
 
 err_phy:
@@ -294,7 +261,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
 	int i;
 
 	usb_remove_hcd(hcd);
-	disable_put_regulator(dev->platform_data);
 	usb_put_hcd(hcd);
 
 	for (i = 0; i < omap->nports; i++) {
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH v2 13/30] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (11 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH v2 12/30] usb: ehci-omap: Remove PHY regulator " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:28   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH v2 14/30] ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes Roger Quadros
                   ` (20 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add platform device and data for 'nop-usb-xceiv'. This will be used
as PHY for HS USB port 1, so provide binding information for it.

Get rid of managing the PHY clock as it will be done by the PHY driver.
For that to work we create a clock alias that links the PHY clock name
to the PHY device name.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-omap4panda.c |   34 ++++++++++++++++++++++---------
 1 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 1351489..2641752 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -30,6 +30,7 @@
 #include <linux/regulator/fixed.h>
 #include <linux/ti_wilink_st.h>
 #include <linux/usb/musb.h>
+#include <linux/usb/nop-usb-xceiv.h>
 #include <linux/wl12xx.h>
 #include <linux/platform_data/omap-abe-twl6040.h>
 
@@ -131,12 +132,27 @@ static struct platform_device btwilink_device = {
 	.id	= -1,
 };
 
+/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
+static struct nop_usb_xceiv_platform_data hsusb1_phy_data = {
+	/* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
+	.clk_rate = 19200000,
+};
+
+static struct platform_device hsusb1_phy_device = {
+	.name	= "nop_usb_xceiv",
+	.id	= 1,
+	.dev	= {
+		.platform_data = &hsusb1_phy_data,
+	},
+};
+
 static struct platform_device *panda_devices[] __initdata = {
 	&leds_gpio,
 	&wl1271_device,
 	&panda_abe_audio,
 	&panda_hdmi_audio_codec,
 	&btwilink_device,
+	&hsusb1_phy_device,
 };
 
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
@@ -157,16 +173,6 @@ static struct gpio panda_ehci_gpios[] __initdata = {
 static void __init omap4_ehci_init(void)
 {
 	int ret;
-	struct clk *phy_ref_clk;
-
-	/* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
-	phy_ref_clk = clk_get(NULL, "auxclk3_ck");
-	if (IS_ERR(phy_ref_clk)) {
-		pr_err("Cannot request auxclk3\n");
-		return;
-	}
-	clk_set_rate(phy_ref_clk, 19200000);
-	clk_prepare_enable(phy_ref_clk);
 
 	/* disable the power to the usb hub prior to init and reset phy+hub */
 	ret = gpio_request_array(panda_ehci_gpios,
@@ -180,6 +186,14 @@ static void __init omap4_ehci_init(void)
 	gpio_export(GPIO_HUB_NRESET, 0);
 	gpio_set_value(GPIO_HUB_NRESET, 1);
 
+	/* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
+	ret = clk_add_alias("main_clk", "nop_usb_xceiv.1", "auxclk3_ck", NULL);
+	if (ret)
+		pr_err("Failed to add main_clk alias to auxclk3_ck\n");
+
+	/* PHY on HS USB Port 1 i.e. index 0 */
+	usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
+
 	usbhs_init(&usbhs_bdata);
 
 	/* enable power to hub */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH v2 14/30] ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (12 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH v2 13/30] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:31   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 15/30] ARM: OMAP3: Beagle: " Roger Quadros
                   ` (19 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Model RESET and Power for HS USB Port 1 as GPIO fixed regulators
and link them to the 'nop-usb-xceiv' PHY by making them as "reset"
and "vcc" supplies.

The RESET and Power will then be managed by the PHY driver.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-omap4panda.c |   93 +++++++++++++++++++++++---------
 1 files changed, 67 insertions(+), 26 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 2641752..8c85e05 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -30,6 +30,7 @@
 #include <linux/regulator/fixed.h>
 #include <linux/ti_wilink_st.h>
 #include <linux/usb/musb.h>
+#include <linux/usb/phy.h>
 #include <linux/usb/nop-usb-xceiv.h>
 #include <linux/wl12xx.h>
 #include <linux/platform_data/omap-abe-twl6040.h>
@@ -146,6 +147,70 @@ static struct platform_device hsusb1_phy_device = {
 	},
 };
 
+/* Regulator for USB HUB/PHY reset */
+static struct regulator_consumer_supply hsusb1_reset_supplies[] = {
+/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.1"),
+};
+
+static struct regulator_init_data hsusb1_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies	= hsusb1_reset_supplies,
+	.num_consumer_supplies	= ARRAY_SIZE(hsusb1_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb1_reset_config = {
+	.supply_name    = "hsusb1_reset",
+	.microvolts = 3300000,
+	.gpio = GPIO_HUB_NRESET,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,	/* keep in RESET */
+	.init_data = &hsusb1_reset_data,
+};
+
+static struct platform_device hsusb1_reset_device = {
+	.name	= "reg-fixed-voltage",
+	.id	= PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb1_reset_config,
+	},
+};
+
+/* Regulator for USB HUB supply */
+static struct regulator_consumer_supply hsusb1_power_supplies[] = {
+/* Link PHY device to USB HUB supply so it gets enabled in the PHY driver */
+	REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.1"),
+};
+
+static struct regulator_init_data hsusb1_power_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies	= hsusb1_power_supplies,
+	.num_consumer_supplies	= ARRAY_SIZE(hsusb1_power_supplies),
+};
+
+static struct fixed_voltage_config hsusb1_power_config = {
+	.supply_name    = "hsusb1_vbus",
+	.microvolts = 3300000,
+	.gpio = GPIO_HUB_POWER,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,
+	.init_data = &hsusb1_power_data,
+};
+
+static struct platform_device hsusb1_power_device = {
+	.name	= "reg-fixed-voltage",
+	.id	= PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb1_power_config,
+	},
+};
+
 static struct platform_device *panda_devices[] __initdata = {
 	&leds_gpio,
 	&wl1271_device,
@@ -153,39 +218,18 @@ static struct platform_device *panda_devices[] __initdata = {
 	&panda_hdmi_audio_codec,
 	&btwilink_device,
 	&hsusb1_phy_device,
+	&hsusb1_power_device,
+	&hsusb1_reset_device,
 };
 
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-	.phy_reset  = false,
-	.reset_gpio_port[0]  = -EINVAL,
-	.reset_gpio_port[1]  = -EINVAL,
-	.reset_gpio_port[2]  = -EINVAL
-};
-
-static struct gpio panda_ehci_gpios[] __initdata = {
-	{ GPIO_HUB_POWER,	GPIOF_OUT_INIT_LOW,  "hub_power"  },
-	{ GPIO_HUB_NRESET,	GPIOF_OUT_INIT_LOW,  "hub_nreset" },
 };
 
 static void __init omap4_ehci_init(void)
 {
 	int ret;
 
-	/* disable the power to the usb hub prior to init and reset phy+hub */
-	ret = gpio_request_array(panda_ehci_gpios,
-				 ARRAY_SIZE(panda_ehci_gpios));
-	if (ret) {
-		pr_err("Unable to initialize EHCI power/reset\n");
-		return;
-	}
-
-	gpio_export(GPIO_HUB_POWER, 0);
-	gpio_export(GPIO_HUB_NRESET, 0);
-	gpio_set_value(GPIO_HUB_NRESET, 1);
-
 	/* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
 	ret = clk_add_alias("main_clk", "nop_usb_xceiv.1", "auxclk3_ck", NULL);
 	if (ret)
@@ -195,9 +239,6 @@ static void __init omap4_ehci_init(void)
 	usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
 
 	usbhs_init(&usbhs_bdata);
-
-	/* enable power to hub */
-	gpio_set_value(GPIO_HUB_POWER, 1);
 }
 
 static struct omap_musb_board_data musb_board_data = {
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 15/30] ARM: OMAP3: Beagle: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (13 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH v2 14/30] ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:31   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 16/30] ARM: OMAP3: 3430SDP: " Roger Quadros
                   ` (18 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add platform device for 'nop-usb-xceiv'. This will be used as a
PHY for HS USB Port 2, so provide binding information for it.

Model RESET and Power for HS USB Port 2 as GPIO fixed regulators
and link them to the 'nop-usb-xceiv' PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-omap3beagle.c |   93 +++++++++++++++++++++++++++---
 1 files changed, 83 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 1cb114e..d8c6993 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -32,7 +32,9 @@
 #include <linux/mmc/host.h>
 
 #include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
 #include <linux/i2c/twl.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -248,6 +250,76 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = {
 
 static struct gpio_led gpio_leds[];
 
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = 147,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
+/* Regulator for HS USB Port 2 supply */
+static struct regulator_consumer_supply hsusb2_power_supplies[] = {
+/* Link PHY device to power supply so it gets enabled in the PHY driver */
+	REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_power_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_power_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_power_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_power_config = {
+	.supply_name = "hsusb2_vbus",
+	.microvolts = 5000000,
+	.gpio = -1,		/* set at runtime in beagle_twl_gpio_setup */
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 0,	/* updated in omap3_beagle_init_rev() */
+	.enabled_at_boot = 0,
+	.init_data = &hsusb2_power_data,
+};
+
+static struct platform_device hsusb2_power_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_power_config,
+	},
+};
+
 static int beagle_twl_gpio_setup(struct device *dev,
 		unsigned gpio, unsigned ngpio)
 {
@@ -289,8 +361,11 @@ static int beagle_twl_gpio_setup(struct device *dev,
 	}
 	dvi_panel.power_down_gpio = beagle_config.dvi_pd_gpio;
 
-	gpio_request_one(gpio + TWL4030_GPIO_MAX, beagle_config.usb_pwr_level,
-			"nEN_USB_PWR");
+	/* TWL4030_GPIO_MAX controls HS USB Port 2 power */
+	hsusb2_power_config.gpio = gpio + TWL4030_GPIO_MAX;
+	hsusb2_power_config.enable_high = beagle_config.usb_pwr_level;
+
+	platform_device_register(&hsusb2_power_device);
 
 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
 	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
@@ -428,18 +503,12 @@ static struct platform_device *omap3_beagle_devices[] __initdata = {
 	&leds_gpio,
 	&keys_gpio,
 	&madc_hwmon,
+	&hsusb2_reset_device,
+	&hsusb2_phy_device,
 };
 
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-
-	.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = -EINVAL,
-	.reset_gpio_port[1]  = 147,
-	.reset_gpio_port[2]  = -EINVAL
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -520,7 +589,11 @@ static void __init omap3_beagle_init(void)
 				  mt46h32m32lf6_sdrc_params);
 
 	usb_musb_init(NULL);
+
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
 	usbhs_init(&usbhs_bdata);
+
 	board_nand_init(omap3beagle_nand_partitions,
 			ARRAY_SIZE(omap3beagle_nand_partitions), NAND_CS,
 			NAND_BUSWIDTH_16, NULL);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 16/30] ARM: OMAP3: 3430SDP: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (14 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 15/30] ARM: OMAP3: Beagle: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:31   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 17/30] ARM: OMAP3: 3630SDP: " Roger Quadros
                   ` (17 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add 2 platform devices for 'nop-usb-xceiv'. These will be used
as PHYs for HS USB ports 1 and 2 so provide binding information
for them.

Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
link them to the 2 PHYs we just created.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-3430sdp.c |   99 ++++++++++++++++++++++++++++++++--
 1 files changed, 93 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 46147c8..69b0944 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -21,6 +21,8 @@
 #include <linux/spi/spi.h>
 #include <linux/i2c/twl.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/usb/phy.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <linux/mmc/host.h>
@@ -424,16 +426,86 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
+/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
+static struct platform_device hsusb1_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 1,
+};
+
+/* Regulator for HS USB Port 1 PHY reset */
+static struct regulator_consumer_supply hsusb1_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.1"),
+};
+
+static struct regulator_init_data hsusb1_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb1_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb1_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb1_reset_config = {
+	.supply_name = "hsusb1_reset",
+	.microvolts = 3300000,
+	.gpio = 57,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb1_reset_data,
+};
+
+static struct platform_device hsusb1_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb1_reset_config,
+	},
+};
+
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = 61,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
 
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = 57,
-	.reset_gpio_port[1]  = 61,
-	.reset_gpio_port[2]  = -EINVAL
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -564,6 +636,13 @@ static struct flash_partitions sdp_flash_partitions[] = {
 	},
 };
 
+static struct platform_device *sdp3430_devices[] __initdata = {
+	&hsusb1_phy_device,
+	&hsusb1_reset_device,
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
+};
+
 static void __init omap_3430sdp_init(void)
 {
 	int gpio_pendown;
@@ -579,11 +658,19 @@ static void __init omap_3430sdp_init(void)
 	omap_ads7846_init(1, gpio_pendown, 310, NULL);
 	omap_serial_init();
 	omap_sdrc_init(hyb18m512160af6_sdrc_params, NULL);
+
+	platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
+
 	usb_musb_init(NULL);
 	board_smc91x_init();
 	board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
 	sdp3430_display_init();
 	enable_board_wakeup_source();
+
+	/* PHY on HSUSB Port 1 i.e. index 0 */
+	usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
 	usbhs_init(&usbhs_bdata);
 }
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 17/30] ARM: OMAP3: 3630SDP: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (15 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 16/30] ARM: OMAP3: 3430SDP: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:31   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 18/30] ARM: OMAP: AM3517crane: " Roger Quadros
                   ` (16 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add 2 platform devices for 'nop-usb-xceiv'. These will be used
as PHYs for HS USB ports 1 and 2 so provide binding information
for them.

Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
link them to the 2 PHYs we just created.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-3630sdp.c |  100 ++++++++++++++++++++++++++++++++--
 1 files changed, 94 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 78b1724..43683ea 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -12,6 +12,9 @@
 #include <linux/input.h>
 #include <linux/gpio.h>
 #include <linux/mtd/nand.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -53,16 +56,86 @@ static void enable_board_wakeup_source(void)
 		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
 }
 
+/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
+static struct platform_device hsusb1_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 1,
+};
+
+/* Regulator for HS USB Port 1 PHY reset */
+static struct regulator_consumer_supply hsusb1_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.1"),
+};
+
+static struct regulator_init_data hsusb1_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb1_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb1_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb1_reset_config = {
+	.supply_name = "hsusb1_reset",
+	.microvolts = 3300000,
+	.gpio = 126,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb1_reset_data,
+};
+
+static struct platform_device hsusb1_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb1_reset_config,
+	},
+};
+
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = 61,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
 
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = 126,
-	.reset_gpio_port[1]  = 61,
-	.reset_gpio_port[2]  = -EINVAL
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -189,6 +262,13 @@ static struct flash_partitions sdp_flash_partitions[] = {
 	},
 };
 
+static struct platform_device *sdp3630_devices[] __initdata = {
+	&hsusb1_phy_device,
+	&hsusb1_reset_device,
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
+};
+
 static void __init omap_sdp_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
@@ -199,6 +279,14 @@ static void __init omap_sdp_init(void)
 	board_smc91x_init();
 	board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
 	enable_board_wakeup_source();
+
+	platform_add_devices(sdp3630_devices, ARRAY_SIZE(sdp3630_devices));
+
+	/* PHY on HSUSB Port 1 i.e. index 0 */
+	usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
+
 	usbhs_init(&usbhs_bdata);
 }
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 18/30] ARM: OMAP: AM3517crane: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (16 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 17/30] ARM: OMAP3: 3630SDP: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:32   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 19/30] ARM: OMAP: AM3517evm: " Roger Quadros
                   ` (15 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add platform device for 'nop-usb-xceiv'. This will be used as a
PHY for HS USB Port 1, so provide binding information for it.

Model RESET and Power for HS USB Port 1 as GPIO fixed regulators
and link them to the 'nop-usb-xceiv' PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-am3517crane.c |   95 +++++++++++++++++++++++++++----
 1 files changed, 83 insertions(+), 12 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 26f1916..1d25af6 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -20,6 +20,9 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/gpio.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -40,15 +43,84 @@ static struct omap_board_mux board_mux[] __initdata = {
 };
 #endif
 
+/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
+static struct platform_device hsusb1_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 1,
+};
+
+/* Regulator for HS USB Port 1 PHY reset */
+static struct regulator_consumer_supply hsusb1_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.1"),
+};
+
+static struct regulator_init_data hsusb1_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb1_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb1_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb1_reset_config = {
+	.supply_name = "hsusb1_reset",
+	.microvolts = 3300000,
+	.gpio = GPIO_USB_NRESET,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb1_reset_data,
+};
+
+static struct platform_device hsusb1_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb1_reset_config,
+	},
+};
+
+/* Regulator for HS USB Port 1 supply */
+static struct regulator_consumer_supply hsusb1_power_supplies[] = {
+/* Link PHY device to power supply so it gets enabled in the PHY driver */
+	REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.1"),
+};
+
+static struct regulator_init_data hsusb1_power_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb1_power_supplies,
+	.num_consumer_supplies  = ARRAY_SIZE(hsusb1_power_supplies),
+};
+
+static struct fixed_voltage_config hsusb1_power_config = {
+	.supply_name = "hsusb1_vbus",
+	.microvolts = 5000000,
+	.gpio = GPIO_USB_POWER,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,
+	.init_data = &hsusb1_power_data,
+};
+
+static struct platform_device hsusb1_power_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb1_power_config,
+	},
+};
+
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+};
 
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = GPIO_USB_NRESET,
-	.reset_gpio_port[1]  = -EINVAL,
-	.reset_gpio_port[2]  = -EINVAL
+static struct platform_device *am3517_crane_devices[] __initdata = {
+	&hsusb1_phy_device,
+	&hsusb1_reset_device,
+	&hsusb1_power_device,
 };
 
 static void __init am3517_crane_init(void)
@@ -72,12 +144,11 @@ static void __init am3517_crane_init(void)
 		return;
 	}
 
-	ret = gpio_request_one(GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH,
-			       "usb_ehci_enable");
-	if (ret < 0) {
-		pr_err("Can not request GPIO %d\n", GPIO_USB_POWER);
-		return;
-	}
+	platform_add_devices(am3517_crane_devices,
+				ARRAY_SIZE(am3517_crane_devices));
+
+	/* PHY on HSUSB Port 1 i.e. index 0 */
+	usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
 
 	usbhs_init(&usbhs_bdata);
 	am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 19/30] ARM: OMAP: AM3517evm: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (17 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 18/30] ARM: OMAP: AM3517crane: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:32   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 20/30] ARM: OMAP3: cm-t35: " Roger Quadros
                   ` (14 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add 2 platform devices for 'nop-usb-xceiv'. These will be used as a
PHY for HS USB Port 1 and 2, so provide binding information for them.

Model RESET for HS USB Port 1 as GPIO fixed regulator and link it
to the 'nop-usb-xceiv' PHY on port 1.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-am3517evm.c |   66 ++++++++++++++++++++++++++++++---
 1 files changed, 60 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index c76725d..a06feb0 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -25,6 +25,9 @@
 #include <linux/can/platform/ti_hecc.h>
 #include <linux/davinci_emac.h>
 #include <linux/mmc/host.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/usb/phy.h>
 #include <linux/usb/musb.h>
 #include <linux/platform_data/gpio-omap.h>
 
@@ -274,6 +277,50 @@ static __init void am3517_evm_mcbsp1_init(void)
 	omap_ctrl_writel(devconf0, OMAP2_CONTROL_DEVCONF0);
 }
 
+/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
+static struct platform_device hsusb1_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 1,
+};
+
+/* Regulator for HS USB Port 1 PHY reset */
+static struct regulator_consumer_supply hsusb1_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.1"),
+};
+
+static struct regulator_init_data hsusb1_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb1_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb1_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb1_reset_config = {
+	.supply_name = "hsusb1_reset",
+	.microvolts = 3300000,
+	.gpio = 57,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb1_reset_data,
+};
+
+static struct platform_device hsusb1_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb1_reset_config,
+	},
+};
+
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
 #if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
@@ -282,12 +329,6 @@ static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
 #else
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
 #endif
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = 57,
-	.reset_gpio_port[1]  = -EINVAL,
-	.reset_gpio_port[2]  = -EINVAL
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -349,6 +390,11 @@ static struct omap2_hsmmc_info mmc[] = {
 	{}      /* Terminator */
 };
 
+static struct platform_device *am3517evm_devices[] __initdata = {
+	&hsusb1_phy_device,
+	&hsusb1_reset_device,
+	&hsusb2_phy_device,
+};
 
 static void __init am3517_evm_init(void)
 {
@@ -361,6 +407,14 @@ static void __init am3517_evm_init(void)
 
 	/* Configure GPIO for EHCI port */
 	omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
+
+	platform_add_devices(am3517evm_devices, ARRAY_SIZE(am3517evm_devices));
+
+	/* PHY on HSUSB Port 1 i.e. index 0 */
+	usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
+
 	usbhs_init(&usbhs_bdata);
 	am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
 	/* DSS */
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 20/30] ARM: OMAP3: cm-t35: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (18 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 19/30] ARM: OMAP: AM3517evm: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:32   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 21/30] ARM: OMAP3: cm-t3517: " Roger Quadros
                   ` (13 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add 2 platform devices for 'nop-usb-xceiv'. These will be used
as PHYs for HS USB ports 1 and 2 so provide binding information
for them.

Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
link them to the 2 PHYs we just created.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-cm-t35.c |   95 ++++++++++++++++++++++++++++++++++--
 1 files changed, 90 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index cdf1d6e..71a7eb4 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -29,6 +29,7 @@
 #include <linux/i2c/twl.h>
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
+#include <linux/usb/phy.h>
 #include <linux/mmc/host.h>
 
 #include <linux/spi/spi.h>
@@ -418,15 +419,92 @@ static struct omap2_hsmmc_info mmc[] = {
 	{}	/* Terminator */
 };
 
+/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
+static struct platform_device hsusb1_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 1,
+};
+
+/* Regulator for HS USB Port 1 PHY reset */
+static struct regulator_consumer_supply hsusb1_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.1"),
+};
+
+static struct regulator_init_data hsusb1_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb1_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb1_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb1_reset_config = {
+	.supply_name = "hsusb1_reset",
+	.microvolts = 3300000,
+	.gpio = OMAP_MAX_GPIO_LINES + 6,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb1_reset_data,
+};
+
+static struct platform_device hsusb1_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb1_reset_config,
+	},
+};
+
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = OMAP_MAX_GPIO_LINES + 7,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+};
 
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = OMAP_MAX_GPIO_LINES + 6,
-	.reset_gpio_port[1]  = OMAP_MAX_GPIO_LINES + 7,
-	.reset_gpio_port[2]  = -EINVAL
+static struct platform_device *usbhs_devices[] = {
+	&hsusb1_phy_device,
+	&hsusb1_reset_device,
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
 };
 
 static void  __init cm_t35_init_usbh(void)
@@ -443,6 +521,13 @@ static void  __init cm_t35_init_usbh(void)
 		msleep(1);
 	}
 
+	platform_add_devices(usbhs_devices, ARRAY_SIZE(usbhs_devices));
+
+	/* PHY on HSUSB Port 1 i.e. index 0 */
+	usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
+
 	usbhs_init(&usbhs_bdata);
 }
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 21/30] ARM: OMAP3: cm-t3517: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (19 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 20/30] ARM: OMAP3: cm-t35: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:32   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 22/30] ARM: OMAP: devkit8000: " Roger Quadros
                   ` (12 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add 2 platform devices for 'nop-usb-xceiv'. These will be used
as PHYs for HS USB ports 1 and 2 so provide binding information
for them.

Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
link them to the 2 PHYs we just created.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-cm-t3517.c |   97 ++++++++++++++++++++++++++++++++--
 1 files changed, 92 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index cfa9098..2ba97c5 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -33,6 +33,9 @@
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/can/platform/ti_hecc.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -166,15 +169,92 @@ static inline void cm_t3517_init_rtc(void) {}
 #define HSUSB2_RESET_GPIO	(147)
 #define USB_HUB_RESET_GPIO	(152)
 
+/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
+static struct platform_device hsusb1_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 1,
+};
+
+/* Regulator for HS USB Port 1 PHY reset */
+static struct regulator_consumer_supply hsusb1_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.1"),
+};
+
+static struct regulator_init_data hsusb1_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb1_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb1_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb1_reset_config = {
+	.supply_name = "hsusb1_reset",
+	.microvolts = 3300000,
+	.gpio = HSUSB1_RESET_GPIO,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb1_reset_data,
+};
+
+static struct platform_device hsusb1_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb1_reset_config,
+	},
+};
+
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = HSUSB2_RESET_GPIO,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
 static struct usbhs_omap_platform_data cm_t3517_ehci_pdata __initdata = {
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+};
 
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = HSUSB1_RESET_GPIO,
-	.reset_gpio_port[1]  = HSUSB2_RESET_GPIO,
-	.reset_gpio_port[2]  = -EINVAL,
+static struct platform_device *usbhs_devices[] = {
+	&hsusb1_phy_device,
+	&hsusb1_reset_device,
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
 };
 
 static int __init cm_t3517_init_usbh(void)
@@ -191,6 +271,13 @@ static int __init cm_t3517_init_usbh(void)
 		msleep(1);
 	}
 
+	platform_add_devices(usbhs_devices, ARRAY_SIZE(usbhs_devices));
+
+	/* PHY on HSUSB Port 1 i.e. index 0 */
+	usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
+
 	usbhs_init(&cm_t3517_ehci_pdata);
 
 	return 0;
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 22/30] ARM: OMAP: devkit8000: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (20 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 21/30] ARM: OMAP3: cm-t3517: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:33   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 23/30] ARM: OMAP3: igep0020: " Roger Quadros
                   ` (11 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add platform device for 'nop-usb-xceiv'. This will be used as a
PHY for HS USB Port 1, so provide binding information for it.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-devkit8000.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 051ec0d..f0fd75a 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -32,6 +32,7 @@
 
 #include <linux/regulator/machine.h>
 #include <linux/i2c/twl.h>
+#include <linux/usb/phy.h>
 #include "id.h"
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -429,22 +430,21 @@ static void __init omap_dm9000_init(void)
 	eth_addr[5] = (odi.id_0 & 0x000000ff);
 }
 
+/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
+static struct platform_device hsusb1_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 1,
+};
+
 static struct platform_device *devkit8000_devices[] __initdata = {
 	&leds_gpio,
 	&keys_gpio,
 	&omap_dm9000_dev,
+	&hsusb1_phy_device,
 };
 
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = -EINVAL,
-	.reset_gpio_port[1]  = -EINVAL,
-	.reset_gpio_port[2]  = -EINVAL
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -623,6 +623,10 @@ static void __init devkit8000_init(void)
 	omap_ads7846_init(2, OMAP3_DEVKIT_TS_GPIO, 0, NULL);
 
 	usb_musb_init(NULL);
+
+	/* PHY on HSUSB Port 1 i.e. index 0 */
+	usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
+
 	usbhs_init(&usbhs_bdata);
 	board_nand_init(devkit8000_nand_partitions,
 			ARRAY_SIZE(devkit8000_nand_partitions), NAND_CS,
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 23/30] ARM: OMAP3: igep0020: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (21 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 22/30] ARM: OMAP: devkit8000: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:33   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 24/30] ARM: OMAP3: omap3evm: " Roger Quadros
                   ` (10 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add 2 platform devices for 'nop-usb-xceiv'. These will be used
as PHYs for HS USB ports 1 and 2 so provide binding information
for them.

Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
link them to the 2 PHYs we just created.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-igep0020.c |  112 +++++++++++++++++++++++++++++----
 1 files changed, 98 insertions(+), 14 deletions(-)

diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index cfba790..3398988 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -21,6 +21,7 @@
 
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
+#include <linux/usb/phy.h>
 #include <linux/i2c/twl.h>
 #include <linux/mmc/host.h>
 
@@ -526,26 +527,98 @@ static void __init igep_i2c_init(void)
 	omap3_pmic_init("twl4030", &igep_twldata);
 }
 
+/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
+static struct platform_device hsusb1_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 1,
+};
+
+/* Regulator for HS USB Port 1 PHY reset */
+static struct regulator_consumer_supply hsusb1_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.1"),
+};
+
+static struct regulator_init_data hsusb1_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb1_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb1_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb1_reset_config = {
+	.supply_name = "hsusb1_reset",
+	.microvolts = 3300000,
+	.gpio = IGEP2_GPIO_USBH_NRESET,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb1_reset_data,
+};
+
+static struct platform_device hsusb1_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb1_reset_config,
+	},
+};
+
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = IGEP3_GPIO_USBH_NRESET,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
+static struct platform_device *igep2_devices[] __initdata = {
+	&hsusb1_phy_device,
+	&hsusb1_reset_device,
+};
+
+static struct platform_device *igep3_devices[] __initdata = {
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
+};
+
 static struct usbhs_omap_platform_data igep2_usbhs_bdata __initdata = {
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-
-	.phy_reset = true,
-	.reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET,
-	.reset_gpio_port[1] = -EINVAL,
-	.reset_gpio_port[2] = -EINVAL,
 };
 
 static struct usbhs_omap_platform_data igep3_usbhs_bdata __initdata = {
-	.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-
-	.phy_reset = true,
-	.reset_gpio_port[0] = -EINVAL,
-	.reset_gpio_port[1] = IGEP3_GPIO_USBH_NRESET,
-	.reset_gpio_port[2] = -EINVAL,
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -640,8 +713,19 @@ static void __init igep_init(void)
 	if (machine_is_igep0020()) {
 		omap_display_init(&igep2_dss_data);
 		igep2_init_smsc911x();
+
+		platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
+
+		/* PHY on HSUSB Port 1 i.e. index 0 */
+		usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
+
 		usbhs_init(&igep2_usbhs_bdata);
 	} else {
+		platform_add_devices(igep3_devices, ARRAY_SIZE(igep3_devices));
+
+		/* PHY on HSUSB Port 2 i.e. index 1 */
+		usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
+
 		usbhs_init(&igep3_usbhs_bdata);
 	}
 }
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 24/30] ARM: OMAP3: omap3evm: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (22 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 23/30] ARM: OMAP3: igep0020: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:33   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 25/30] ARM: OMAP3: omap3pandora: " Roger Quadros
                   ` (9 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add platform device for 'nop-usb-xceiv'. This will be used as a
PHY for HS USB Port 2, so provide binding information for it.

Model RESET for HS USB Port 2 as GPIO fixed regulator and link
it to the 'nop-usb-xceiv' PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-omap3evm.c |   63 ++++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 7bdc8a4..9f3550e 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -34,6 +34,7 @@
 #include <linux/usb/otg.h>
 #include <linux/usb/musb.h>
 #include <linux/usb/nop-usb-xceiv.h>
+#include <linux/usb/phy.h>
 #include <linux/smsc911x.h>
 
 #include <linux/wl12xx.h>
@@ -538,17 +539,51 @@ static int __init omap3_evm_i2c_init(void)
 	return 0;
 }
 
-static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
 
-	.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
-	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
 
-	.phy_reset  = true,
-	/* PHY reset GPIO will be runtime programmed based on EVM version */
-	.reset_gpio_port[0]  = -EINVAL,
-	.reset_gpio_port[1]  = -EINVAL,
-	.reset_gpio_port[2]  = -EINVAL
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = -1,		/* set at runtime */
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
+static struct platform_device *omap3evm_devices[] __initdata = {
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
+};
+
+static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
+	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -724,7 +759,7 @@ static void __init omap3_evm_init(void)
 
 		/* setup EHCI phy reset config */
 		omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);
-		usbhs_bdata.reset_gpio_port[1] = 21;
+		hsusb2_reset_config.gpio = 21;
 
 		/* EVM REV >= E can supply 500mA with EXTVBUS programming */
 		musb_board_data.power = 500;
@@ -732,9 +767,15 @@ static void __init omap3_evm_init(void)
 	} else {
 		/* setup EHCI phy reset on MDC */
 		omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
-		usbhs_bdata.reset_gpio_port[1] = 135;
+		hsusb2_reset_config.gpio = 135;
 	}
+
+	platform_add_devices(omap3evm_devices, ARRAY_SIZE(omap3evm_devices));
 	usb_musb_init(&musb_board_data);
+
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
+
 	usbhs_init(&usbhs_bdata);
 	board_nand_init(omap3evm_nand_partitions,
 			ARRAY_SIZE(omap3evm_nand_partitions), NAND_CS,
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 25/30] ARM: OMAP3: omap3pandora: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (23 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 24/30] ARM: OMAP3: omap3evm: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:33   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 26/30] ARM: OMAP3: omap3stalker: " Roger Quadros
                   ` (8 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add platform device for 'nop-usb-xceiv'. This will be used as a
PHY for HS USB Port 2, so provide binding information for it.

Model RESET for HS USB Port 2 as GPIO fixed regulator and link
it to the 'nop-usb-xceiv' PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-omap3pandora.c |   54 +++++++++++++++++++++++++----
 1 files changed, 46 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 145a6f8..c2cd1ea 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -23,6 +23,8 @@
 
 #include <linux/spi/spi.h>
 #include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/usb/phy.h>
 #include <linux/i2c/twl.h>
 #include <linux/wl12xx.h>
 #include <linux/mtd/partitions.h>
@@ -560,23 +562,55 @@ fail:
 	printk(KERN_ERR "wl1251 board initialisation failed\n");
 }
 
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = 16,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
 static struct platform_device *omap3pandora_devices[] __initdata = {
 	&pandora_leds_gpio,
 	&pandora_keys_gpio,
 	&pandora_vwlan_device,
 	&pandora_backlight,
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
 };
 
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-
-	.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = -EINVAL,
-	.reset_gpio_port[1]  = 16,
-	.reset_gpio_port[2]  = -EINVAL
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -601,6 +635,10 @@ static void __init omap3pandora_init(void)
 			ARRAY_SIZE(omap3pandora_spi_board_info));
 	omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
 	usbhs_init(&usbhs_bdata);
+
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
+
 	usb_musb_init(NULL);
 	gpmc_nand_init(&pandora_nand_data, NULL);
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 26/30] ARM: OMAP3: omap3stalker: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (24 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 25/30] ARM: OMAP3: omap3pandora: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:34   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 27/30] ARM: OMAP3: omap3touchbook: " Roger Quadros
                   ` (7 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add platform device for 'nop-usb-xceiv'. This will be used as a
PHY for HS USB Port 2, so provide binding information for it.

Model RESET for HS USB Port 2 as GPIO fixed regulator and link
it to the 'nop-usb-xceiv' PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-omap3stalker.c |   52 ++++++++++++++++++++++++++----
 1 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index 278ae95..ed343f0 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -26,6 +26,7 @@
 
 #include <linux/regulator/fixed.h>
 #include <linux/regulator/machine.h>
+#include <linux/usb/phy.h>
 #include <linux/i2c/twl.h>
 #include <linux/mmc/host.h>
 #include <linux/input/matrix_keypad.h>
@@ -357,19 +358,52 @@ static int __init omap3_stalker_i2c_init(void)
 
 #define OMAP3_STALKER_TS_GPIO	175
 
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = 21,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
 static struct platform_device *omap3_stalker_devices[] __initdata = {
 	&keys_gpio,
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
 };
 
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-	.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-
-	.phy_reset = true,
-	.reset_gpio_port[0] = -EINVAL,
-	.reset_gpio_port[1] = 21,
-	.reset_gpio_port[2] = -EINVAL,
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -405,6 +439,10 @@ static void __init omap3_stalker_init(void)
 	omap_serial_init();
 	omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
 	usb_musb_init(NULL);
+
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
+
 	usbhs_init(&usbhs_bdata);
 	omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 27/30] ARM: OMAP3: omap3touchbook: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (25 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 26/30] ARM: OMAP3: omap3stalker: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:34   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 28/30] ARM: OMAP3: overo: " Roger Quadros
                   ` (6 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add 2 platform devices for 'nop-usb-xceiv'. These will be used as a
PHY for HS USB Ports 1 and 2, so provide binding information for them.

Model RESET for HS USB Port 2 as GPIO fixed regulator and link it
to the respective 'nop-usb-xceiv' PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-omap3touchbook.c |   62 ++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 65a285f..3e00dbf 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -35,6 +35,8 @@
 #include <linux/spi/ads7846.h>
 
 #include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/usb/phy.h>
 #include <linux/i2c/twl.h>
 
 #include <asm/mach-types.h>
@@ -304,21 +306,61 @@ static struct omap_board_mux board_mux[] __initdata = {
 };
 #endif
 
+/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
+static struct platform_device hsusb1_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 1,
+};
+
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = 147,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
 static struct platform_device *omap3_touchbook_devices[] __initdata = {
 	&leds_gpio,
 	&keys_gpio,
+	&hsusb1_phy_device,
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
 };
 
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-
 	.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = -EINVAL,
-	.reset_gpio_port[1]  = 147,
-	.reset_gpio_port[2]  = -EINVAL
 };
 
 static void omap3_touchbook_poweroff(void)
@@ -366,6 +408,12 @@ static void __init omap3_touchbook_init(void)
 	/* Touchscreen and accelerometer */
 	omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
 	usb_musb_init(NULL);
+
+	/* PHY on HSUSB Port 1 i.e. index 0 */
+	usb_bind_phy("ehci-omap.0", 0, "nop_usb_xceiv.1");
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
+
 	usbhs_init(&usbhs_bdata);
 	board_nand_init(omap3touchbook_nand_partitions,
 			ARRAY_SIZE(omap3touchbook_nand_partitions), NAND_CS,
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 28/30] ARM: OMAP3: overo: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (26 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 27/30] ARM: OMAP3: omap3touchbook: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:40   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 29/30] ARM: OMAP: zoom: " Roger Quadros
                   ` (5 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add platform device for 'nop-usb-xceiv'. This will be used as a
PHY for HS USB Port 2, so provide binding information for it.

Model RESET for HS USB Port 2 as GPIO fixed regulator and link
it to the 'nop-usb-xceiv' PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-overo.c |   55 +++++++++++++++++++++++++++++++++----
 1 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index b1b0f09..5c6ea7d 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -31,6 +31,7 @@
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
 #include <linux/spi/spi.h>
+#include <linux/usb/phy.h>
 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
@@ -457,14 +458,51 @@ static int __init overo_spi_init(void)
 	return 0;
 }
 
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = OVERO_GPIO_USBH_NRESET,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
+static struct platform_device *overo_devices[] __initdata = {
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
+};
+
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-	.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
 	.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
-	.phy_reset  = true,
-	.reset_gpio_port[0]  = -EINVAL,
-	.reset_gpio_port[1]  = OVERO_GPIO_USBH_NRESET,
-	.reset_gpio_port[2]  = -EINVAL
 };
 
 #ifdef CONFIG_OMAP_MUX
@@ -499,7 +537,12 @@ static void __init overo_init(void)
 				  mt46h32m32lf6_sdrc_params);
 	board_nand_init(overo_nand_partitions,
 			ARRAY_SIZE(overo_nand_partitions), NAND_CS, 0, NULL);
+	platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
 	usb_musb_init(NULL);
+
+	/* PHY on HSUSB Port 2 i.e. index 1 */
+	usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
+
 	usbhs_init(&usbhs_bdata);
 	overo_spi_init();
 	overo_init_smsc911x();
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 29/30] ARM: OMAP: zoom: Adapt to ehci-omap changes
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (27 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 28/30] ARM: OMAP3: overo: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:40   ` Felipe Balbi
  2013-01-28 11:30 ` [PATCH 30/30] ARM: OMAP: USB: Remove unused fields from struct usbhs_omap_platform_data Roger Quadros
                   ` (4 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Add platform device for 'nop-usb-xceiv'. This will be used as a
PHY for HS USB Port 2, so provide binding information for it.

Model RESET for HS USB Port 2 as GPIO fixed regulator and link
it to the 'nop-usb-xceiv' PHY.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 arch/arm/mach-omap2/board-zoom.c |   56 +++++++++++++++++++++++++++++++++----
 1 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 2d7a457..d258632 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -17,6 +17,9 @@
 #include <linux/gpio.h>
 #include <linux/i2c/twl.h>
 #include <linux/mtd/nand.h>
+#include <linux/regulator/machine.h>
+#include <linux/regulator/fixed.h>
+#include <linux/usb/phy.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -92,14 +95,51 @@ static struct mtd_partition zoom_nand_partitions[] = {
 	},
 };
 
+/* PHY device on HS USB Port 2 i.e. nop_usb_xceiv.2 */
+static struct platform_device hsusb2_phy_device = {
+	.name = "nop_usb_xceiv",
+	.id = 2,
+};
+
+/* Regulator for HS USB Port 2 PHY reset */
+static struct regulator_consumer_supply hsusb2_reset_supplies[] = {
+	/* Link PHY device to reset supply so it gets used in the PHY driver */
+	REGULATOR_SUPPLY("reset", "nop_usb_xceiv.2"),
+};
+
+static struct regulator_init_data hsusb2_reset_data = {
+	.constraints = {
+		.valid_ops_mask = REGULATOR_CHANGE_STATUS,
+	},
+	.consumer_supplies = hsusb2_reset_supplies,
+	.num_consumer_supplies = ARRAY_SIZE(hsusb2_reset_supplies),
+};
+
+static struct fixed_voltage_config hsusb2_reset_config = {
+	.supply_name = "hsusb2_reset",
+	.microvolts = 3300000,
+	.gpio = ZOOM3_EHCI_RESET_GPIO,
+	.startup_delay = 70000, /* 70msec */
+	.enable_high = 1,
+	.enabled_at_boot = 0,   /* keep in RESET */
+	.init_data = &hsusb2_reset_data,
+};
+
+static struct platform_device hsusb2_reset_device = {
+	.name = "reg-fixed-voltage",
+	.id = PLATFORM_DEVID_AUTO,
+	.dev = {
+		.platform_data = &hsusb2_reset_config,
+	},
+};
+
+static struct platform_device *zoom3_devices[] __initdata = {
+	&hsusb2_phy_device,
+	&hsusb2_reset_device,
+};
+
 static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
-	.port_mode[0]		= OMAP_USBHS_PORT_MODE_UNUSED,
 	.port_mode[1]		= OMAP_EHCI_PORT_MODE_PHY,
-	.port_mode[2]		= OMAP_USBHS_PORT_MODE_UNUSED,
-	.phy_reset		= true,
-	.reset_gpio_port[0]	= -EINVAL,
-	.reset_gpio_port[1]	= ZOOM3_EHCI_RESET_GPIO,
-	.reset_gpio_port[2]	= -EINVAL,
 };
 
 static void __init omap_zoom_init(void)
@@ -109,6 +149,10 @@ static void __init omap_zoom_init(void)
 	} else if (machine_is_omap_zoom3()) {
 		omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
 		omap_mux_init_gpio(ZOOM3_EHCI_RESET_GPIO, OMAP_PIN_OUTPUT);
+
+		platform_add_devices(zoom3_devices, ARRAY_SIZE(zoom3_devices));
+		/* PHY on HSUSB Port 2 i.e. index 1 */
+		usb_bind_phy("ehci-omap.0", 1, "nop_usb_xceiv.2");
 		usbhs_init(&usbhs_bdata);
 	}
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 30/30] ARM: OMAP: USB: Remove unused fields from struct usbhs_omap_platform_data
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (28 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 29/30] ARM: OMAP: zoom: " Roger Quadros
@ 2013-01-28 11:30 ` Roger Quadros
  2013-02-05  9:40   ` Felipe Balbi
  2013-01-30 12:08 ` [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Mohammed, Afzal
                   ` (3 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 11:30 UTC (permalink / raw)
  To: tony
  Cc: linux, sameo, balbi, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

All users have been adapted to the changes in ehci-omap. We can now
get rid of the unused fields from usbhs_omap_platform_data.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 include/linux/platform_data/usb-omap.h |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h
index 925a4a7..227601f 100644
--- a/include/linux/platform_data/usb-omap.h
+++ b/include/linux/platform_data/usb-omap.h
@@ -41,13 +41,10 @@ enum usbhs_omap_port_mode {
 struct usbhs_omap_platform_data {
 	int				nports;
 	enum usbhs_omap_port_mode	port_mode[OMAP3_HS_USB_PORTS];
-	int				reset_gpio_port[OMAP3_HS_USB_PORTS];
-	struct regulator		*regulator[OMAP3_HS_USB_PORTS];
 
 	/* OMAP3 <= ES2.1 have a single ulpi bypass control bit */
 	unsigned			single_ulpi_bypass:1;
 	unsigned			es2_compatibility:1;
-	unsigned			phy_reset:1;
 };
 
 /*-------------------------------------------------------------------------*/
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()
  2013-01-28 11:30 ` [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap() Roger Quadros
@ 2013-01-28 15:17   ` Alan Stern
  2013-01-28 15:20     ` Russell King - ARM Linux
  2013-02-05  9:25   ` Felipe Balbi
  1 sibling, 1 reply; 101+ messages in thread
From: Alan Stern @ 2013-01-28 15:17 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

On Mon, 28 Jan 2013, Roger Quadros wrote:

> Make use of devm_request_and_ioremap() and correct comment.

Didn't a big patch come through recently converting all usages of 
devm_request_and_ioremap() to another function (I forget the name) that 
does its own error reporting and returns an ERR_PTR value?

(Checks the mailing list archive...)  Ah, here it is:

	http://marc.info/?l=linux-usb&m=135876311801537&w=2

And the new function is devm_ioremap_resource().  We should avoid 
adding new usages of an old interface.

Alan Stern


^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()
  2013-01-28 15:17   ` Alan Stern
@ 2013-01-28 15:20     ` Russell King - ARM Linux
  2013-01-29 15:34       ` Alan Stern
  0 siblings, 1 reply; 101+ messages in thread
From: Russell King - ARM Linux @ 2013-01-28 15:20 UTC (permalink / raw)
  To: Alan Stern
  Cc: Roger Quadros, tony, sameo, balbi, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

On Mon, Jan 28, 2013 at 10:17:33AM -0500, Alan Stern wrote:
> On Mon, 28 Jan 2013, Roger Quadros wrote:
> 
> > Make use of devm_request_and_ioremap() and correct comment.
> 
> Didn't a big patch come through recently converting all usages of 
> devm_request_and_ioremap() to another function (I forget the name) that 
> does its own error reporting and returns an ERR_PTR value?
> 
> (Checks the mailing list archive...)  Ah, here it is:
> 
> 	http://marc.info/?l=linux-usb&m=135876311801537&w=2
> 
> And the new function is devm_ioremap_resource().  We should avoid 
> adding new usages of an old interface.

Maybe... if devm_ioremap_resource() was already in the kernel.  The
problem at the moment is it isn't, and it'll probably be rather
horrid for everyone to deal with especially when it comes to testing.

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-28 11:30 ` [PATCH v2 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend Roger Quadros
@ 2013-01-28 15:40   ` Alan Stern
  2013-01-28 15:58     ` Roger Quadros
  2013-01-29  9:50   ` [PATCH v3 " Roger Quadros
  1 sibling, 1 reply; 101+ messages in thread
From: Alan Stern @ 2013-01-28 15:40 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

On Mon, 28 Jan 2013, Roger Quadros wrote:

> For each port that is in PHY mode we obtain a PHY device using the USB PHY
> library and put it out of suspend.
> 
> It is upto platform code to associate the PHY to the controller's
> port and it is upto the PHY driver to manage the PHY's resources.

"up to" is two words, not one.

> Signed-off-by: Roger Quadros <rogerq@ti.com>
> ---
>  drivers/usb/host/ehci-omap.c |   54 ++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 54 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index fd2f5450..a35e44e 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_hcd {
> +	struct usb_hcd *hcd;

This pointer is not needed any more.

> +	struct usb_phy **phy;	/* one PHY for each port */
> +	int nports;

Is there a reasonable upper limit on the number of ports?  If there is 
you could just put a fixed-size array here.

> @@ -233,6 +240,39 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>  	hcd->rsrc_len = resource_size(res);
>  	hcd->regs = regs;
>  
> +	omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv;
> +	omap->nports = pdata->nports;
> +	i = sizeof(struct usb_phy *) * omap->nports;
> +	omap->phy = devm_kzalloc(&pdev->dev, i, GFP_KERNEL);
> +	if (!omap->phy) {
> +		dev_err(dev, "Memory allocation failed\n");
> +		return -ENOMEM;

You have to put a "goto" here, not a "return".  The hcd must be cleaned 
up properly.

> @@ -295,11 +342,18 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
>  {
>  	struct device *dev				= &pdev->dev;
>  	struct usb_hcd *hcd				= dev_get_drvdata(dev);
> +	struct omap_hcd *omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv;

What's with the weird spacing in the first two declarations?  This 
isn't a typeset document where the paragraphs need to be fully 
justified.  :-)

> +	int i;
>  
>  	usb_remove_hcd(hcd);
>  	disable_put_regulator(dev->platform_data);
>  	usb_put_hcd(hcd);

This line must be moved down.  When the hcd is deallocated, the
omap_hcd structure goes with it.

> +	for (i = 0; i < omap->nports; i++) {
> +		if (omap->phy[i])
> +			usb_phy_shutdown(omap->phy[i]);
> +	}
> +

Alan Stern


^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-28 15:40   ` Alan Stern
@ 2013-01-28 15:58     ` Roger Quadros
  0 siblings, 0 replies; 101+ messages in thread
From: Roger Quadros @ 2013-01-28 15:58 UTC (permalink / raw)
  To: Alan Stern
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

On 01/28/2013 05:40 PM, Alan Stern wrote:
> On Mon, 28 Jan 2013, Roger Quadros wrote:
> 
>> For each port that is in PHY mode we obtain a PHY device using the USB PHY
>> library and put it out of suspend.
>>
>> It is upto platform code to associate the PHY to the controller's
>> port and it is upto the PHY driver to manage the PHY's resources.
> 
> "up to" is two words, not one.

right :P

> 
>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>> ---
>>  drivers/usb/host/ehci-omap.c |   54 ++++++++++++++++++++++++++++++++++++++++++
>>  1 files changed, 54 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
>> index fd2f5450..a35e44e 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_hcd {
>> +	struct usb_hcd *hcd;
> 
> This pointer is not needed any more.
> 
OK.

>> +	struct usb_phy **phy;	/* one PHY for each port */
>> +	int nports;
> 
> Is there a reasonable upper limit on the number of ports?  If there is 
> you could just put a fixed-size array here.

For now there are only 3 which is defined in OMAP3_HS_USB_PORTS. 

> 
>> @@ -233,6 +240,39 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>>  	hcd->rsrc_len = resource_size(res);
>>  	hcd->regs = regs;
>>  
>> +	omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv;
>> +	omap->nports = pdata->nports;
>> +	i = sizeof(struct usb_phy *) * omap->nports;
>> +	omap->phy = devm_kzalloc(&pdev->dev, i, GFP_KERNEL);
>> +	if (!omap->phy) {
>> +		dev_err(dev, "Memory allocation failed\n");
>> +		return -ENOMEM;
> 
> You have to put a "goto" here, not a "return".  The hcd must be cleaned 
> up properly.

good catch!

> 
>> @@ -295,11 +342,18 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
>>  {
>>  	struct device *dev				= &pdev->dev;
>>  	struct usb_hcd *hcd				= dev_get_drvdata(dev);
>> +	struct omap_hcd *omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv;
> 
> What's with the weird spacing in the first two declarations?  This 
> isn't a typeset document where the paragraphs need to be fully 
> justified.  :-)

Funny that it is all over the place ;). I'll fix it around whatever I touch.
> 
>> +	int i;
>>  
>>  	usb_remove_hcd(hcd);
>>  	disable_put_regulator(dev->platform_data);
>>  	usb_put_hcd(hcd);
> 
> This line must be moved down.  When the hcd is deallocated, the
> omap_hcd structure goes with it.

Good one. Will fix.
> 
>> +	for (i = 0; i < omap->nports; i++) {
>> +		if (omap->phy[i])
>> +			usb_phy_shutdown(omap->phy[i]);
>> +	}
>> +
> 

regards,
-roger


^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 11/30] usb: ehci-omap: Remove PHY reset handling code
  2013-01-28 11:30 ` [PATCH v2 11/30] usb: ehci-omap: Remove PHY reset handling code Roger Quadros
@ 2013-01-28 17:34   ` Alan Stern
  2013-02-05  9:27     ` Felipe Balbi
  0 siblings, 1 reply; 101+ messages in thread
From: Alan Stern @ 2013-01-28 17:34 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

On Mon, 28 Jan 2013, Roger Quadros wrote:

> Reset GPIO handling for the PHY must be done in the PHY
> driver. We use the PHY helpers instead to reset the PHY.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Alan Stern <stern@rowland.harvard.edu>


^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 12/30] usb: ehci-omap: Remove PHY regulator handling code
  2013-01-28 11:30 ` [PATCH v2 12/30] usb: ehci-omap: Remove PHY regulator " Roger Quadros
@ 2013-01-28 17:35   ` Alan Stern
  2013-02-05  9:27     ` Felipe Balbi
  0 siblings, 1 reply; 101+ messages in thread
From: Alan Stern @ 2013-01-28 17:35 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

On Mon, 28 Jan 2013, Roger Quadros wrote:

> PHY regulator handling must be done in the PHY driver
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Alan Stern <stern@rowland.harvard.edu>


^ permalink raw reply	[flat|nested] 101+ messages in thread

* [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-28 11:30 ` [PATCH v2 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend Roger Quadros
  2013-01-28 15:40   ` Alan Stern
@ 2013-01-29  9:50   ` Roger Quadros
  2013-01-29  9:57     ` Felipe Balbi
  2013-01-29 15:30     ` Alan Stern
  1 sibling, 2 replies; 101+ messages in thread
From: Roger Quadros @ 2013-01-29  9:50 UTC (permalink / raw)
  To: tony, stern
  Cc: linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

For each port that is in PHY mode we obtain a PHY device using the USB PHY
library and put it out of suspend.

It is up to platform code to associate the PHY to the controller's
port and it is upto the PHY driver to manage the PHY's resources.

Also remove wired spacing around declarations we come across.

Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/host/ehci-omap.c |   76 ++++++++++++++++++++++++++++++++++--------
 1 files changed, 62 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index fd2f5450..ddc31fb 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -4,10 +4,11 @@
  * Bus Glue for the EHCI controllers in OMAP3/4
  * Tested on several OMAP3 boards, and OMAP4 Pandaboard
  *
- * Copyright (C) 2007-2011 Texas Instruments, Inc.
+ * Copyright (C) 2007-2013 Texas Instruments, Inc.
  *	Author: Vikram Pandita <vikram.pandita@ti.com>
  *	Author: Anand Gadiyar <gadiyar@ti.com>
  *	Author: Keshava Munegowda <keshava_mgowda@ti.com>
+ *	Author: Roger Quadros <rogerq@ti.com>
  *
  * Copyright (C) 2009 Nokia Corporation
  *	Contact: Felipe Balbi <felipe.balbi@nokia.com>
@@ -70,6 +71,10 @@ static const char hcd_name[] = "ehci-omap";
 
 /*-------------------------------------------------------------------------*/
 
+struct omap_hcd {
+	struct usb_phy *phy[OMAP3_HS_USB_PORTS]; /* one PHY for each port */
+	int nports;
+};
 
 static inline void ehci_write(void __iomem *base, u32 reg, u32 val)
 {
@@ -178,7 +183,8 @@ static void disable_put_regulator(
 static struct hc_driver __read_mostly ehci_omap_hc_driver;
 
 static const struct ehci_driver_overrides ehci_omap_overrides __initdata = {
-	.reset =		omap_ehci_init,
+	.reset = omap_ehci_init,
+	.extra_priv_size = sizeof(struct omap_hcd),
 };
 
 /**
@@ -190,15 +196,16 @@ static const struct ehci_driver_overrides ehci_omap_overrides __initdata = {
  */
 static int ehci_hcd_omap_probe(struct platform_device *pdev)
 {
-	struct device				*dev = &pdev->dev;
-	struct usbhs_omap_platform_data		*pdata = dev->platform_data;
-	struct resource				*res;
-	struct usb_hcd				*hcd;
-	void __iomem				*regs;
-	int					ret = -ENODEV;
-	int					irq;
-	int					i;
-	char					supply[7];
+	struct device *dev = &pdev->dev;
+	struct usbhs_omap_platform_data *pdata = dev->platform_data;
+	struct resource	*res;
+	struct usb_hcd	*hcd;
+	void __iomem *regs;
+	int ret = -ENODEV;
+	int irq;
+	int i;
+	char supply[7];
+	struct omap_hcd	*omap;
 
 	if (usb_disabled())
 		return -ENODEV;
@@ -233,6 +240,33 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 	hcd->rsrc_len = resource_size(res);
 	hcd->regs = regs;
 
+	omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv;
+	omap->nports = pdata->nports;
+
+	platform_set_drvdata(pdev, hcd);
+
+	/* get the PHY devices if needed */
+	for (i = 0 ; i < omap->nports ; i++) {
+		struct usb_phy *phy;
+
+		if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY)
+			continue;
+
+		/* get the PHY device */
+		phy = devm_usb_get_phy_dev(dev, i);
+		if (IS_ERR(phy) || !phy) {
+			ret = IS_ERR(phy) ? PTR_ERR(phy) : -ENODEV;
+			dev_err(dev, "Can't get PHY device for port %d: %d\n",
+					i, ret);
+			goto err_phy;
+		}
+
+		omap->phy[i] = phy;
+		usb_phy_init(omap->phy[i]);
+		/* bring PHY out of suspend */
+		usb_phy_set_suspend(omap->phy[i], 0);
+	}
+
 	/* get ehci regulator and enable */
 	for (i = 0 ; i < OMAP3_HS_USB_PORTS ; i++) {
 		if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) {
@@ -277,6 +311,13 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 err_pm_runtime:
 	disable_put_regulator(pdata);
 	pm_runtime_put_sync(dev);
+
+err_phy:
+	for (i = 0; i < omap->nports; i++) {
+		if (omap->phy[i])
+			usb_phy_shutdown(omap->phy[i]);
+	}
+
 	usb_put_hcd(hcd);
 
 	return ret;
@@ -293,13 +334,20 @@ err_pm_runtime:
  */
 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 usb_hcd *hcd = dev_get_drvdata(dev);
+	struct omap_hcd *omap = (struct omap_hcd *)hcd_to_ehci(hcd)->priv;
+	int i;
 
 	usb_remove_hcd(hcd);
 	disable_put_regulator(dev->platform_data);
-	usb_put_hcd(hcd);
 
+	for (i = 0; i < omap->nports; i++) {
+		if (omap->phy[i])
+			usb_phy_shutdown(omap->phy[i]);
+	}
+
+	usb_put_hcd(hcd);
 	pm_runtime_put_sync(dev);
 	pm_runtime_disable(dev);
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-29  9:50   ` [PATCH v3 " Roger Quadros
@ 2013-01-29  9:57     ` Felipe Balbi
  2013-01-29 10:08       ` Roger Quadros
  2013-01-29 15:30     ` Alan Stern
  1 sibling, 1 reply; 101+ messages in thread
From: Felipe Balbi @ 2013-01-29  9:57 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, stern, linux, sameo, balbi, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 604 bytes --]

Hi,

On Tue, Jan 29, 2013 at 11:50:32AM +0200, Roger Quadros wrote:
> For each port that is in PHY mode we obtain a PHY device using the USB PHY
> library and put it out of suspend.
> 
> It is up to platform code to associate the PHY to the controller's
> port and it is upto the PHY driver to manage the PHY's resources.
> 
> Also remove wired spacing around declarations we come across.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

ideally, this would be done generically by ehci-hcd.ko itself. Alan,
would you have objections provided it doesn't break anyone else ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-29  9:57     ` Felipe Balbi
@ 2013-01-29 10:08       ` Roger Quadros
  2013-01-29 10:12         ` Felipe Balbi
  0 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-01-29 10:08 UTC (permalink / raw)
  To: balbi
  Cc: tony, stern, linux, sameo, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

On 01/29/2013 11:57 AM, Felipe Balbi wrote:
> Hi,
> 
> On Tue, Jan 29, 2013 at 11:50:32AM +0200, Roger Quadros wrote:
>> For each port that is in PHY mode we obtain a PHY device using the USB PHY
>> library and put it out of suspend.
>>
>> It is up to platform code to associate the PHY to the controller's
>> port and it is upto the PHY driver to manage the PHY's resources.
>>
>> Also remove wired spacing around declarations we come across.
>>
>> Signed-off-by: Roger Quadros <rogerq@ti.com>
> 
> ideally, this would be done generically by ehci-hcd.ko itself. Alan,
> would you have objections provided it doesn't break anyone else ?
> 
Agreed, and PHY suspend/resume should be done at port granularity.

But considering the erratas we have in OMAP EHCI, I would still prefer to
have control of the PHY in ehci-omap. We might even have to do some ULPI
transfers in certain scenarios to work around some of the erratas.

cheers,
-roger

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-29 10:08       ` Roger Quadros
@ 2013-01-29 10:12         ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-01-29 10:12 UTC (permalink / raw)
  To: Roger Quadros
  Cc: balbi, tony, stern, linux, sameo, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1157 bytes --]

On Tue, Jan 29, 2013 at 12:08:23PM +0200, Roger Quadros wrote:
> On 01/29/2013 11:57 AM, Felipe Balbi wrote:
> > Hi,
> > 
> > On Tue, Jan 29, 2013 at 11:50:32AM +0200, Roger Quadros wrote:
> >> For each port that is in PHY mode we obtain a PHY device using the USB PHY
> >> library and put it out of suspend.
> >>
> >> It is up to platform code to associate the PHY to the controller's
> >> port and it is upto the PHY driver to manage the PHY's resources.
> >>
> >> Also remove wired spacing around declarations we come across.
> >>
> >> Signed-off-by: Roger Quadros <rogerq@ti.com>
> > 
> > ideally, this would be done generically by ehci-hcd.ko itself. Alan,
> > would you have objections provided it doesn't break anyone else ?
> > 
> Agreed, and PHY suspend/resume should be done at port granularity.

right.

> But considering the erratas we have in OMAP EHCI, I would still prefer to
> have control of the PHY in ehci-omap. We might even have to do some ULPI
> transfers in certain scenarios to work around some of the erratas.

fair enough, then let's start with your change and make it more generic
later.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-29  9:50   ` [PATCH v3 " Roger Quadros
  2013-01-29  9:57     ` Felipe Balbi
@ 2013-01-29 15:30     ` Alan Stern
  2013-01-29 15:33       ` Roger Quadros
                         ` (2 more replies)
  1 sibling, 3 replies; 101+ messages in thread
From: Alan Stern @ 2013-01-29 15:30 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

On Tue, 29 Jan 2013, Roger Quadros wrote:

> For each port that is in PHY mode we obtain a PHY device using the USB PHY
> library and put it out of suspend.
> 
> It is up to platform code to associate the PHY to the controller's
> port and it is upto the PHY driver to manage the PHY's resources.

s/upto/up to/

> Also remove wired spacing around declarations we come across.

s/wired/weird/ -- not that people care about misspellings in the 
Changelog.  You don't have to resubmit the patch just to fix these two 
items.

> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Alan Stern <stern@rowland.harvard.edu>


^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-29 15:30     ` Alan Stern
@ 2013-01-29 15:33       ` Roger Quadros
  2013-02-05  9:13       ` Felipe Balbi
  2013-02-05  9:26       ` Felipe Balbi
  2 siblings, 0 replies; 101+ messages in thread
From: Roger Quadros @ 2013-01-29 15:33 UTC (permalink / raw)
  To: Alan Stern
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

On 01/29/2013 05:30 PM, Alan Stern wrote:
> On Tue, 29 Jan 2013, Roger Quadros wrote:
> 
>> For each port that is in PHY mode we obtain a PHY device using the USB PHY
>> library and put it out of suspend.
>>
>> It is up to platform code to associate the PHY to the controller's
>> port and it is upto the PHY driver to manage the PHY's resources.
> 
> s/upto/up to/
> 
>> Also remove wired spacing around declarations we come across.
> 
> s/wired/weird/ -- not that people care about misspellings in the 
> Changelog.  You don't have to resubmit the patch just to fix these two 
> items.
> 
>> Signed-off-by: Roger Quadros <rogerq@ti.com>
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> 

Thanks Alan. I'll fix them in the pull request.

cheers,
-roger

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()
  2013-01-28 15:20     ` Russell King - ARM Linux
@ 2013-01-29 15:34       ` Alan Stern
  2013-01-29 16:01         ` Russell King - ARM Linux
  0 siblings, 1 reply; 101+ messages in thread
From: Alan Stern @ 2013-01-29 15:34 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Roger Quadros, tony, sameo, balbi, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

On Mon, 28 Jan 2013, Russell King - ARM Linux wrote:

> On Mon, Jan 28, 2013 at 10:17:33AM -0500, Alan Stern wrote:
> > On Mon, 28 Jan 2013, Roger Quadros wrote:
> > 
> > > Make use of devm_request_and_ioremap() and correct comment.
> > 
> > Didn't a big patch come through recently converting all usages of 
> > devm_request_and_ioremap() to another function (I forget the name) that 
> > does its own error reporting and returns an ERR_PTR value?
> > 
> > (Checks the mailing list archive...)  Ah, here it is:
> > 
> > 	http://marc.info/?l=linux-usb&m=135876311801537&w=2
> > 
> > And the new function is devm_ioremap_resource().  We should avoid 
> > adding new usages of an old interface.
> 
> Maybe... if devm_ioremap_resource() was already in the kernel.  The
> problem at the moment is it isn't, and it'll probably be rather
> horrid for everyone to deal with especially when it comes to testing.

Not in the kernel yet?  I didn't realize that.  Looks like Thierry 
Reding will have some clean-up work to do when it does get in.

Okay, then

Acked-by: Alan Stern <stern@rowland.harvard.edu>


^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()
  2013-01-29 15:34       ` Alan Stern
@ 2013-01-29 16:01         ` Russell King - ARM Linux
  2013-01-29 22:08           ` Greg KH
  0 siblings, 1 reply; 101+ messages in thread
From: Russell King - ARM Linux @ 2013-01-29 16:01 UTC (permalink / raw)
  To: Alan Stern
  Cc: Roger Quadros, tony, sameo, balbi, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

On Tue, Jan 29, 2013 at 10:34:53AM -0500, Alan Stern wrote:
> On Mon, 28 Jan 2013, Russell King - ARM Linux wrote:
> 
> > On Mon, Jan 28, 2013 at 10:17:33AM -0500, Alan Stern wrote:
> > > On Mon, 28 Jan 2013, Roger Quadros wrote:
> > > 
> > > > Make use of devm_request_and_ioremap() and correct comment.
> > > 
> > > Didn't a big patch come through recently converting all usages of 
> > > devm_request_and_ioremap() to another function (I forget the name) that 
> > > does its own error reporting and returns an ERR_PTR value?
> > > 
> > > (Checks the mailing list archive...)  Ah, here it is:
> > > 
> > > 	http://marc.info/?l=linux-usb&m=135876311801537&w=2
> > > 
> > > And the new function is devm_ioremap_resource().  We should avoid 
> > > adding new usages of an old interface.
> > 
> > Maybe... if devm_ioremap_resource() was already in the kernel.  The
> > problem at the moment is it isn't, and it'll probably be rather
> > horrid for everyone to deal with especially when it comes to testing.
> 
> Not in the kernel yet?  I didn't realize that.  Looks like Thierry 
> Reding will have some clean-up work to do when it does get in.

It may be in linux-next, but it isn't in Linus' yet... (of course, it's
probably scheduled for the upcoming merge window).  Certainly:

$ grep -r devm_ioremap_resource include

against Linus' tree (6abb7c2) still turns up nothing.

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()
  2013-01-29 16:01         ` Russell King - ARM Linux
@ 2013-01-29 22:08           ` Greg KH
  0 siblings, 0 replies; 101+ messages in thread
From: Greg KH @ 2013-01-29 22:08 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Alan Stern, Roger Quadros, tony, sameo, balbi, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

On Tue, Jan 29, 2013 at 04:01:34PM +0000, Russell King - ARM Linux wrote:
> On Tue, Jan 29, 2013 at 10:34:53AM -0500, Alan Stern wrote:
> > On Mon, 28 Jan 2013, Russell King - ARM Linux wrote:
> > 
> > > On Mon, Jan 28, 2013 at 10:17:33AM -0500, Alan Stern wrote:
> > > > On Mon, 28 Jan 2013, Roger Quadros wrote:
> > > > 
> > > > > Make use of devm_request_and_ioremap() and correct comment.
> > > > 
> > > > Didn't a big patch come through recently converting all usages of 
> > > > devm_request_and_ioremap() to another function (I forget the name) that 
> > > > does its own error reporting and returns an ERR_PTR value?
> > > > 
> > > > (Checks the mailing list archive...)  Ah, here it is:
> > > > 
> > > > 	http://marc.info/?l=linux-usb&m=135876311801537&w=2
> > > > 
> > > > And the new function is devm_ioremap_resource().  We should avoid 
> > > > adding new usages of an old interface.
> > > 
> > > Maybe... if devm_ioremap_resource() was already in the kernel.  The
> > > problem at the moment is it isn't, and it'll probably be rather
> > > horrid for everyone to deal with especially when it comes to testing.
> > 
> > Not in the kernel yet?  I didn't realize that.  Looks like Thierry 
> > Reding will have some clean-up work to do when it does get in.
> 
> It may be in linux-next, but it isn't in Linus' yet... (of course, it's
> probably scheduled for the upcoming merge window).  Certainly:
> 
> $ grep -r devm_ioremap_resource include
> 
> against Linus' tree (6abb7c2) still turns up nothing.

It's in my driver-core-next tree and will be going to Linus for 3.9-rc1.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 101+ messages in thread

* RE: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (29 preceding siblings ...)
  2013-01-28 11:30 ` [PATCH 30/30] ARM: OMAP: USB: Remove unused fields from struct usbhs_omap_platform_data Roger Quadros
@ 2013-01-30 12:08 ` Mohammed, Afzal
  2013-01-30 12:48   ` Roger Quadros
  2013-02-04 14:35 ` [PATCH v2 09/31] USB: ehci-omap: Use devm_ioremap_resource() Roger Quadros
                   ` (2 subsequent siblings)
  33 siblings, 1 reply; 101+ messages in thread
From: Mohammed, Afzal @ 2013-01-30 12:08 UTC (permalink / raw)
  To: Quadros, Roger, tony
  Cc: linux, sameo, Balbi, Felipe, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 402 bytes --]

Hi Roger,

On Mon, Jan 28, 2013 at 17:00:01, Quadros, Roger wrote:

> NOTE: Tested on 4460ES-B1 Panda and BeagleBoard C4 only. Other boards are only
> build tested.

Please try to ensure that beagle bone USB0 works with this.

Regards
Afzal

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-01-30 12:08 ` [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Mohammed, Afzal
@ 2013-01-30 12:48   ` Roger Quadros
  2013-01-30 13:12     ` Mohammed, Afzal
  2013-01-30 13:15     ` Felipe Balbi
  0 siblings, 2 replies; 101+ messages in thread
From: Roger Quadros @ 2013-01-30 12:48 UTC (permalink / raw)
  To: Mohammed, Afzal
  Cc: tony, linux, sameo, Balbi, Felipe, stern, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel,
	robertcnelson

On 01/30/2013 02:08 PM, Mohammed, Afzal wrote:
> Hi Roger,
> 
> On Mon, Jan 28, 2013 at 17:00:01, Quadros, Roger wrote:
> 
>> NOTE: Tested on 4460ES-B1 Panda and BeagleBoard C4 only. Other boards are only
>> build tested.
> 
> Please try to ensure that beagle bone USB0 works with this.
> 

Hi Afzal,

I do not have beaglebone with me and don't seem to find beaglebone
board support in mainline.

I would appreciate if someone who knows more about beaglebone can help
with verification.

I could find that Robert C Nelson (now in cc) is maintaining out of tree
patches for the beaglebone. Maybe he could help with verification?

regards,
-roger

^ permalink raw reply	[flat|nested] 101+ messages in thread

* RE: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-01-30 12:48   ` Roger Quadros
@ 2013-01-30 13:12     ` Mohammed, Afzal
  2013-01-30 13:15       ` Roger Quadros
  2013-01-30 13:15     ` Felipe Balbi
  1 sibling, 1 reply; 101+ messages in thread
From: Mohammed, Afzal @ 2013-01-30 13:12 UTC (permalink / raw)
  To: Quadros, Roger
  Cc: tony, linux, sameo, Balbi, Felipe, stern, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel,
	robertcnelson

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 762 bytes --]

Hi Roger,

On Wed, Jan 30, 2013 at 18:18:50, Quadros, Roger wrote:
> On 01/30/2013 02:08 PM, Mohammed, Afzal wrote:

> > Please try to ensure that beagle bone USB0 works with this.

> I do not have beaglebone with me and don't seem to find beaglebone
> board support in mainline.

Ok. Fyi, beagle bone is supported in mainline - it is dt boot.

Regards
Afzal

> I would appreciate if someone who knows more about beaglebone can help
> with verification.
> 
> I could find that Robert C Nelson (now in cc) is maintaining out of tree
> patches for the beaglebone. Maybe he could help with verification?

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-01-30 12:48   ` Roger Quadros
  2013-01-30 13:12     ` Mohammed, Afzal
@ 2013-01-30 13:15     ` Felipe Balbi
  2013-01-30 13:19       ` Mohammed, Afzal
  1 sibling, 1 reply; 101+ messages in thread
From: Felipe Balbi @ 2013-01-30 13:15 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Mohammed, Afzal, tony, linux, sameo, Balbi, Felipe, stern,
	gregkh, eballetbo, javier, sshtylyov, linux-usb, linux-kernel,
	linux-arm-kernel, robertcnelson

[-- Attachment #1: Type: text/plain, Size: 915 bytes --]

Hi,

On Wed, Jan 30, 2013 at 02:48:50PM +0200, Roger Quadros wrote:
> On 01/30/2013 02:08 PM, Mohammed, Afzal wrote:
> > Hi Roger,
> > 
> > On Mon, Jan 28, 2013 at 17:00:01, Quadros, Roger wrote:
> > 
> >> NOTE: Tested on 4460ES-B1 Panda and BeagleBoard C4 only. Other boards are only
> >> build tested.
> > 
> > Please try to ensure that beagle bone USB0 works with this.
> > 
> 
> Hi Afzal,
> 
> I do not have beaglebone with me and don't seem to find beaglebone
> board support in mainline.

beagle bone is DT-only :-) (see arch/arm/boot/dts/am335x-bone.dts)

> I would appreciate if someone who knows more about beaglebone can help
> with verification.
> 
> I could find that Robert C Nelson (now in cc) is maintaining out of tree
> patches for the beaglebone. Maybe he could help with verification?

Right, Afzal if you have the bone could you help Roger validating ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-01-30 13:12     ` Mohammed, Afzal
@ 2013-01-30 13:15       ` Roger Quadros
  0 siblings, 0 replies; 101+ messages in thread
From: Roger Quadros @ 2013-01-30 13:15 UTC (permalink / raw)
  To: Mohammed, Afzal
  Cc: tony, linux, sameo, Balbi, Felipe, stern, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel,
	robertcnelson

On 01/30/2013 03:12 PM, Mohammed, Afzal wrote:
> Hi Roger,
> 
> On Wed, Jan 30, 2013 at 18:18:50, Quadros, Roger wrote:
>> On 01/30/2013 02:08 PM, Mohammed, Afzal wrote:
> 
>>> Please try to ensure that beagle bone USB0 works with this.
> 
>> I do not have beaglebone with me and don't seem to find beaglebone
>> board support in mainline.
> 
> Ok. Fyi, beagle bone is supported in mainline - it is dt boot

OMAP USB host is not yet supported for DT boot in mainline. I'm working on this
at the moment.

cheersm
-roger

^ permalink raw reply	[flat|nested] 101+ messages in thread

* RE: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-01-30 13:15     ` Felipe Balbi
@ 2013-01-30 13:19       ` Mohammed, Afzal
  2013-02-01 14:21         ` Mohammed, Afzal
  0 siblings, 1 reply; 101+ messages in thread
From: Mohammed, Afzal @ 2013-01-30 13:19 UTC (permalink / raw)
  To: Balbi, Felipe, Quadros, Roger
  Cc: tony, linux, sameo, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel, robertcnelson

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 704 bytes --]

Hi Felipe,

On Wed, Jan 30, 2013 at 18:45:04, Balbi, Felipe wrote:
> On Wed, Jan 30, 2013 at 02:48:50PM +0200, Roger Quadros wrote:

> > I would appreciate if someone who knows more about beaglebone can help
> > with verification.
> > 
> > I could find that Robert C Nelson (now in cc) is maintaining out of tree
> > patches for the beaglebone. Maybe he could help with verification?
> 
> Right, Afzal if you have the bone could you help Roger validating ?

I am not in a position to validate it, in the middle of another task.

Regards
Afzal

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 101+ messages in thread

* RE: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-01-30 13:19       ` Mohammed, Afzal
@ 2013-02-01 14:21         ` Mohammed, Afzal
  2013-02-01 14:25           ` Roger Quadros
  0 siblings, 1 reply; 101+ messages in thread
From: Mohammed, Afzal @ 2013-02-01 14:21 UTC (permalink / raw)
  To: Balbi, Felipe, Quadros, Roger
  Cc: tony, linux, sameo, stern, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel, robertcnelson

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 701 bytes --]

Hi Felipe, Roger,

On Wed, Jan 30, 2013 at 18:49:17, Mohammed, Afzal wrote:
> On Wed, Jan 30, 2013 at 18:45:04, Balbi, Felipe wrote:
> > On Wed, Jan 30, 2013 at 02:48:50PM +0200, Roger Quadros wrote:

> > > I would appreciate if someone who knows more about beaglebone can help
> > > with verification.

> > Right, Afzal if you have the bone could you help Roger validating ?

> I am not in a position to validate it, in the middle of another task.

Ok, I tested this, usb first instance of beagle bone works as in mainline.

Regards
Afzal

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-01 14:21         ` Mohammed, Afzal
@ 2013-02-01 14:25           ` Roger Quadros
  2013-02-01 14:27             ` Mohammed, Afzal
  0 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-02-01 14:25 UTC (permalink / raw)
  To: Mohammed, Afzal
  Cc: Balbi, Felipe, tony, linux, sameo, stern, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel,
	robertcnelson

On 02/01/2013 04:21 PM, Mohammed, Afzal wrote:
> Hi Felipe, Roger,
> 
> On Wed, Jan 30, 2013 at 18:49:17, Mohammed, Afzal wrote:
>> On Wed, Jan 30, 2013 at 18:45:04, Balbi, Felipe wrote:
>>> On Wed, Jan 30, 2013 at 02:48:50PM +0200, Roger Quadros wrote:
> 
>>>> I would appreciate if someone who knows more about beaglebone can help
>>>> with verification.
> 
>>> Right, Afzal if you have the bone could you help Roger validating ?
> 
>> I am not in a position to validate it, in the middle of another task.
> 
> Ok, I tested this, usb first instance of beagle bone works as in mainline.
>

Thanks Afzal :). You mean the non device tree boot right?

cheers,
-roger

^ permalink raw reply	[flat|nested] 101+ messages in thread

* RE: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-01 14:25           ` Roger Quadros
@ 2013-02-01 14:27             ` Mohammed, Afzal
  2013-02-01 14:31               ` Roger Quadros
  0 siblings, 1 reply; 101+ messages in thread
From: Mohammed, Afzal @ 2013-02-01 14:27 UTC (permalink / raw)
  To: Quadros, Roger
  Cc: Balbi, Felipe, tony, linux, sameo, stern, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel,
	robertcnelson

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 343 bytes --]

Hi Roger,

On Fri, Feb 01, 2013 at 19:55:14, Quadros, Roger wrote:

> Thanks Afzal :). You mean the non device tree boot right?

No, dt boot, am335x can only dt boot.

Regards
Afzal

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-01 14:27             ` Mohammed, Afzal
@ 2013-02-01 14:31               ` Roger Quadros
  2013-02-01 14:35                 ` Mohammed, Afzal
  0 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-02-01 14:31 UTC (permalink / raw)
  To: Mohammed, Afzal
  Cc: Balbi, Felipe, tony, linux, sameo, stern, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel,
	robertcnelson

On 02/01/2013 04:27 PM, Mohammed, Afzal wrote:
> Hi Roger,
> 
> On Fri, Feb 01, 2013 at 19:55:14, Quadros, Roger wrote:
> 
>> Thanks Afzal :). You mean the non device tree boot right?
> 
> No, dt boot, am335x can only dt boot.

but DT boot is not supported for OMAP USB Host. How did you get it to work?

Are you testing the Host connector or the OTG connector?

regards,
-roger


^ permalink raw reply	[flat|nested] 101+ messages in thread

* RE: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-01 14:31               ` Roger Quadros
@ 2013-02-01 14:35                 ` Mohammed, Afzal
  2013-02-01 14:58                   ` Roger Quadros
  0 siblings, 1 reply; 101+ messages in thread
From: Mohammed, Afzal @ 2013-02-01 14:35 UTC (permalink / raw)
  To: Quadros, Roger
  Cc: Balbi, Felipe, tony, linux, sameo, stern, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel,
	robertcnelson

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 544 bytes --]

Hi Roger,

On Fri, Feb 01, 2013 at 20:01:38, Quadros, Roger wrote:

> but DT boot is not supported for OMAP USB Host. How did you get it to work?
> 
> Are you testing the Host connector or the OTG connector?

If you see latest changes on musb_dsps.c, you will be able to find
out.

As beagle bone first instance works only in device, it was tested
using ether gadget.

Regards
Afzal

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-01 14:35                 ` Mohammed, Afzal
@ 2013-02-01 14:58                   ` Roger Quadros
  0 siblings, 0 replies; 101+ messages in thread
From: Roger Quadros @ 2013-02-01 14:58 UTC (permalink / raw)
  To: Mohammed, Afzal
  Cc: Balbi, Felipe, tony, linux, sameo, stern, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel,
	robertcnelson

On 02/01/2013 04:35 PM, Mohammed, Afzal wrote:
> Hi Roger,
> 
> On Fri, Feb 01, 2013 at 20:01:38, Quadros, Roger wrote:
> 
>> but DT boot is not supported for OMAP USB Host. How did you get it to work?
>>
>> Are you testing the Host connector or the OTG connector?
> 
> If you see latest changes on musb_dsps.c, you will be able to find
> out.
> 
> As beagle bone first instance works only in device, it was tested
> using ether gadget.
> 

OK, it seems that you are testing the OTG port. This patchset has nothing to do with
it. These are for getting the USB type A (the bigger) port to work. But for that to work on
beaglebone we need to wait for the DT adaptation.

cheers,
-roger

^ permalink raw reply	[flat|nested] 101+ messages in thread

* [PATCH v2 09/31] USB: ehci-omap: Use devm_ioremap_resource()
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (30 preceding siblings ...)
  2013-01-30 12:08 ` [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Mohammed, Afzal
@ 2013-02-04 14:35 ` Roger Quadros
  2013-02-04 21:11   ` Alan Stern
  2013-02-04 14:46 ` [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver Roger Quadros
  2013-02-05 11:28 ` [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-02-04 14:35 UTC (permalink / raw)
  To: stern
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

Make use of devm_ioremap_resource() and correct comment.

CC: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/host/ehci-omap.c |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 30fc482..6b088a4 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -216,23 +216,17 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 
 	res =  platform_get_resource_byname(pdev,
 				IORESOURCE_MEM, "ehci");
-	if (!res) {
-		dev_err(dev, "UHH EHCI get resource failed\n");
-		return -ENODEV;
-	}
-
-	regs = ioremap(res->start, resource_size(res));
-	if (!regs) {
-		dev_err(dev, "UHH EHCI ioremap failed\n");
-		return -ENOMEM;
+	regs = devm_ioremap_resource(dev, res);
+	if (IS_ERR(regs)) {
+		dev_err(dev, "Resource request/ioremap failed\n");
+		return PTR_ERR(regs);
 	}
 
 	hcd = usb_create_hcd(&ehci_omap_hc_driver, dev,
 			dev_name(dev));
 	if (!hcd) {
-		dev_err(dev, "failed to create hcd with err %d\n", ret);
-		ret = -ENOMEM;
-		goto err_io;
+		dev_err(dev, "Failed to create HCD\n");
+		return -ENOMEM;
 	}
 
 	hcd->rsrc_start = res->start;
@@ -285,8 +279,6 @@ err_pm_runtime:
 	pm_runtime_put_sync(dev);
 	usb_put_hcd(hcd);
 
-err_io:
-	iounmap(regs);
 	return ret;
 }
 
@@ -306,7 +298,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
 
 	usb_remove_hcd(hcd);
 	disable_put_regulator(dev->platform_data);
-	iounmap(hcd->regs);
 	usb_put_hcd(hcd);
 
 	pm_runtime_put_sync(dev);
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (31 preceding siblings ...)
  2013-02-04 14:35 ` [PATCH v2 09/31] USB: ehci-omap: Use devm_ioremap_resource() Roger Quadros
@ 2013-02-04 14:46 ` Roger Quadros
  2013-02-04 21:03   ` Alan Stern
  2013-02-05 11:28 ` [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-02-04 14:46 UTC (permalink / raw)
  To: stern
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

In PHY mode we need to have the nop-usb-xceiv transceiver
driver to operate, so select it in Kconfig.

CC: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Roger Quadros <rogerq@ti.com>
---
 drivers/usb/host/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 11e102e..2d2975d 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -157,6 +157,7 @@ config USB_EHCI_MXC
 config USB_EHCI_HCD_OMAP
 	tristate "EHCI support for OMAP3 and later chips"
 	depends on USB_EHCI_HCD && ARCH_OMAP
+	select NOP_USB_XCEIV
 	default y
 	---help---
 	  Enables support for the on-chip EHCI controller on
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 101+ messages in thread

* Re: [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver
  2013-02-04 14:46 ` [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver Roger Quadros
@ 2013-02-04 21:03   ` Alan Stern
  2013-02-05  9:41     ` Felipe Balbi
  0 siblings, 1 reply; 101+ messages in thread
From: Alan Stern @ 2013-02-04 21:03 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

On Mon, 4 Feb 2013, Roger Quadros wrote:

> In PHY mode we need to have the nop-usb-xceiv transceiver
> driver to operate, so select it in Kconfig.
> 
> CC: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> ---
>  drivers/usb/host/Kconfig |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index 11e102e..2d2975d 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -157,6 +157,7 @@ config USB_EHCI_MXC
>  config USB_EHCI_HCD_OMAP
>  	tristate "EHCI support for OMAP3 and later chips"
>  	depends on USB_EHCI_HCD && ARCH_OMAP
> +	select NOP_USB_XCEIV
>  	default y
>  	---help---
>  	  Enables support for the on-chip EHCI controller on

Acked-by: Alan Stern <stern@rowland.harvard.edu>


^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 09/31] USB: ehci-omap: Use devm_ioremap_resource()
  2013-02-04 14:35 ` [PATCH v2 09/31] USB: ehci-omap: Use devm_ioremap_resource() Roger Quadros
@ 2013-02-04 21:11   ` Alan Stern
  0 siblings, 0 replies; 101+ messages in thread
From: Alan Stern @ 2013-02-04 21:11 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, gregkh, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel

On Mon, 4 Feb 2013, Roger Quadros wrote:

> Make use of devm_ioremap_resource() and correct comment.
> 
> CC: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> ---
>  drivers/usb/host/ehci-omap.c |   21 ++++++---------------
>  1 files changed, 6 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index 30fc482..6b088a4 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -216,23 +216,17 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>  
>  	res =  platform_get_resource_byname(pdev,
>  				IORESOURCE_MEM, "ehci");
> -	if (!res) {
> -		dev_err(dev, "UHH EHCI get resource failed\n");
> -		return -ENODEV;
> -	}
> -
> -	regs = ioremap(res->start, resource_size(res));
> -	if (!regs) {
> -		dev_err(dev, "UHH EHCI ioremap failed\n");
> -		return -ENOMEM;
> +	regs = devm_ioremap_resource(dev, res);
> +	if (IS_ERR(regs)) {
> +		dev_err(dev, "Resource request/ioremap failed\n");

According to Thierry Reding, devm_ioremap_resource() provides its own 
error messages.  Hence this one isn't needed.

Apart from this one issue,

Acked-by: Alan Stern <stern@rowland.harvard.edu>


^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 01/30] USB: EHCI: split ehci-omap out to a separate driver
  2013-01-28 11:30 ` [PATCH 01/30] USB: EHCI: split ehci-omap out to a separate driver Roger Quadros
@ 2013-02-05  9:11   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:11 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 6559 bytes --]

On Mon, Jan 28, 2013 at 01:30:02PM +0200, Roger Quadros wrote:
> From: Alan Stern <stern@rowland.harvard.edu>
> 
> This patch (as1645) converts ehci-omap over to the new "ehci-hcd is a
> library" approach, so that it can coexist peacefully with other EHCI
> platform drivers and can make use of the private area allocated at
> the end of struct ehci_hcd.
> 
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>

for ehci-omap:

Acked-by: Felipe Balbi <balbi@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 3a21c5d..11e102e 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 001fbff..56de410 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -27,6 +27,7 @@ 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_MXC)	+= ehci-mxc.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 09537b2..5a35246 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -1251,11 +1251,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
> @@ -1345,6 +1340,7 @@ MODULE_LICENSE ("GPL");
>  	!IS_ENABLED(CONFIG_USB_EHCI_HCD_PLATFORM) && \
>  	!IS_ENABLED(CONFIG_USB_CHIPIDEA_HOST) && \
>  	!IS_ENABLED(CONFIG_USB_EHCI_MXC) && \
> +	!IS_ENABLED(CONFIG_USB_EHCI_HCD_OMAP) && \
>  	!defined(PLATFORM_DRIVER) && \
>  	!defined(PS3_SYSTEM_BUS_DRIVER) && \
>  	!defined(OF_PLATFORM_DRIVER) && \
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index b96a4bf..30fc482 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
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-29 15:30     ` Alan Stern
  2013-01-29 15:33       ` Roger Quadros
@ 2013-02-05  9:13       ` Felipe Balbi
  2013-02-05  9:26       ` Felipe Balbi
  2 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:13 UTC (permalink / raw)
  To: Alan Stern
  Cc: Roger Quadros, tony, linux, sameo, balbi, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 794 bytes --]

On Tue, Jan 29, 2013 at 10:30:05AM -0500, Alan Stern wrote:
> On Tue, 29 Jan 2013, Roger Quadros wrote:
> 
> > For each port that is in PHY mode we obtain a PHY device using the USB PHY
> > library and put it out of suspend.
> > 
> > It is up to platform code to associate the PHY to the controller's
> > port and it is upto the PHY driver to manage the PHY's resources.
> 
> s/upto/up to/
> 
> > Also remove wired spacing around declarations we come across.
> 
> s/wired/weird/ -- not that people care about misspellings in the 
> Changelog.  You don't have to resubmit the patch just to fix these two 
> items.
> 
> > Signed-off-by: Roger Quadros <rogerq@ti.com>
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 02/30] usb: phy: nop: use devm_kzalloc()
  2013-01-28 11:30 ` [PATCH 02/30] usb: phy: nop: use devm_kzalloc() Roger Quadros
@ 2013-02-05  9:14   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:14 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1939 bytes --]

On Mon, Jan 28, 2013 at 01:30:03PM +0200, Roger Quadros wrote:
> Use resource managed kzalloc.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> ---

Acked-by: Felipe Balbi <balbi@ti.com>

>  drivers/usb/otg/nop-usb-xceiv.c |   16 ++++------------
>  1 files changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
> index a3ce24b..7ffb0c8 100644
> --- a/drivers/usb/otg/nop-usb-xceiv.c
> +++ b/drivers/usb/otg/nop-usb-xceiv.c
> @@ -100,15 +100,13 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
>  	enum usb_phy_type	type = USB_PHY_TYPE_USB2;
>  	int err;
>  
> -	nop = kzalloc(sizeof *nop, GFP_KERNEL);
> +	nop = devm_kzalloc(&pdev->dev, sizeof *nop, GFP_KERNEL);
>  	if (!nop)
>  		return -ENOMEM;
>  
> -	nop->phy.otg = kzalloc(sizeof *nop->phy.otg, GFP_KERNEL);
> -	if (!nop->phy.otg) {
> -		kfree(nop);
> +	nop->phy.otg = devm_kzalloc(&pdev->dev, sizeof *nop->phy.otg, GFP_KERNEL);
> +	if (!nop->phy.otg)
>  		return -ENOMEM;
> -	}
>  
>  	if (pdata)
>  		type = pdata->type;
> @@ -127,7 +125,7 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
>  	if (err) {
>  		dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
>  			err);
> -		goto exit;
> +		return err;
>  	}
>  
>  	platform_set_drvdata(pdev, nop);
> @@ -135,10 +133,6 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
>  	ATOMIC_INIT_NOTIFIER_HEAD(&nop->phy.notifier);
>  
>  	return 0;
> -exit:
> -	kfree(nop->phy.otg);
> -	kfree(nop);
> -	return err;
>  }
>  
>  static int nop_usb_xceiv_remove(struct platform_device *pdev)
> @@ -148,8 +142,6 @@ static int nop_usb_xceiv_remove(struct platform_device *pdev)
>  	usb_remove_phy(&nop->phy);
>  
>  	platform_set_drvdata(pdev, NULL);
> -	kfree(nop->phy.otg);
> -	kfree(nop);
>  
>  	return 0;
>  }
> -- 
> 1.7.4.1
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 03/30] usb: phy: nop: Manage PHY clock
  2013-01-28 11:30 ` [PATCH v2 03/30] usb: phy: nop: Manage PHY clock Roger Quadros
@ 2013-02-05  9:17   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:17 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 4005 bytes --]

Hi,

On Mon, Jan 28, 2013 at 01:30:04PM +0200, Roger Quadros wrote:
> If the PHY has a clock associated to it then manage the clock.
> We just enable the clock in .init() and disable it in .shutdown().
> 
> Add clk_rate parameter in platform data and configure the
> clock rate during probe if supplied.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/usb/otg/nop-usb-xceiv.c   |   54 ++++++++++++++++++++++++++++++++++++-
>  include/linux/usb/nop-usb-xceiv.h |    1 +
>  2 files changed, 54 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
> index 7ffb0c8..849eb9d 100644
> --- a/drivers/usb/otg/nop-usb-xceiv.c
> +++ b/drivers/usb/otg/nop-usb-xceiv.c
> @@ -32,10 +32,12 @@
>  #include <linux/usb/otg.h>
>  #include <linux/usb/nop-usb-xceiv.h>
>  #include <linux/slab.h>
> +#include <linux/clk.h>
>  
>  struct nop_usb_xceiv {
>  	struct usb_phy		phy;
>  	struct device		*dev;
> +	struct clk		*clk;
>  };
>  
>  static struct platform_device *pd;
> @@ -64,6 +66,24 @@ static int nop_set_suspend(struct usb_phy *x, int suspend)
>  	return 0;
>  }
>  
> +static int nop_init(struct usb_phy *phy)
> +{
> +	struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev);
> +
> +	if (!IS_ERR(nop->clk))
> +		clk_enable(nop->clk);
> +
> +	return 0;
> +}
> +
> +static void nop_shutdown(struct usb_phy *phy)
> +{
> +	struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev);
> +
> +	if (!IS_ERR(nop->clk))
> +		clk_disable(nop->clk);
> +}
> +
>  static int nop_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget)
>  {
>  	if (!otg)
> @@ -111,10 +131,34 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
>  	if (pdata)
>  		type = pdata->type;
>  
> +	nop->clk = devm_clk_get(&pdev->dev, "main_clk");
> +	if (IS_ERR(nop->clk)) {
> +		dev_dbg(&pdev->dev, "Can't get phy clock: %ld\n",
> +					PTR_ERR(nop->clk));
> +	}
> +
> +	if (!IS_ERR(nop->clk) && pdata && pdata->clk_rate) {
> +		err = clk_set_rate(nop->clk, pdata->clk_rate);
> +		if (err) {
> +			dev_err(&pdev->dev, "Error setting clock rate\n");
> +			return err;
> +		}
> +	}
> +
> +	if (!IS_ERR(nop->clk)) {
> +		err = clk_prepare(nop->clk);
> +		if (err) {
> +			dev_err(&pdev->dev, "Error preparing clock\n");
> +			return err;
> +		}
> +	}
> +
>  	nop->dev		= &pdev->dev;
>  	nop->phy.dev		= nop->dev;
>  	nop->phy.label		= "nop-xceiv";
>  	nop->phy.set_suspend	= nop_set_suspend;
> +	nop->phy.init		= nop_init;
> +	nop->phy.shutdown	= nop_shutdown;
>  	nop->phy.state		= OTG_STATE_UNDEFINED;
>  
>  	nop->phy.otg->phy		= &nop->phy;
> @@ -125,7 +169,7 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
>  	if (err) {
>  		dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
>  			err);
> -		return err;
> +		goto err_add;
>  	}
>  
>  	platform_set_drvdata(pdev, nop);
> @@ -133,12 +177,20 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
>  	ATOMIC_INIT_NOTIFIER_HEAD(&nop->phy.notifier);
>  
>  	return 0;
> +
> +err_add:
> +	if (!IS_ERR(nop->clk))
> +		clk_unprepare(nop->clk);
> +	return err;
>  }
>  
>  static int nop_usb_xceiv_remove(struct platform_device *pdev)
>  {
>  	struct nop_usb_xceiv *nop = platform_get_drvdata(pdev);
>  
> +	if (!IS_ERR(nop->clk))
> +		clk_unprepare(nop->clk);
> +
>  	usb_remove_phy(&nop->phy);
>  
>  	platform_set_drvdata(pdev, NULL);
> diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/nop-usb-xceiv.h
> index 28884c7..3265b61 100644
> --- a/include/linux/usb/nop-usb-xceiv.h
> +++ b/include/linux/usb/nop-usb-xceiv.h
> @@ -5,6 +5,7 @@
>  
>  struct nop_usb_xceiv_platform_data {
>  	enum usb_phy_type type;
> +	unsigned long clk_rate;
>  };
>  
>  #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE))
> -- 
> 1.7.4.1
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 04/30] usb: phy: nop: Handle power supply regulator for the PHY
  2013-01-28 11:30 ` [PATCH v2 04/30] usb: phy: nop: Handle power supply regulator for the PHY Roger Quadros
@ 2013-02-05  9:20   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:20 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2093 bytes --]

On Mon, Jan 28, 2013 at 01:30:05PM +0200, Roger Quadros wrote:
> We use "vcc" as the supply name for the PHY's power supply.
> The power supply will be enabled during .init() and disabled
> during .shutdown()
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/usb/otg/nop-usb-xceiv.c |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
> index 849eb9d..0a9628c 100644
> --- a/drivers/usb/otg/nop-usb-xceiv.c
> +++ b/drivers/usb/otg/nop-usb-xceiv.c
> @@ -33,11 +33,13 @@
>  #include <linux/usb/nop-usb-xceiv.h>
>  #include <linux/slab.h>
>  #include <linux/clk.h>
> +#include <linux/regulator/consumer.h>
>  
>  struct nop_usb_xceiv {
>  	struct usb_phy		phy;
>  	struct device		*dev;
>  	struct clk		*clk;
> +	struct regulator	*vcc;
>  };
>  
>  static struct platform_device *pd;
> @@ -70,6 +72,11 @@ static int nop_init(struct usb_phy *phy)
>  {
>  	struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev);
>  
> +	if (!IS_ERR(nop->vcc)) {
> +		if (regulator_enable(nop->vcc))
> +			dev_err(phy->dev, "Failed to enable power\n");
> +	}
> +
>  	if (!IS_ERR(nop->clk))
>  		clk_enable(nop->clk);
>  
> @@ -82,6 +89,11 @@ static void nop_shutdown(struct usb_phy *phy)
>  
>  	if (!IS_ERR(nop->clk))
>  		clk_disable(nop->clk);
> +
> +	if (!IS_ERR(nop->vcc)) {
> +		if (regulator_disable(nop->vcc))
> +			dev_err(phy->dev, "Failed to disable power\n");
> +	}
>  }
>  
>  static int nop_set_peripheral(struct usb_otg *otg, struct usb_gadget *gadget)
> @@ -153,6 +165,12 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> +	nop->vcc = devm_regulator_get(&pdev->dev, "vcc");
> +	if (IS_ERR(nop->vcc)) {
> +		dev_dbg(&pdev->dev, "Error getting vcc regulator: %ld\n",
> +					PTR_ERR(nop->vcc));
> +	}
> +
>  	nop->dev		= &pdev->dev;
>  	nop->phy.dev		= nop->dev;
>  	nop->phy.label		= "nop-xceiv";
> -- 
> 1.7.4.1
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 05/30] usb: phy: nop: Handle RESET for the PHY
  2013-01-28 11:30 ` [PATCH v2 05/30] usb: phy: nop: Handle RESET " Roger Quadros
@ 2013-02-05  9:22   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:22 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2167 bytes --]

On Mon, Jan 28, 2013 at 01:30:06PM +0200, Roger Quadros wrote:
> We expect the RESET line to be modeled as a regulator with supply
> name "reset". The regulator should be modeled such that enabling
> the regulator brings the PHY device out of RESET and disabling the
> regulator holds the device in RESET.
> 
> They PHY will be held in RESET in .shutdown() and brought out of
> RESET in .init().
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/usb/otg/nop-usb-xceiv.c |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
> index 0a9628c..3060ed0 100644
> --- a/drivers/usb/otg/nop-usb-xceiv.c
> +++ b/drivers/usb/otg/nop-usb-xceiv.c
> @@ -40,6 +40,7 @@ struct nop_usb_xceiv {
>  	struct device		*dev;
>  	struct clk		*clk;
>  	struct regulator	*vcc;
> +	struct regulator	*reset;
>  };
>  
>  static struct platform_device *pd;
> @@ -80,6 +81,12 @@ static int nop_init(struct usb_phy *phy)
>  	if (!IS_ERR(nop->clk))
>  		clk_enable(nop->clk);
>  
> +	if (!IS_ERR(nop->reset)) {
> +		/* De-assert RESET */
> +		if (regulator_enable(nop->reset))
> +			dev_err(phy->dev, "Failed to de-assert reset\n");
> +	}
> +
>  	return 0;
>  }
>  
> @@ -87,6 +94,12 @@ static void nop_shutdown(struct usb_phy *phy)
>  {
>  	struct nop_usb_xceiv *nop = dev_get_drvdata(phy->dev);
>  
> +	if (!IS_ERR(nop->reset)) {
> +		/* Assert RESET */
> +		if (regulator_disable(nop->reset))
> +			dev_err(phy->dev, "Failed to assert reset\n");
> +	}
> +
>  	if (!IS_ERR(nop->clk))
>  		clk_disable(nop->clk);
>  
> @@ -171,6 +184,12 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
>  					PTR_ERR(nop->vcc));
>  	}
>  
> +	nop->reset = devm_regulator_get(&pdev->dev, "reset");
> +	if (IS_ERR(nop->reset)) {
> +		dev_dbg(&pdev->dev, "Error getting reset regulator: %ld\n",
> +					PTR_ERR(nop->reset));
> +	}
> +
>  	nop->dev		= &pdev->dev;
>  	nop->phy.dev		= nop->dev;
>  	nop->phy.label		= "nop-xceiv";
> -- 
> 1.7.4.1
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 06/30] usb: phy: nop: use new PHY API to register PHY
  2013-01-28 11:30 ` [PATCH 06/30] usb: phy: nop: use new PHY API to register PHY Roger Quadros
@ 2013-02-05  9:23   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:23 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1180 bytes --]

On Mon, Jan 28, 2013 at 01:30:07PM +0200, Roger Quadros wrote:
> We would need to support multiple PHYs of the same type
> so use the new PHY API usb_add_phy_dev() to register the PHY.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/usb/otg/nop-usb-xceiv.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c
> index 3060ed0..ac027a1 100644
> --- a/drivers/usb/otg/nop-usb-xceiv.c
> +++ b/drivers/usb/otg/nop-usb-xceiv.c
> @@ -197,12 +197,13 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)
>  	nop->phy.init		= nop_init;
>  	nop->phy.shutdown	= nop_shutdown;
>  	nop->phy.state		= OTG_STATE_UNDEFINED;
> +	nop->phy.type		= type;
>  
>  	nop->phy.otg->phy		= &nop->phy;
>  	nop->phy.otg->set_host		= nop_set_host;
>  	nop->phy.otg->set_peripheral	= nop_set_peripheral;
>  
> -	err = usb_add_phy(&nop->phy, type);
> +	err = usb_add_phy_dev(&nop->phy);
>  	if (err) {
>  		dev_err(&pdev->dev, "can't register transceiver, err: %d\n",
>  			err);
> -- 
> 1.7.4.1
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 07/30] mfd: omap-usb-host: update nports in platform_data
  2013-01-28 11:30 ` [PATCH 07/30] mfd: omap-usb-host: update nports in platform_data Roger Quadros
@ 2013-02-05  9:24   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:24 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

On Mon, Jan 28, 2013 at 01:30:08PM +0200, Roger Quadros wrote:
> EHCI driver would need to know the number of ports available
> on the platform. We set the nports parameter of platform_data
> based on IP version if it was not already provided.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/mfd/omap-usb-host.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> index 6b5edf6..0874352 100644
> --- a/drivers/mfd/omap-usb-host.c
> +++ b/drivers/mfd/omap-usb-host.c
> @@ -575,6 +575,7 @@ static int usbhs_omap_probe(struct platform_device *pdev)
>  			 omap->usbhs_rev, omap->nports);
>  			break;
>  		}
> +		pdata->nports = omap->nports;
>  	}
>  
>  	i = sizeof(struct clk *) * omap->nports;
> -- 
> 1.7.4.1
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 08/30] mfd: omap-usb-host: Remove PHY reset handling code
  2013-01-28 11:30 ` [PATCH 08/30] mfd: omap-usb-host: Remove PHY reset handling code Roger Quadros
@ 2013-02-05  9:25   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:25 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 3201 bytes --]

On Mon, Jan 28, 2013 at 01:30:09PM +0200, Roger Quadros wrote:
> PHY reset GPIO handling will be done in the PHY driver
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>
> Acked-by: Samuel Ortiz <sameo@linux.intel.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/mfd/omap-usb-host.c |   47 -------------------------------------------
>  1 files changed, 0 insertions(+), 47 deletions(-)
> 
> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> index 0874352..502a779 100644
> --- a/drivers/mfd/omap-usb-host.c
> +++ b/drivers/mfd/omap-usb-host.c
> @@ -430,24 +430,10 @@ static unsigned omap_usbhs_rev2_hostconfig(struct usbhs_hcd_omap *omap,
>  static void omap_usbhs_init(struct device *dev)
>  {
>  	struct usbhs_hcd_omap		*omap = dev_get_drvdata(dev);
> -	struct usbhs_omap_platform_data	*pdata = omap->pdata;
>  	unsigned			reg;
>  
>  	dev_dbg(dev, "starting TI HSUSB Controller\n");
>  
> -	if (pdata->phy_reset) {
> -		if (gpio_is_valid(pdata->reset_gpio_port[0]))
> -			gpio_request_one(pdata->reset_gpio_port[0],
> -					 GPIOF_OUT_INIT_LOW, "USB1 PHY reset");
> -
> -		if (gpio_is_valid(pdata->reset_gpio_port[1]))
> -			gpio_request_one(pdata->reset_gpio_port[1],
> -					 GPIOF_OUT_INIT_LOW, "USB2 PHY reset");
> -
> -		/* Hold the PHY in RESET for enough time till DIR is high */
> -		udelay(10);
> -	}
> -
>  	pm_runtime_get_sync(dev);
>  
>  	reg = usbhs_read(omap->uhh_base, OMAP_UHH_HOSTCONFIG);
> @@ -476,37 +462,8 @@ static void omap_usbhs_init(struct device *dev)
>  	dev_dbg(dev, "UHH setup done, uhh_hostconfig=%x\n", reg);
>  
>  	pm_runtime_put_sync(dev);
> -	if (pdata->phy_reset) {
> -		/* Hold the PHY in RESET for enough time till
> -		 * PHY is settled and ready
> -		 */
> -		udelay(10);
> -
> -		if (gpio_is_valid(pdata->reset_gpio_port[0]))
> -			gpio_set_value_cansleep
> -				(pdata->reset_gpio_port[0], 1);
> -
> -		if (gpio_is_valid(pdata->reset_gpio_port[1]))
> -			gpio_set_value_cansleep
> -				(pdata->reset_gpio_port[1], 1);
> -	}
> -}
> -
> -static void omap_usbhs_deinit(struct device *dev)
> -{
> -	struct usbhs_hcd_omap		*omap = dev_get_drvdata(dev);
> -	struct usbhs_omap_platform_data	*pdata = omap->pdata;
> -
> -	if (pdata->phy_reset) {
> -		if (gpio_is_valid(pdata->reset_gpio_port[0]))
> -			gpio_free(pdata->reset_gpio_port[0]);
> -
> -		if (gpio_is_valid(pdata->reset_gpio_port[1]))
> -			gpio_free(pdata->reset_gpio_port[1]);
> -	}
>  }
>  
> -
>  /**
>   * usbhs_omap_probe - initialize TI-based HCDs
>   *
> @@ -710,8 +667,6 @@ static int usbhs_omap_probe(struct platform_device *pdev)
>  	return 0;
>  
>  err_alloc:
> -	omap_usbhs_deinit(&pdev->dev);
> -
>  	for (i = 0; i < omap->nports; i++) {
>  		if (!IS_ERR(omap->utmi_clk[i]))
>  			clk_put(omap->utmi_clk[i]);
> @@ -756,8 +711,6 @@ static int usbhs_omap_remove(struct platform_device *pdev)
>  	struct usbhs_hcd_omap *omap = platform_get_drvdata(pdev);
>  	int i;
>  
> -	omap_usbhs_deinit(&pdev->dev);
> -
>  	for (i = 0; i < omap->nports; i++) {
>  		if (!IS_ERR(omap->utmi_clk[i]))
>  			clk_put(omap->utmi_clk[i]);
> -- 
> 1.7.4.1
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()
  2013-01-28 11:30 ` [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap() Roger Quadros
  2013-01-28 15:17   ` Alan Stern
@ 2013-02-05  9:25   ` Felipe Balbi
  1 sibling, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:25 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1850 bytes --]

On Mon, Jan 28, 2013 at 01:30:10PM +0200, Roger Quadros wrote:
> Make use of devm_request_and_ioremap() and correct comment.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/usb/host/ehci-omap.c |   19 +++++--------------
>  1 files changed, 5 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
> index 30fc482..fd2f5450 100644
> --- a/drivers/usb/host/ehci-omap.c
> +++ b/drivers/usb/host/ehci-omap.c
> @@ -216,23 +216,17 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
>  
>  	res =  platform_get_resource_byname(pdev,
>  				IORESOURCE_MEM, "ehci");
> -	if (!res) {
> -		dev_err(dev, "UHH EHCI get resource failed\n");
> -		return -ENODEV;
> -	}
> -
> -	regs = ioremap(res->start, resource_size(res));
> +	regs = devm_request_and_ioremap(dev, res);
>  	if (!regs) {
> -		dev_err(dev, "UHH EHCI ioremap failed\n");
> -		return -ENOMEM;
> +		dev_err(dev, "Resource request/ioremap failed\n");
> +		return -EADDRNOTAVAIL;
>  	}
>  
>  	hcd = usb_create_hcd(&ehci_omap_hc_driver, dev,
>  			dev_name(dev));
>  	if (!hcd) {
> -		dev_err(dev, "failed to create hcd with err %d\n", ret);
> -		ret = -ENOMEM;
> -		goto err_io;
> +		dev_err(dev, "Failed to create HCD\n");
> +		return -ENOMEM;
>  	}
>  
>  	hcd->rsrc_start = res->start;
> @@ -285,8 +279,6 @@ err_pm_runtime:
>  	pm_runtime_put_sync(dev);
>  	usb_put_hcd(hcd);
>  
> -err_io:
> -	iounmap(regs);
>  	return ret;
>  }
>  
> @@ -306,7 +298,6 @@ static int ehci_hcd_omap_remove(struct platform_device *pdev)
>  
>  	usb_remove_hcd(hcd);
>  	disable_put_regulator(dev->platform_data);
> -	iounmap(hcd->regs);
>  	usb_put_hcd(hcd);
>  
>  	pm_runtime_put_sync(dev);
> -- 
> 1.7.4.1
> 

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend
  2013-01-29 15:30     ` Alan Stern
  2013-01-29 15:33       ` Roger Quadros
  2013-02-05  9:13       ` Felipe Balbi
@ 2013-02-05  9:26       ` Felipe Balbi
  2 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:26 UTC (permalink / raw)
  To: Alan Stern
  Cc: Roger Quadros, tony, linux, sameo, balbi, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 794 bytes --]

On Tue, Jan 29, 2013 at 10:30:05AM -0500, Alan Stern wrote:
> On Tue, 29 Jan 2013, Roger Quadros wrote:
> 
> > For each port that is in PHY mode we obtain a PHY device using the USB PHY
> > library and put it out of suspend.
> > 
> > It is up to platform code to associate the PHY to the controller's
> > port and it is upto the PHY driver to manage the PHY's resources.
> 
> s/upto/up to/
> 
> > Also remove wired spacing around declarations we come across.
> 
> s/wired/weird/ -- not that people care about misspellings in the 
> Changelog.  You don't have to resubmit the patch just to fix these two 
> items.
> 
> > Signed-off-by: Roger Quadros <rogerq@ti.com>
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 11/30] usb: ehci-omap: Remove PHY reset handling code
  2013-01-28 17:34   ` Alan Stern
@ 2013-02-05  9:27     ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:27 UTC (permalink / raw)
  To: Alan Stern
  Cc: Roger Quadros, tony, linux, sameo, balbi, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

On Mon, Jan 28, 2013 at 12:34:16PM -0500, Alan Stern wrote:
> On Mon, 28 Jan 2013, Roger Quadros wrote:
> 
> > Reset GPIO handling for the PHY must be done in the PHY
> > driver. We use the PHY helpers instead to reset the PHY.
> > 
> > Signed-off-by: Roger Quadros <rogerq@ti.com>
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 12/30] usb: ehci-omap: Remove PHY regulator handling code
  2013-01-28 17:35   ` Alan Stern
@ 2013-02-05  9:27     ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:27 UTC (permalink / raw)
  To: Alan Stern
  Cc: Roger Quadros, tony, linux, sameo, balbi, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]

On Mon, Jan 28, 2013 at 12:35:25PM -0500, Alan Stern wrote:
> On Mon, 28 Jan 2013, Roger Quadros wrote:
> 
> > PHY regulator handling must be done in the PHY driver
> > 
> > Signed-off-by: Roger Quadros <rogerq@ti.com>
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 13/30] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data
  2013-01-28 11:30 ` [PATCH v2 13/30] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data Roger Quadros
@ 2013-02-05  9:28   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:28 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

On Mon, Jan 28, 2013 at 01:30:14PM +0200, Roger Quadros wrote:
> Add platform device and data for 'nop-usb-xceiv'. This will be used
> as PHY for HS USB port 1, so provide binding information for it.
> 
> Get rid of managing the PHY clock as it will be done by the PHY driver.
> For that to work we create a clock alias that links the PHY clock name
> to the PHY device name.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 14/30] ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH v2 14/30] ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes Roger Quadros
@ 2013-02-05  9:31   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:31 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

On Mon, Jan 28, 2013 at 01:30:15PM +0200, Roger Quadros wrote:
> Model RESET and Power for HS USB Port 1 as GPIO fixed regulators
> and link them to the 'nop-usb-xceiv' PHY by making them as "reset"
> and "vcc" supplies.
> 
> The RESET and Power will then be managed by the PHY driver.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 15/30] ARM: OMAP3: Beagle: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 15/30] ARM: OMAP3: Beagle: " Roger Quadros
@ 2013-02-05  9:31   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:31 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

On Mon, Jan 28, 2013 at 01:30:16PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET and Power for HS USB Port 2 as GPIO fixed regulators
> and link them to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 16/30] ARM: OMAP3: 3430SDP: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 16/30] ARM: OMAP3: 3430SDP: " Roger Quadros
@ 2013-02-05  9:31   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:31 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

On Mon, Jan 28, 2013 at 01:30:17PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used
> as PHYs for HS USB ports 1 and 2 so provide binding information
> for them.
> 
> Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
> link them to the 2 PHYs we just created.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 17/30] ARM: OMAP3: 3630SDP: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 17/30] ARM: OMAP3: 3630SDP: " Roger Quadros
@ 2013-02-05  9:31   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:31 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

On Mon, Jan 28, 2013 at 01:30:18PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used
> as PHYs for HS USB ports 1 and 2 so provide binding information
> for them.
> 
> Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
> link them to the 2 PHYs we just created.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 18/30] ARM: OMAP: AM3517crane: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 18/30] ARM: OMAP: AM3517crane: " Roger Quadros
@ 2013-02-05  9:32   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:32 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

On Mon, Jan 28, 2013 at 01:30:19PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 1, so provide binding information for it.
> 
> Model RESET and Power for HS USB Port 1 as GPIO fixed regulators
> and link them to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 19/30] ARM: OMAP: AM3517evm: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 19/30] ARM: OMAP: AM3517evm: " Roger Quadros
@ 2013-02-05  9:32   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:32 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

On Mon, Jan 28, 2013 at 01:30:20PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used as a
> PHY for HS USB Port 1 and 2, so provide binding information for them.
> 
> Model RESET for HS USB Port 1 as GPIO fixed regulator and link it
> to the 'nop-usb-xceiv' PHY on port 1.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 20/30] ARM: OMAP3: cm-t35: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 20/30] ARM: OMAP3: cm-t35: " Roger Quadros
@ 2013-02-05  9:32   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:32 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

On Mon, Jan 28, 2013 at 01:30:21PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used
> as PHYs for HS USB ports 1 and 2 so provide binding information
> for them.
> 
> Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
> link them to the 2 PHYs we just created.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 21/30] ARM: OMAP3: cm-t3517: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 21/30] ARM: OMAP3: cm-t3517: " Roger Quadros
@ 2013-02-05  9:32   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:32 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

On Mon, Jan 28, 2013 at 01:30:22PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used
> as PHYs for HS USB ports 1 and 2 so provide binding information
> for them.
> 
> Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
> link them to the 2 PHYs we just created.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 22/30] ARM: OMAP: devkit8000: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 22/30] ARM: OMAP: devkit8000: " Roger Quadros
@ 2013-02-05  9:33   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:33 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]

On Mon, Jan 28, 2013 at 01:30:23PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 1, so provide binding information for it.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 23/30] ARM: OMAP3: igep0020: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 23/30] ARM: OMAP3: igep0020: " Roger Quadros
@ 2013-02-05  9:33   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:33 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 434 bytes --]

On Mon, Jan 28, 2013 at 01:30:24PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used
> as PHYs for HS USB ports 1 and 2 so provide binding information
> for them.
> 
> Model RESET for HS USB Ports 1 and 2 as GPIO fixed regulators and
> link them to the 2 PHYs we just created.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 24/30] ARM: OMAP3: omap3evm: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 24/30] ARM: OMAP3: omap3evm: " Roger Quadros
@ 2013-02-05  9:33   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:33 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

On Mon, Jan 28, 2013 at 01:30:25PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link
> it to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 25/30] ARM: OMAP3: omap3pandora: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 25/30] ARM: OMAP3: omap3pandora: " Roger Quadros
@ 2013-02-05  9:33   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:33 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

On Mon, Jan 28, 2013 at 01:30:26PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link
> it to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 26/30] ARM: OMAP3: omap3stalker: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 26/30] ARM: OMAP3: omap3stalker: " Roger Quadros
@ 2013-02-05  9:34   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:34 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

On Mon, Jan 28, 2013 at 01:30:27PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link
> it to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 27/30] ARM: OMAP3: omap3touchbook: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 27/30] ARM: OMAP3: omap3touchbook: " Roger Quadros
@ 2013-02-05  9:34   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:34 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

On Mon, Jan 28, 2013 at 01:30:28PM +0200, Roger Quadros wrote:
> Add 2 platform devices for 'nop-usb-xceiv'. These will be used as a
> PHY for HS USB Ports 1 and 2, so provide binding information for them.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link it
> to the respective 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 28/30] ARM: OMAP3: overo: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 28/30] ARM: OMAP3: overo: " Roger Quadros
@ 2013-02-05  9:40   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:40 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

On Mon, Jan 28, 2013 at 01:30:29PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link
> it to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 29/30] ARM: OMAP: zoom: Adapt to ehci-omap changes
  2013-01-28 11:30 ` [PATCH 29/30] ARM: OMAP: zoom: " Roger Quadros
@ 2013-02-05  9:40   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:40 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]

On Mon, Jan 28, 2013 at 01:30:30PM +0200, Roger Quadros wrote:
> Add platform device for 'nop-usb-xceiv'. This will be used as a
> PHY for HS USB Port 2, so provide binding information for it.
> 
> Model RESET for HS USB Port 2 as GPIO fixed regulator and link
> it to the 'nop-usb-xceiv' PHY.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 30/30] ARM: OMAP: USB: Remove unused fields from struct usbhs_omap_platform_data
  2013-01-28 11:30 ` [PATCH 30/30] ARM: OMAP: USB: Remove unused fields from struct usbhs_omap_platform_data Roger Quadros
@ 2013-02-05  9:40   ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:40 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, gregkh, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

On Mon, Jan 28, 2013 at 01:30:31PM +0200, Roger Quadros wrote:
> All users have been adapted to the changes in ehci-omap. We can now
> get rid of the unused fields from usbhs_omap_platform_data.
> 
> Signed-off-by: Roger Quadros <rogerq@ti.com>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver
  2013-02-04 21:03   ` Alan Stern
@ 2013-02-05  9:41     ` Felipe Balbi
  0 siblings, 0 replies; 101+ messages in thread
From: Felipe Balbi @ 2013-02-05  9:41 UTC (permalink / raw)
  To: Alan Stern
  Cc: Roger Quadros, tony, linux, sameo, balbi, gregkh, eballetbo,
	javier, sshtylyov, linux-usb, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

On Mon, Feb 04, 2013 at 04:03:10PM -0500, Alan Stern wrote:
> On Mon, 4 Feb 2013, Roger Quadros wrote:
> 
> > In PHY mode we need to have the nop-usb-xceiv transceiver
> > driver to operate, so select it in Kconfig.
> > 
> > CC: Alan Stern <stern@rowland.harvard.edu>
> > Signed-off-by: Roger Quadros <rogerq@ti.com>
> > ---
> >  drivers/usb/host/Kconfig |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> > index 11e102e..2d2975d 100644
> > --- a/drivers/usb/host/Kconfig
> > +++ b/drivers/usb/host/Kconfig
> > @@ -157,6 +157,7 @@ config USB_EHCI_MXC
> >  config USB_EHCI_HCD_OMAP
> >  	tristate "EHCI support for OMAP3 and later chips"
> >  	depends on USB_EHCI_HCD && ARCH_OMAP
> > +	select NOP_USB_XCEIV
> >  	default y
> >  	---help---
> >  	  Enables support for the on-chip EHCI controller on
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>

Acked-by: Felipe Balbi <balbi@ti.com>

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
                   ` (32 preceding siblings ...)
  2013-02-04 14:46 ` [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver Roger Quadros
@ 2013-02-05 11:28 ` Roger Quadros
  2013-02-05 16:58   ` Greg KH
  33 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-02-05 11:28 UTC (permalink / raw)
  To: tony, gregkh
  Cc: Roger Quadros, linux, sameo, balbi, stern, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel, ABRAHAM,
	KISHON VIJAY

Hi Tony & Greg,

What's the best way to get these patches in?

All patches have been acked by respective maintainers.

If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a
pull request directly to Greg? or the other way round?

Tony, 
fyi, these patches should not interfere with the dw3c/musb stuff
sent by Felipe & Kishon.

cheers,
-roger

On 01/28/2013 01:30 PM, Roger Quadros wrote:
> Hi,
> 
> The OMAP's High Speed Host controller can interface to ULPI/UTMI
> PHYs transparently i.e. whithout requiring the device drivers to
> access the PHY. However, the OS must ensure that the PHY has the necessary
> resources (power/clock/reset) enabled before it is used.
> 
> Till now, the omap-ehci driver was managing the power and reset of the PHY
> whereas, clock enabling was left to the bootloader or board files.
> 
> In this patchset we make the NOP PHY driver (nop-usb-xceiv.c) handle
> all the PHY resources that are available so that it can be used by
> platforms like OMAP.
> 
> The board files add the PHY as a platform device and use usb_bind_phy()
> (API introduced in [2]) to bind the PHY device to the controller's port.
> The ehci-omap driver then uses usb_get_phy_dev() to get the PHY device
> associated to the controller's port.
> 
> All this results in a much cleaner code and makes USB PHY resource management
> work properly on OMAP.
> 
> NOTE: Tested on 4460ES-B1 Panda and BeagleBoard C4 only. Other boards are only
> build tested.
> 
> Patches are based on Linux-3.8-rc5 and depend on
> 
> [1] [PATCH v9 00/20] OMAP USB Host cleanup
> https://lkml.org/lkml/2013/1/23/155
> 
> [2] [PATCH v2 0/6] USB: Add support for multiple PHYs of same type
> https://lkml.org/lkml/2013/1/24/876
> 
> v2:
> - Added Alan's patch to split ehci-omap into separate driver
> - Addressed Russell King's comments on usage of clk/regulator framework.
> - Adapted all board using ehci-omap to using the PHY mechanism.
> 
> The following changes since commit e18d48b7f7e563664a41d4658b8cc15679ee4745:
> 
>   usb: otg: utils: add facilities in phy lib to support multiple PHYs of same type (2013-01-28 12:20:54 +0200)
> 
>   git://github.com/rogerq/linux.git linux-usbhost15
> 
> ---
> Alan Stern (1):
>   USB: EHCI: split ehci-omap out to a separate driver
> 
> Roger Quadros (29):
>   usb: phy: nop: use devm_kzalloc()
>   usb: phy: nop: Manage PHY clock
>   usb: phy: nop: Handle power supply regulator for the PHY
>   usb: phy: nop: Handle RESET for the PHY
>   usb: phy: nop: use new PHY API to register PHY
>   mfd: omap-usb-host: update nports in platform_data
>   mfd: omap-usb-host: Remove PHY reset handling code
>   USB: ehci-omap: Use devm_request_and_ioremap()
>   USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of
>     suspend
>   usb: ehci-omap: Remove PHY reset handling code
>   usb: ehci-omap: Remove PHY regulator handling code
>   ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data
>   ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes
>   ARM: OMAP3: Beagle: Adapt to ehci-omap changes
>   ARM: OMAP3: 3430SDP: Adapt to ehci-omap changes
>   ARM: OMAP3: 3630SDP: Adapt to ehci-omap changes
>   ARM: OMAP: AM3517crane: Adapt to ehci-omap changes
>   ARM: OMAP: AM3517evm: Adapt to ehci-omap changes
>   ARM: OMAP3: cm-t35: Adapt to ehci-omap changes
>   ARM: OMAP3: cm-t3517: Adapt to ehci-omap changes
>   ARM: OMAP: devkit8000: Adapt to ehci-omap changes
>   ARM: OMAP3: igep0020: Adapt to ehci-omap changes
>   ARM: OMAP3: omap3evm: Adapt to ehci-omap changes
>   ARM: OMAP3: omap3pandora: Adapt to ehci-omap changes
>   ARM: OMAP3: omap3stalker: Adapt to ehci-omap changes
>   ARM: OMAP3: omap3touchbook: Adapt to ehci-omap changes
>   ARM: OMAP3: overo: Adapt to ehci-omap changes
>   ARM: OMAP: zoom: Adapt to ehci-omap changes
>   ARM: OMAP: USB: Remove unused fields from struct
>     usbhs_omap_platform_data
> 
>  arch/arm/mach-omap2/board-3430sdp.c        |   99 +++++++++++-
>  arch/arm/mach-omap2/board-3630sdp.c        |  100 +++++++++++-
>  arch/arm/mach-omap2/board-am3517crane.c    |   95 ++++++++++--
>  arch/arm/mach-omap2/board-am3517evm.c      |   66 +++++++-
>  arch/arm/mach-omap2/board-cm-t35.c         |   95 ++++++++++-
>  arch/arm/mach-omap2/board-cm-t3517.c       |   97 +++++++++++-
>  arch/arm/mach-omap2/board-devkit8000.c     |   20 ++-
>  arch/arm/mach-omap2/board-igep0020.c       |  112 +++++++++++--
>  arch/arm/mach-omap2/board-omap3beagle.c    |   93 ++++++++++-
>  arch/arm/mach-omap2/board-omap3evm.c       |   63 ++++++--
>  arch/arm/mach-omap2/board-omap3pandora.c   |   54 +++++-
>  arch/arm/mach-omap2/board-omap3stalker.c   |   52 +++++-
>  arch/arm/mach-omap2/board-omap3touchbook.c |   62 ++++++-
>  arch/arm/mach-omap2/board-omap4panda.c     |  123 ++++++++++----
>  arch/arm/mach-omap2/board-overo.c          |   55 ++++++-
>  arch/arm/mach-omap2/board-zoom.c           |   56 ++++++-
>  drivers/mfd/omap-usb-host.c                |   48 +------
>  drivers/usb/host/Kconfig                   |    2 +-
>  drivers/usb/host/Makefile                  |    1 +
>  drivers/usb/host/ehci-hcd.c                |    6 +-
>  drivers/usb/host/ehci-omap.c               |  245 +++++++++++-----------------
>  drivers/usb/otg/nop-usb-xceiv.c            |  106 +++++++++++--
>  include/linux/platform_data/usb-omap.h     |    3 -
>  include/linux/usb/nop-usb-xceiv.h          |    1 +
>  24 files changed, 1288 insertions(+), 366 deletions(-)
> 


^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-05 11:28 ` [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
@ 2013-02-05 16:58   ` Greg KH
  2013-02-05 17:17     ` Tony Lindgren
  0 siblings, 1 reply; 101+ messages in thread
From: Greg KH @ 2013-02-05 16:58 UTC (permalink / raw)
  To: Roger Quadros
  Cc: tony, linux, sameo, balbi, stern, eballetbo, javier, sshtylyov,
	linux-usb, linux-kernel, linux-arm-kernel, ABRAHAM, KISHON VIJAY

On Tue, Feb 05, 2013 at 01:28:51PM +0200, Roger Quadros wrote:
> Hi Tony & Greg,
> 
> What's the best way to get these patches in?
> 
> All patches have been acked by respective maintainers.
> 
> If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a
> pull request directly to Greg? or the other way round?
> 
> Tony, 
> fyi, these patches should not interfere with the dw3c/musb stuff
> sent by Felipe & Kishon.

I'm fine with Tony just taking them all if he wants to.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-05 16:58   ` Greg KH
@ 2013-02-05 17:17     ` Tony Lindgren
  2013-02-06  9:49       ` Roger Quadros
  0 siblings, 1 reply; 101+ messages in thread
From: Tony Lindgren @ 2013-02-05 17:17 UTC (permalink / raw)
  To: Greg KH
  Cc: Roger Quadros, linux, sameo, balbi, stern, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel, ABRAHAM,
	KISHON VIJAY

* Greg KH <gregkh@linuxfoundation.org> [130205 09:00]:
> On Tue, Feb 05, 2013 at 01:28:51PM +0200, Roger Quadros wrote:
> > Hi Tony & Greg,
> > 
> > What's the best way to get these patches in?
> > 
> > All patches have been acked by respective maintainers.
> > 
> > If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a
> > pull request directly to Greg? or the other way round?
> > 
> > Tony, 
> > fyi, these patches should not interfere with the dw3c/musb stuff
> > sent by Felipe & Kishon.
> 
> I'm fine with Tony just taking them all if he wants to.

OK. Roger, can you please do me a pull request with these
against v3.8-rc6?

Regards,

Tony

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-05 17:17     ` Tony Lindgren
@ 2013-02-06  9:49       ` Roger Quadros
  2013-02-06 17:11         ` Tony Lindgren
  0 siblings, 1 reply; 101+ messages in thread
From: Roger Quadros @ 2013-02-06  9:49 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Greg KH, linux, sameo, balbi, stern, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel, ABRAHAM,
	KISHON VIJAY

On 02/05/2013 07:17 PM, Tony Lindgren wrote:
> * Greg KH <gregkh@linuxfoundation.org> [130205 09:00]:
>> On Tue, Feb 05, 2013 at 01:28:51PM +0200, Roger Quadros wrote:
>>> Hi Tony & Greg,
>>>
>>> What's the best way to get these patches in?
>>>
>>> All patches have been acked by respective maintainers.
>>>
>>> If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a
>>> pull request directly to Greg? or the other way round?
>>>
>>> Tony, 
>>> fyi, these patches should not interfere with the dw3c/musb stuff
>>> sent by Felipe & Kishon.
>>
>> I'm fine with Tony just taking them all if he wants to.
> 
> OK. Roger, can you please do me a pull request with these
> against v3.8-rc6?
> 

Tony,

Since this depends on [1] and [2] which are both in linux-next, should
I base it on linux-next?

Another option is to defer this to 3.10 merge window, along with the
DT adaptation for OMAP USB Host.

cheers,
-roger

[1] [PATCH v9 00/20] OMAP USB Host cleanup
https://lkml.org/lkml/2013/1/23/155

[2] [PATCH v2 0/6] USB: Add support for multiple PHYs of same type
https://lkml.org/lkml/2013/1/24/876

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-06  9:49       ` Roger Quadros
@ 2013-02-06 17:11         ` Tony Lindgren
  2013-02-06 17:48           ` Greg KH
  2013-02-07 15:28           ` Roger Quadros
  0 siblings, 2 replies; 101+ messages in thread
From: Tony Lindgren @ 2013-02-06 17:11 UTC (permalink / raw)
  To: Roger Quadros
  Cc: Greg KH, linux, sameo, balbi, stern, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel, ABRAHAM,
	KISHON VIJAY

* Roger Quadros <rogerq@ti.com> [130206 01:53]:
> On 02/05/2013 07:17 PM, Tony Lindgren wrote:
> > * Greg KH <gregkh@linuxfoundation.org> [130205 09:00]:
> >> On Tue, Feb 05, 2013 at 01:28:51PM +0200, Roger Quadros wrote:
> >>> Hi Tony & Greg,
> >>>
> >>> What's the best way to get these patches in?
> >>>
> >>> All patches have been acked by respective maintainers.
> >>>
> >>> If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a
> >>> pull request directly to Greg? or the other way round?
> >>>
> >>> Tony, 
> >>> fyi, these patches should not interfere with the dw3c/musb stuff
> >>> sent by Felipe & Kishon.
> >>
> >> I'm fine with Tony just taking them all if he wants to.
> > 
> > OK. Roger, can you please do me a pull request with these
> > against v3.8-rc6?
> > 
> 
> Tony,
> 
> Since this depends on [1] and [2] which are both in linux-next, should
> I base it on linux-next?

Maybe you can base it on some commit in Greg's USB tree?
Just check with Greg that whatever you use as a base is an
immutable commit and OK to use as a base.
 
> Another option is to defer this to 3.10 merge window, along with the
> DT adaptation for OMAP USB Host.

Once you have a branch ready that builds and boots, let's see how
badly that conflicts with other branches we have queued up. If it's
trivial only, then maybe Greg can pick up the patches. If not, we
can still try to merge it in later on during the merge window as
it would be nice to get USB to usable point with DT.

Regards,

Tony
 
> [1] [PATCH v9 00/20] OMAP USB Host cleanup
> https://lkml.org/lkml/2013/1/23/155
> 
> [2] [PATCH v2 0/6] USB: Add support for multiple PHYs of same type
> https://lkml.org/lkml/2013/1/24/876

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-06 17:11         ` Tony Lindgren
@ 2013-02-06 17:48           ` Greg KH
  2013-02-07 15:28           ` Roger Quadros
  1 sibling, 0 replies; 101+ messages in thread
From: Greg KH @ 2013-02-06 17:48 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Roger Quadros, linux, sameo, balbi, stern, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel, ABRAHAM,
	KISHON VIJAY

On Wed, Feb 06, 2013 at 09:11:54AM -0800, Tony Lindgren wrote:
> * Roger Quadros <rogerq@ti.com> [130206 01:53]:
> > On 02/05/2013 07:17 PM, Tony Lindgren wrote:
> > > * Greg KH <gregkh@linuxfoundation.org> [130205 09:00]:
> > >> On Tue, Feb 05, 2013 at 01:28:51PM +0200, Roger Quadros wrote:
> > >>> Hi Tony & Greg,
> > >>>
> > >>> What's the best way to get these patches in?
> > >>>
> > >>> All patches have been acked by respective maintainers.
> > >>>
> > >>> If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a
> > >>> pull request directly to Greg? or the other way round?
> > >>>
> > >>> Tony, 
> > >>> fyi, these patches should not interfere with the dw3c/musb stuff
> > >>> sent by Felipe & Kishon.
> > >>
> > >> I'm fine with Tony just taking them all if he wants to.
> > > 
> > > OK. Roger, can you please do me a pull request with these
> > > against v3.8-rc6?
> > > 
> > 
> > Tony,
> > 
> > Since this depends on [1] and [2] which are both in linux-next, should
> > I base it on linux-next?
> 
> Maybe you can base it on some commit in Greg's USB tree?
> Just check with Greg that whatever you use as a base is an
> immutable commit and OK to use as a base.

My public git trees should always be immutable and can be used as a
base.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 101+ messages in thread

* Re: [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver
  2013-02-06 17:11         ` Tony Lindgren
  2013-02-06 17:48           ` Greg KH
@ 2013-02-07 15:28           ` Roger Quadros
  1 sibling, 0 replies; 101+ messages in thread
From: Roger Quadros @ 2013-02-07 15:28 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Greg KH, linux, sameo, balbi, stern, eballetbo, javier,
	sshtylyov, linux-usb, linux-kernel, linux-arm-kernel, ABRAHAM,
	KISHON VIJAY

On 02/06/2013 07:11 PM, Tony Lindgren wrote:
> * Roger Quadros <rogerq@ti.com> [130206 01:53]:
>> On 02/05/2013 07:17 PM, Tony Lindgren wrote:
>>> * Greg KH <gregkh@linuxfoundation.org> [130205 09:00]:
>>>> On Tue, Feb 05, 2013 at 01:28:51PM +0200, Roger Quadros wrote:
>>>>> Hi Tony & Greg,
>>>>>
>>>>> What's the best way to get these patches in?
>>>>>
>>>>> All patches have been acked by respective maintainers.
>>>>>
>>>>> If Tony can Ack the arch/arm/mach-omap2 stuff then should I send a
>>>>> pull request directly to Greg? or the other way round?
>>>>>
>>>>> Tony, 
>>>>> fyi, these patches should not interfere with the dw3c/musb stuff
>>>>> sent by Felipe & Kishon.
>>>>
>>>> I'm fine with Tony just taking them all if he wants to.
>>>
>>> OK. Roger, can you please do me a pull request with these
>>> against v3.8-rc6?
>>>
>>
>> Tony,
>>
>> Since this depends on [1] and [2] which are both in linux-next, should
>> I base it on linux-next?
> 
> Maybe you can base it on some commit in Greg's USB tree?
> Just check with Greg that whatever you use as a base is an
> immutable commit and OK to use as a base.
>  
>> Another option is to defer this to 3.10 merge window, along with the
>> DT adaptation for OMAP USB Host.
> 
> Once you have a branch ready that builds and boots, let's see how
> badly that conflicts with other branches we have queued up. If it's
> trivial only, then maybe Greg can pick up the patches. If not, we
> can still try to merge it in later on during the merge window as
> it would be nice to get USB to usable point with DT.
> 

Great! The DT patches are still under review.

I've based the $subject patches on Greg's usb-next branch.

Since dependent patches [1] went into linux-next through Samuel's MFD tree
and are not in Greg's usb-next, I've added them as well in my branch.
Not sure how this goes :P.

The $subject patches are since commit a0c750bb8b023ab92e27c670a1c9378d52dd2053:

  mfd: omap-usb-host: get rid of build warning (2013-02-07 16:37:41 +0200)

are available in the git repository at:
  git://github.com/rogerq/linux.git usb-next-usbhost16


The patches [1] are since commit 9662ced3527f5994e83957cf40765ed126abe97f:

  usb: gadget: imx_udc: make it depend on BROKEN (2013-02-06 11:43:39 -0800)

are available in the git repository at:
  git://github.com/rogerq/linux.git usb-next-usbhost16-part

cheers,
-roger

[1] [PATCH v9 00/20] OMAP USB Host cleanup
https://lkml.org/lkml/2013/1/23/155


^ permalink raw reply	[flat|nested] 101+ messages in thread

end of thread, other threads:[~2013-02-07 15:29 UTC | newest]

Thread overview: 101+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-28 11:30 [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
2013-01-28 11:30 ` [PATCH 01/30] USB: EHCI: split ehci-omap out to a separate driver Roger Quadros
2013-02-05  9:11   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 02/30] usb: phy: nop: use devm_kzalloc() Roger Quadros
2013-02-05  9:14   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH v2 03/30] usb: phy: nop: Manage PHY clock Roger Quadros
2013-02-05  9:17   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH v2 04/30] usb: phy: nop: Handle power supply regulator for the PHY Roger Quadros
2013-02-05  9:20   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH v2 05/30] usb: phy: nop: Handle RESET " Roger Quadros
2013-02-05  9:22   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 06/30] usb: phy: nop: use new PHY API to register PHY Roger Quadros
2013-02-05  9:23   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 07/30] mfd: omap-usb-host: update nports in platform_data Roger Quadros
2013-02-05  9:24   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 08/30] mfd: omap-usb-host: Remove PHY reset handling code Roger Quadros
2013-02-05  9:25   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap() Roger Quadros
2013-01-28 15:17   ` Alan Stern
2013-01-28 15:20     ` Russell King - ARM Linux
2013-01-29 15:34       ` Alan Stern
2013-01-29 16:01         ` Russell King - ARM Linux
2013-01-29 22:08           ` Greg KH
2013-02-05  9:25   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH v2 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend Roger Quadros
2013-01-28 15:40   ` Alan Stern
2013-01-28 15:58     ` Roger Quadros
2013-01-29  9:50   ` [PATCH v3 " Roger Quadros
2013-01-29  9:57     ` Felipe Balbi
2013-01-29 10:08       ` Roger Quadros
2013-01-29 10:12         ` Felipe Balbi
2013-01-29 15:30     ` Alan Stern
2013-01-29 15:33       ` Roger Quadros
2013-02-05  9:13       ` Felipe Balbi
2013-02-05  9:26       ` Felipe Balbi
2013-01-28 11:30 ` [PATCH v2 11/30] usb: ehci-omap: Remove PHY reset handling code Roger Quadros
2013-01-28 17:34   ` Alan Stern
2013-02-05  9:27     ` Felipe Balbi
2013-01-28 11:30 ` [PATCH v2 12/30] usb: ehci-omap: Remove PHY regulator " Roger Quadros
2013-01-28 17:35   ` Alan Stern
2013-02-05  9:27     ` Felipe Balbi
2013-01-28 11:30 ` [PATCH v2 13/30] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data Roger Quadros
2013-02-05  9:28   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH v2 14/30] ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes Roger Quadros
2013-02-05  9:31   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 15/30] ARM: OMAP3: Beagle: " Roger Quadros
2013-02-05  9:31   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 16/30] ARM: OMAP3: 3430SDP: " Roger Quadros
2013-02-05  9:31   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 17/30] ARM: OMAP3: 3630SDP: " Roger Quadros
2013-02-05  9:31   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 18/30] ARM: OMAP: AM3517crane: " Roger Quadros
2013-02-05  9:32   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 19/30] ARM: OMAP: AM3517evm: " Roger Quadros
2013-02-05  9:32   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 20/30] ARM: OMAP3: cm-t35: " Roger Quadros
2013-02-05  9:32   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 21/30] ARM: OMAP3: cm-t3517: " Roger Quadros
2013-02-05  9:32   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 22/30] ARM: OMAP: devkit8000: " Roger Quadros
2013-02-05  9:33   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 23/30] ARM: OMAP3: igep0020: " Roger Quadros
2013-02-05  9:33   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 24/30] ARM: OMAP3: omap3evm: " Roger Quadros
2013-02-05  9:33   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 25/30] ARM: OMAP3: omap3pandora: " Roger Quadros
2013-02-05  9:33   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 26/30] ARM: OMAP3: omap3stalker: " Roger Quadros
2013-02-05  9:34   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 27/30] ARM: OMAP3: omap3touchbook: " Roger Quadros
2013-02-05  9:34   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 28/30] ARM: OMAP3: overo: " Roger Quadros
2013-02-05  9:40   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 29/30] ARM: OMAP: zoom: " Roger Quadros
2013-02-05  9:40   ` Felipe Balbi
2013-01-28 11:30 ` [PATCH 30/30] ARM: OMAP: USB: Remove unused fields from struct usbhs_omap_platform_data Roger Quadros
2013-02-05  9:40   ` Felipe Balbi
2013-01-30 12:08 ` [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Mohammed, Afzal
2013-01-30 12:48   ` Roger Quadros
2013-01-30 13:12     ` Mohammed, Afzal
2013-01-30 13:15       ` Roger Quadros
2013-01-30 13:15     ` Felipe Balbi
2013-01-30 13:19       ` Mohammed, Afzal
2013-02-01 14:21         ` Mohammed, Afzal
2013-02-01 14:25           ` Roger Quadros
2013-02-01 14:27             ` Mohammed, Afzal
2013-02-01 14:31               ` Roger Quadros
2013-02-01 14:35                 ` Mohammed, Afzal
2013-02-01 14:58                   ` Roger Quadros
2013-02-04 14:35 ` [PATCH v2 09/31] USB: ehci-omap: Use devm_ioremap_resource() Roger Quadros
2013-02-04 21:11   ` Alan Stern
2013-02-04 14:46 ` [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver Roger Quadros
2013-02-04 21:03   ` Alan Stern
2013-02-05  9:41     ` Felipe Balbi
2013-02-05 11:28 ` [PATCH v2 00/30] USB: omap-ehci: Move PHY management to PHY driver Roger Quadros
2013-02-05 16:58   ` Greg KH
2013-02-05 17:17     ` Tony Lindgren
2013-02-06  9:49       ` Roger Quadros
2013-02-06 17:11         ` Tony Lindgren
2013-02-06 17:48           ` Greg KH
2013-02-07 15:28           ` Roger Quadros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).