Skip to contentSkip to conversation

USB: omap-ehci: Move PHY management to PHY driver

PATCH In review Roger Quadros 7 participants 101 messages Jan 28, 2013 – Feb 7, 2013

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

v2 cover USB: omap-ehci: Move PHY management to PHY driver

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(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH v2 1/30 USB: EHCI: split ehci-omap out to a separate driver

From: Alan Stern <[email protected]>

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.

---
 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(-)
drivers/usb/host/Kconfig +1 -1
index 3a21c5d..11e102e 100644
@@ -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---
drivers/usb/host/Makefile +1 -0
index 001fbff..56de410 100644
@@ -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
drivers/usb/host/ehci-hcd.c +1 -5
index 09537b2..5a35246 100644
@@ -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) && \
drivers/usb/host/ehci-omap.c +34 -42

117 lines not on this page · raw message

Signature · 1 line
1.7.4.1
Acked-by on v2 1/30
#2 lore raw

Re: [PATCH 01/30] USB: EHCI: split ehci-omap out to a separate driver

Quoted 8 lines · Roger Quadros

From: Alan Stern <[email protected]>

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.

for ehci-omap:

Quoted 185 lines
---
 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(-)
drivers/usb/host/Kconfig +1 -1
index 3a21c5d..11e102e 100644
@@ -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---
drivers/usb/host/Makefile +1 -0
index 001fbff..56de410 100644
@@ -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
drivers/usb/host/ehci-hcd.c +1 -5
index 09537b2..5a35246 100644
@@ -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) && \
drivers/usb/host/ehci-omap.c +34 -42
index b96a4bf..30fc482 100644
@@ -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 <[email protected]>");
 
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
Signature · 1 line
1.7.4.1
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/23a0edf8/attachment.sig>
#3 lore raw

PATCH v2 2/30 usb: phy: nop: use devm_kzalloc()

In reply to Roger Quadros

Use resource managed kzalloc.

---
 drivers/usb/otg/nop-usb-xceiv.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +4 -12
index a3ce24b..7ffb0c8 100644
@@ -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;
 }
Signature · 1 line
1.7.4.1
Acked-by on v2 2/30
#4 lore raw

Re: [PATCH 02/30] usb: phy: nop: use devm_kzalloc()

Quoted 4 lines · Roger Quadros

Use resource managed kzalloc.

---

Quoted 58 lines
 drivers/usb/otg/nop-usb-xceiv.c |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +4 -12
index a3ce24b..7ffb0c8 100644
@@ -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;
 }
Signature · 1 line
1.7.4.1
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/8e963b27/attachment.sig>
#5 lore raw

PATCH v2 3/30 usb: phy: nop: Manage PHY clock

In reply to Roger Quadros

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.

---
 drivers/usb/otg/nop-usb-xceiv.c   |   54 ++++++++++++++++++++++++++++++++++++-
 include/linux/usb/nop-usb-xceiv.h |    1 +
 2 files changed, 54 insertions(+), 1 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +53 -1
index 7ffb0c8..849eb9d 100644
@@ -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);
include/linux/usb/nop-usb-xceiv.h +1 -0
index 28884c7..3265b61 100644
@@ -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))
Signature · 1 line
1.7.4.1
Acked-by on v2 3/30
#6 lore raw

Re: [PATCH v2 03/30] usb: phy: nop: Manage PHY clock

Hi,

Quoted 7 lines · Roger Quadros

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.

Quoted 127 lines
---
 drivers/usb/otg/nop-usb-xceiv.c   |   54 ++++++++++++++++++++++++++++++++++++-
 include/linux/usb/nop-usb-xceiv.h |    1 +
 2 files changed, 54 insertions(+), 1 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +53 -1
index 7ffb0c8..849eb9d 100644
@@ -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);
include/linux/usb/nop-usb-xceiv.h +1 -0
index 28884c7..3265b61 100644
@@ -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))
Signature · 1 line
1.7.4.1
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/7afcc6a3/attachment.sig>
#7 lore raw

PATCH v2 4/30 usb: phy: nop: Handle power supply regulator for the PHY

In reply to Roger Quadros

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()

---
 drivers/usb/otg/nop-usb-xceiv.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +18 -0
index 849eb9d..0a9628c 100644
@@ -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";
Signature · 1 line
1.7.4.1
Acked-by on v2 4/30
#8 lore raw

Re: [PATCH v2 04/30] usb: phy: nop: Handle power supply regulator for the PHY

Quoted 5 lines · Roger Quadros

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()

Quoted 62 lines
---
 drivers/usb/otg/nop-usb-xceiv.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +18 -0
index 849eb9d..0a9628c 100644
@@ -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";
Signature · 1 line
1.7.4.1
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/65a72c17/attachment.sig>
#9 lore raw

PATCH v2 5/30 usb: phy: nop: Handle RESET for the PHY

In reply to Roger Quadros

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().

---
 drivers/usb/otg/nop-usb-xceiv.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +19 -0
index 0a9628c..3060ed0 100644
@@ -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";
Signature · 1 line
1.7.4.1
Acked-by on v2 5/30
#10 lore raw

Re: [PATCH v2 05/30] usb: phy: nop: Handle RESET for the PHY

Quoted 9 lines · Roger Quadros

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().

Quoted 58 lines
---
 drivers/usb/otg/nop-usb-xceiv.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +19 -0
index 0a9628c..3060ed0 100644
@@ -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";
Signature · 1 line
1.7.4.1
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/c1be955c/attachment.sig>
#11 lore raw

PATCH v2 6/30 usb: phy: nop: use new PHY API to register PHY

In reply to Roger Quadros

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.

---
 drivers/usb/otg/nop-usb-xceiv.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +2 -1
index 3060ed0..ac027a1 100644
@@ -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);
Signature · 1 line
1.7.4.1
Acked-by on v2 6/30
#12 lore raw

Re: [PATCH 06/30] usb: phy: nop: use new PHY API to register PHY

Quoted 4 lines · Roger Quadros

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.

Quoted 26 lines
---
 drivers/usb/otg/nop-usb-xceiv.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +2 -1
index 3060ed0..ac027a1 100644
@@ -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);
Signature · 1 line
1.7.4.1
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/0e570eba/attachment-0001.sig>
#13 lore raw

PATCH v2 7/30 mfd: omap-usb-host: update nports in platform_data

In reply to Roger Quadros

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.

---
 drivers/mfd/omap-usb-host.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/mfd/omap-usb-host.c +1 -0
index 6b5edf6..0874352 100644
@@ -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;
Signature · 1 line
1.7.4.1
Acked-by on v2 7/30
#14 lore raw

Re: [PATCH 07/30] mfd: omap-usb-host: update nports in platform_data

Quoted 6 lines · Roger Quadros

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.

Quoted 19 lines
---
 drivers/mfd/omap-usb-host.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/mfd/omap-usb-host.c +1 -0
index 6b5edf6..0874352 100644
@@ -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;
Signature · 1 line
1.7.4.1
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/d0b5368f/attachment.sig>
#15 lore raw

PATCH v2 8/30 mfd: omap-usb-host: Remove PHY reset handling code

In reply to Roger Quadros

PHY reset GPIO handling will be done in the PHY driver

---
 drivers/mfd/omap-usb-host.c |   47 -------------------------------------------
 1 files changed, 0 insertions(+), 47 deletions(-)
drivers/mfd/omap-usb-host.c +0 -47
index 0874352..502a779 100644
@@ -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]);
Signature · 1 line
1.7.4.1
Acked-by on v2 8/30
#16 lore raw

Re: [PATCH 08/30] mfd: omap-usb-host: Remove PHY reset handling code

Quoted 4 lines · Roger Quadros

PHY reset GPIO handling will be done in the PHY driver

Quoted 92 lines
---
 drivers/mfd/omap-usb-host.c |   47 -------------------------------------------
 1 files changed, 0 insertions(+), 47 deletions(-)
drivers/mfd/omap-usb-host.c +0 -47
index 0874352..502a779 100644
@@ -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]);
Signature · 1 line
1.7.4.1
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/2baee66a/attachment.sig>
#17 lore raw

PATCH v2 9/30 USB: ehci-omap: Use devm_request_and_ioremap()

In reply to Roger Quadros

Make use of devm_request_and_ioremap() and correct comment.

---
 drivers/usb/host/ehci-omap.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)
drivers/usb/host/ehci-omap.c +5 -14
index 30fc482..fd2f5450 100644
@@ -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);
Signature · 1 line
1.7.4.1
maintainer
#18 lore raw

Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()

Quoted 1 line · Roger Quadros

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

#19 lore raw

Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()

Quoted 8 lines · Alan Stern
Quoted 1 line · Roger Quadros

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?

Quoted 6 lines

(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.

maintainer Acked-by
#20 lore raw

Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()

Quoted 11 lines · Russell King - ARM Linux
Quoted 10 lines · Alan Stern
Quoted 1 line · Roger Quadros

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:

Quoted 8 lines
Quoted 4 lines
	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

#21 lore raw

Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()

Quoted 18 lines · Alan Stern
Quoted 16 lines · Russell King - ARM Linux
Quoted 14 lines · Alan Stern
Quoted 1 line · Roger Quadros

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.

Quoted 6 lines
Quoted 3 lines

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.

maintainer
#22 lore raw

Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()

Quoted 26 lines · Russell King - ARM Linux
Quoted 18 lines · Alan Stern
Quoted 16 lines · Russell King - ARM Linux
Quoted 14 lines · Alan Stern
Quoted 1 line · Roger Quadros

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.

Quoted 6 lines
Quoted 3 lines

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.

Quoted 6 lines

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

Acked-by on v2 9/30
#23 lore raw

Re: [PATCH 09/30] USB: ehci-omap: Use devm_request_and_ioremap()

In reply to Roger Quadros
Quoted 3 lines · Roger Quadros

Make use of devm_request_and_ioremap() and correct comment.

Quoted 57 lines
---
 drivers/usb/host/ehci-omap.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)
drivers/usb/host/ehci-omap.c +5 -14
index 30fc482..fd2f5450 100644
@@ -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);
Signature · 1 line
1.7.4.1
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/9143afeb/attachment.sig>
#24 lore raw

PATCH v2 10/30 USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

In reply to Roger Quadros

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.

---
 drivers/usb/host/ehci-omap.c |   54 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-omap.c +54 -0
index fd2f5450..a35e44e 100644
@@ -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);
 
Signature · 1 line
1.7.4.1
maintainer
#25 lore raw

Re: [PATCH v2 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

Quoted 5 lines · Roger Quadros

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.

Quoted 10 lines
---
 drivers/usb/host/ehci-omap.c |   54 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-omap.c +0 -0
index fd2f5450..a35e44e 100644

drivers/usb/host/ehci-omap.c static const char hcd_name[] = "ehci-omap"; · line 74

Quoted 5 lines
drivers/usb/host/ehci-omap.c +2 -0
@@ -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.

drivers/usb/host/ehci-omap.c static const char hcd_name[] = "ehci-omap"; · line 76

Quoted 2 lines
drivers/usb/host/ehci-omap.c +2 -0
+	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.

drivers/usb/host/ehci-omap.c static int ehci_hcd_omap_probe(struct platform_device *pdev) · line 249

Quoted 11 lines
drivers/usb/host/ehci-omap.c +7 -0
@@ -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.

drivers/usb/host/ehci-omap.c static int ehci_hcd_omap_remove(struct platform_device *pdev) · line 345

Quoted 5 lines
drivers/usb/host/ehci-omap.c +1 -0
@@ -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. :-)

drivers/usb/host/ehci-omap.c static int ehci_hcd_omap_remove(struct platform_device *pdev) · line 350

Quoted 5 lines
drivers/usb/host/ehci-omap.c +1 -0
+	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.

drivers/usb/host/ehci-omap.c static int ehci_hcd_omap_probe(struct platform_device *pdev) · line 326

Quoted 5 lines
drivers/usb/host/ehci-omap.c +5 -0
+	for (i = 0; i < omap->nports; i++) {
+		if (omap->phy[i])
+			usb_phy_shutdown(omap->phy[i]);
+	}
+

Alan Stern

#26 lore raw

Re: [PATCH v2 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

Quoted 9 lines · Alan Stern
Quoted 5 lines · Roger Quadros

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

Quoted 12 lines
Quoted 12 lines
---
 drivers/usb/host/ehci-omap.c |   54 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)
drivers/usb/host/ehci-omap.c +0 -0
index fd2f5450..a35e44e 100644
@@ -70,6 +70,11 @@ static const char hcd_name[] = "ehci-omap";
 
Quoted 7 lines

drivers/usb/host/ehci-omap.c static const char hcd_name[] = "ehci-omap"; · line 74

Quoted 4 lines
drivers/usb/host/ehci-omap.c +2 -0
 /*-------------------------------------------------------------------------*/
 
+struct omap_hcd {
+	struct usb_hcd *hcd;

This pointer is not needed any more.

OK.

Quoted 5 lines

drivers/usb/host/ehci-omap.c static const char hcd_name[] = "ehci-omap"; · line 76

Quoted 2 lines
drivers/usb/host/ehci-omap.c +2 -0
+	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.

Quoted 5 lines
Quoted 5 lines
drivers/usb/host/ehci-omap.c +0 -0
@@ -233,6 +240,39 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 	hcd->rsrc_len = resource_size(res);
 	hcd->regs = regs;
 
Quoted 10 lines

drivers/usb/host/ehci-omap.c static int ehci_hcd_omap_probe(struct platform_device *pdev) · line 249

Quoted 7 lines
drivers/usb/host/ehci-omap.c +7 -0
+	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!

Quoted 10 lines

drivers/usb/host/ehci-omap.c static int ehci_hcd_omap_remove(struct platform_device *pdev) · line 345

Quoted 6 lines
drivers/usb/host/ehci-omap.c +1 -0
@@ -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.

Quoted 9 lines

drivers/usb/host/ehci-omap.c static int ehci_hcd_omap_remove(struct platform_device *pdev) · line 350

Quoted 6 lines
drivers/usb/host/ehci-omap.c +1 -0
+	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.

Quoted 7 lines

drivers/usb/host/ehci-omap.c static int ehci_hcd_omap_probe(struct platform_device *pdev) · line 326

Quoted 6 lines
drivers/usb/host/ehci-omap.c +5 -0
+	for (i = 0; i < omap->nports; i++) {
+		if (omap->phy[i])
+			usb_phy_shutdown(omap->phy[i]);
+	}
+

regards,
-roger

#27 lore raw

PATCH v3 10/30 USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

In reply to Roger Quadros

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.

---
 drivers/usb/host/ehci-omap.c |   76 ++++++++++++++++++++++++++++++++++--------
 1 files changed, 62 insertions(+), 14 deletions(-)
drivers/usb/host/ehci-omap.c +62 -14
index fd2f5450..ddc31fb 100644
@@ -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 <[email protected]>
  *	Author: Anand Gadiyar <[email protected]>
  *	Author: Keshava Munegowda <[email protected]>
+ *	Author: Roger Quadros <[email protected]>
  *
  * Copyright (C) 2009 Nokia Corporation
  *	Contact: Felipe Balbi <[email protected]>
@@ -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);
 
Signature · 1 line
1.7.4.1
#28 lore raw

Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

Hi,

Quoted 9 lines · Roger Quadros

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.

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

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130129/44445308/attachment.sig>
#29 lore raw

Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

Quoted 9 lines · Felipe Balbi

Hi,

Quoted 6 lines · Roger Quadros

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.

Quoted 7 lines
Quoted 3 lines

Also remove wired spacing around declarations we come across.

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

#30 lore raw

Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

Quoted 10 lines · Roger Quadros
Quoted 9 lines · Felipe Balbi

Hi,

Quoted 6 lines · Roger Quadros

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.

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

Also remove wired spacing around declarations we come across.

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.

Quoted 3 lines

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130129/a1b8b702/attachment.sig>
maintainer Acked-by on v3 10/30
#31 lore raw

Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

In reply to Roger Quadros
Quoted 5 lines · Roger Quadros

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/

Quoted 1 line

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.

Quoted 1 line
#32 lore raw

Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

Quoted 12 lines · Alan Stern
Quoted 5 lines · Roger Quadros

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/

Quoted 1 line

Also remove wired spacing around declarations we come across.

Quoted 8 lines

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.

Quoted 1 line

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

cheers,
-roger

Acked-by
#33 lore raw

Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

In reply to Alan Stern
Quoted 12 lines · Alan Stern
Quoted 5 lines · Roger Quadros

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/

Quoted 1 line

Also remove wired spacing around declarations we come across.

Quoted 7 lines

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.

Quoted 1 line
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/010fe60b/attachment-0001.sig>
Acked-by
#34 lore raw

Re: [PATCH v3 10/30] USB: ehci-omap: Use PHY APIs to get the PHY device and put it out of suspend

In reply to Alan Stern
Quoted 12 lines · Alan Stern
Quoted 5 lines · Roger Quadros

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/

Quoted 1 line

Also remove wired spacing around declarations we come across.

Quoted 7 lines

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.

Quoted 1 line
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/28652e30/attachment.sig>
#35 lore raw

PATCH v2 11/30 usb: ehci-omap: Remove PHY reset handling code

In reply to Roger Quadros

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

---
 drivers/usb/host/ehci-omap.c |   70 +++++------------------------------------
 1 files changed, 9 insertions(+), 61 deletions(-)
drivers/usb/host/ehci-omap.c +9 -61
index a35e44e..3c63619 100644
@@ -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;
Signature · 1 line
1.7.4.1
Acked-by
#37 lore raw

Re: [PATCH v2 11/30] usb: ehci-omap: Remove PHY reset handling code

Quoted 8 lines · Alan Stern
Quoted 4 lines · Roger Quadros

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

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/cd5a5204/attachment.sig>
#38 lore raw

PATCH v2 12/30 usb: ehci-omap: Remove PHY regulator handling code

In reply to Roger Quadros

PHY regulator handling must be done in the PHY driver

---
 drivers/usb/host/ehci-omap.c |   34 ----------------------------------
 1 files changed, 0 insertions(+), 34 deletions(-)
drivers/usb/host/ehci-omap.c +0 -34
index 3c63619..da3e322 100644
@@ -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++) {
Signature · 1 line
1.7.4.1
Acked-by
#40 lore raw

Re: [PATCH v2 12/30] usb: ehci-omap: Remove PHY regulator handling code

Quoted 7 lines · Alan Stern
Quoted 3 lines · Roger Quadros

PHY regulator handling must be done in the PHY driver

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/432c64f7/attachment-0001.sig>
#41 lore raw

PATCH v2 13/30 ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-omap4panda.c |   34 ++++++++++++++++++++++---------
 1 files changed, 24 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/board-omap4panda.c +24 -10
index 1351489..2641752 100644
@@ -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 */
Signature · 1 line
1.7.4.1
Acked-by on v2 13/30
#42 lore raw

Re: [PATCH v2 13/30] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data

Quoted 8 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/d298a77d/attachment.sig>
#43 lore raw

PATCH v2 14/30 ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-omap4panda.c |   93 +++++++++++++++++++++++---------
 1 files changed, 67 insertions(+), 26 deletions(-)
arch/arm/mach-omap2/board-omap4panda.c +67 -26
index 2641752..8c85e05 100644
@@ -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 = {
Signature · 1 line
1.7.4.1
Acked-by on v2 14/30
#44 lore raw

Re: [PATCH v2 14/30] ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes

Quoted 7 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/64790056/attachment.sig>
#45 lore raw

PATCH v2 15/30 ARM: OMAP3: Beagle: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-omap3beagle.c |   93 +++++++++++++++++++++++++++---
 1 files changed, 83 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +83 -10
index 1cb114e..d8c6993 100644
@@ -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);
Signature · 1 line
1.7.4.1
Acked-by on v2 15/30
#46 lore raw

Re: [PATCH 15/30] ARM: OMAP3: Beagle: Adapt to ehci-omap changes

Quoted 7 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/77215d47/attachment.sig>
#47 lore raw

PATCH v2 16/30 ARM: OMAP3: 3430SDP: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-3430sdp.c |   99 ++++++++++++++++++++++++++++++++--
 1 files changed, 93 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +93 -6
index 46147c8..69b0944 100644
@@ -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);
 }
 
Signature · 1 line
1.7.4.1
Acked-by on v2 16/30
#48 lore raw

Re: [PATCH 16/30] ARM: OMAP3: 3430SDP: Adapt to ehci-omap changes

Quoted 8 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/5fdfc069/attachment.sig>
#49 lore raw

PATCH v2 17/30 ARM: OMAP3: 3630SDP: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-3630sdp.c |  100 ++++++++++++++++++++++++++++++++--
 1 files changed, 94 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/board-3630sdp.c +94 -6
index 78b1724..43683ea 100644
@@ -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);
 }
 
Signature · 1 line
1.7.4.1
Acked-by on v2 17/30
#50 lore raw

Re: [PATCH 17/30] ARM: OMAP3: 3630SDP: Adapt to ehci-omap changes

Quoted 8 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/9fec4201/attachment.sig>
#51 lore raw

PATCH v2 18/30 ARM: OMAP: AM3517crane: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-am3517crane.c |   95 +++++++++++++++++++++++++++----
 1 files changed, 83 insertions(+), 12 deletions(-)
arch/arm/mach-omap2/board-am3517crane.c +83 -12
index 26f1916..1d25af6 100644
@@ -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);
Signature · 1 line
1.7.4.1
Acked-by on v2 18/30
#52 lore raw

Re: [PATCH 18/30] ARM: OMAP: AM3517crane: Adapt to ehci-omap changes

Quoted 7 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/4c2e4538/attachment.sig>
#53 lore raw

PATCH v2 19/30 ARM: OMAP: AM3517evm: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-am3517evm.c |   66 ++++++++++++++++++++++++++++++---
 1 files changed, 60 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/board-am3517evm.c +60 -6
index c76725d..a06feb0 100644
@@ -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 */
Signature · 1 line
1.7.4.1
Acked-by on v2 19/30
#54 lore raw

Re: [PATCH 19/30] ARM: OMAP: AM3517evm: Adapt to ehci-omap changes

Quoted 7 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/d50d3461/attachment-0001.sig>
#55 lore raw

PATCH v2 20/30 ARM: OMAP3: cm-t35: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-cm-t35.c |   95 ++++++++++++++++++++++++++++++++++--
 1 files changed, 90 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/board-cm-t35.c +90 -5
index cdf1d6e..71a7eb4 100644
@@ -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);
 }
 
Signature · 1 line
1.7.4.1
Acked-by on v2 20/30
#56 lore raw

Re: [PATCH 20/30] ARM: OMAP3: cm-t35: Adapt to ehci-omap changes

Quoted 8 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/48a88155/attachment.sig>
#57 lore raw

PATCH v2 21/30 ARM: OMAP3: cm-t3517: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-cm-t3517.c |   97 ++++++++++++++++++++++++++++++++--
 1 files changed, 92 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/board-cm-t3517.c +92 -5
index cfa9098..2ba97c5 100644
@@ -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;
Signature · 1 line
1.7.4.1
Acked-by on v2 21/30
#58 lore raw

Re: [PATCH 21/30] ARM: OMAP3: cm-t3517: Adapt to ehci-omap changes

Quoted 8 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/a0b2acbb/attachment.sig>
#59 lore raw

PATCH v2 22/30 ARM: OMAP: devkit8000: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-devkit8000.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/board-devkit8000.c +12 -8
index 051ec0d..f0fd75a 100644
@@ -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,
Signature · 1 line
1.7.4.1
Acked-by on v2 22/30
#60 lore raw

Re: [PATCH 22/30] ARM: OMAP: devkit8000: Adapt to ehci-omap changes

Quoted 4 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/24230ff6/attachment.sig>
#61 lore raw

PATCH v2 23/30 ARM: OMAP3: igep0020: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-igep0020.c |  112 +++++++++++++++++++++++++++++----
 1 files changed, 98 insertions(+), 14 deletions(-)
arch/arm/mach-omap2/board-igep0020.c +98 -14
index cfba790..3398988 100644
@@ -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);
 	}
 }
Signature · 1 line
1.7.4.1
Acked-by on v2 23/30
#62 lore raw

Re: [PATCH 23/30] ARM: OMAP3: igep0020: Adapt to ehci-omap changes

Quoted 8 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/ef7504f7/attachment.sig>
#63 lore raw

PATCH v2 24/30 ARM: OMAP3: omap3evm: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-omap3evm.c |   63 ++++++++++++++++++++++++++++------
 1 files changed, 52 insertions(+), 11 deletions(-)
arch/arm/mach-omap2/board-omap3evm.c +52 -11
index 7bdc8a4..9f3550e 100644
@@ -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,
Signature · 1 line
1.7.4.1
Acked-by on v2 24/30
#64 lore raw

Re: [PATCH 24/30] ARM: OMAP3: omap3evm: Adapt to ehci-omap changes

Quoted 7 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/482799a9/attachment.sig>
#65 lore raw

PATCH v2 25/30 ARM: OMAP3: omap3pandora: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-omap3pandora.c |   54 +++++++++++++++++++++++++----
 1 files changed, 46 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/board-omap3pandora.c +46 -8
index 145a6f8..c2cd1ea 100644
@@ -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);
 
Signature · 1 line
1.7.4.1
Acked-by on v2 25/30
#66 lore raw

Re: [PATCH 25/30] ARM: OMAP3: omap3pandora: Adapt to ehci-omap changes

Quoted 7 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/8b4b2acc/attachment-0001.sig>
#67 lore raw

PATCH v2 26/30 ARM: OMAP3: omap3stalker: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-omap3stalker.c |   52 ++++++++++++++++++++++++++----
 1 files changed, 45 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/board-omap3stalker.c +45 -7
index 278ae95..ed343f0 100644
@@ -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);
 
Signature · 1 line
1.7.4.1
Acked-by on v2 26/30
#68 lore raw

Re: [PATCH 26/30] ARM: OMAP3: omap3stalker: Adapt to ehci-omap changes

Quoted 7 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/aaf03625/attachment.sig>
#69 lore raw

PATCH v2 27/30 ARM: OMAP3: omap3touchbook: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-omap3touchbook.c |   62 ++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/board-omap3touchbook.c +55 -7
index 65a285f..3e00dbf 100644
@@ -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,
Signature · 1 line
1.7.4.1
Acked-by on v2 27/30
#70 lore raw

Re: [PATCH 27/30] ARM: OMAP3: omap3touchbook: Adapt to ehci-omap changes

Quoted 7 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/38c13c8e/attachment.sig>
#71 lore raw

PATCH v2 28/30 ARM: OMAP3: overo: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-overo.c |   55 +++++++++++++++++++++++++++++++++----
 1 files changed, 49 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/board-overo.c +49 -6
index b1b0f09..5c6ea7d 100644
@@ -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();
Signature · 1 line
1.7.4.1
Acked-by on v2 28/30
#72 lore raw

Re: [PATCH 28/30] ARM: OMAP3: overo: Adapt to ehci-omap changes

Quoted 7 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/2416fd2e/attachment.sig>
#73 lore raw

PATCH v2 29/30 ARM: OMAP: zoom: Adapt to ehci-omap changes

In reply to Roger Quadros

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.

---
 arch/arm/mach-omap2/board-zoom.c |   56 +++++++++++++++++++++++++++++++++----
 1 files changed, 50 insertions(+), 6 deletions(-)
arch/arm/mach-omap2/board-zoom.c +50 -6
index 2d7a457..d258632 100644
@@ -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);
 	}
 
Signature · 1 line
1.7.4.1
Acked-by on v2 29/30
#74 lore raw

Re: [PATCH 29/30] ARM: OMAP: zoom: Adapt to ehci-omap changes

Quoted 7 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/9f439a96/attachment.sig>
#75 lore raw

PATCH v2 30/30 ARM: OMAP: USB: Remove unused fields from struct usbhs_omap_platform_data

In reply to Roger Quadros

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.

---
 include/linux/platform_data/usb-omap.h |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
include/linux/platform_data/usb-omap.h +0 -3
index 925a4a7..227601f 100644
@@ -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;
 };
 
 /*-------------------------------------------------------------------------*/
Signature · 1 line
1.7.4.1
Acked-by on v2 30/30
#76 lore raw

Re: [PATCH 30/30] ARM: OMAP: USB: Remove unused fields from struct usbhs_omap_platform_data

Quoted 4 lines · Roger Quadros

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.

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/bed28a54/attachment.sig>
#77 lore raw
In reply to Roger Quadros

Hi Roger,

Quoted 2 lines · Roger

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

#78 lore raw
Quoted 9 lines · Afzal

Hi Roger,

Quoted 2 lines · Roger

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

#79 lore raw

Hi Roger,

Quoted 6 lines · Roger
Quoted 1 line · Afzal

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

Quoted 5 lines

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?

#80 lore raw
Quoted 11 lines · Afzal

Hi Roger,

Quoted 6 lines · Roger
Quoted 1 line · Afzal

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

#81 lore raw
In reply to Roger Quadros

Hi,

Quoted 8 lines · Roger Quadros
Quoted 7 lines · Afzal

Hi Roger,

Quoted 2 lines · Roger

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

Quoted 7 lines
Quoted 2 lines

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)

Quoted 5 lines

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 ?

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130130/073d5e53/attachment.sig>
#82 lore raw

Hi Felipe,

Quoted 9 lines · Felipe
Quoted 5 lines · Roger Quadros

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

#83 lore raw

Hi Felipe, Roger,

Quoted 9 lines · Afzal
Quoted 6 lines · Felipe
Quoted 2 lines · Roger Quadros

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

#84 lore raw
Quoted 6 lines · Afzal

Hi Felipe, Roger,

Quoted 2 lines · Afzal
Quoted 1 line · Felipe

On Wed, Jan 30, 2013 at 02:48:50PM +0200, Roger Quadros wrote:

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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

#85 lore raw

Hi Roger,

Quoted 1 line · Roger

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

No, dt boot, am335x can only dt boot.

Regards
Afzal

#86 lore raw
Quoted 7 lines · Afzal

Hi Roger,

Quoted 1 line · Roger

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

#87 lore raw

Hi Roger,

Quoted 3 lines · Roger

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

#88 lore raw
Quoted 6 lines · Afzal

Hi Roger,

Quoted 2 lines · Roger

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

Quoted 8 lines
Quoted 1 line

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

#89 lore raw

PATCH v2 9/31 USB: ehci-omap: Use devm_ioremap_resource()

In reply to Roger Quadros

Make use of devm_ioremap_resource() and correct comment.

---
 drivers/usb/host/ehci-omap.c |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)
drivers/usb/host/ehci-omap.c +6 -15
index 30fc482..6b088a4 100644
@@ -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);
Signature · 1 line
1.7.4.1
maintainer Acked-by on v2 9/31
#90 lore raw

Re: [PATCH v2 09/31] USB: ehci-omap: Use devm_ioremap_resource()

Quoted 18 lines · Roger Quadros

Make use of devm_ioremap_resource() and correct comment.

---
 drivers/usb/host/ehci-omap.c |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)
drivers/usb/host/ehci-omap.c +0 -2
index 30fc482..6b088a4 100644
@@ -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");

drivers/usb/host/ehci-omap.c static int ehci_hcd_omap_probe(struct platform_device *pdev) · line 221

Quoted 10 lines
drivers/usb/host/ehci-omap.c +3 -7
-		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,

#91 lore raw

PATCH 31/31 USB: ehci-omap: Select NOP USB transceiver driver

In reply to Roger Quadros

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

---
 drivers/usb/host/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/usb/host/Kconfig +1 -0
index 11e102e..2d2975d 100644
@@ -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
Signature · 1 line
1.7.4.1
maintainer Acked-by on v1 31/31
#92 lore raw

Re: [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver

Quoted 14 lines · Roger Quadros

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

---
 drivers/usb/host/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/usb/host/Kconfig +0 -0
index 11e102e..2d2975d 100644

drivers/usb/host/Kconfig config USB_EHCI_MXC · line 163

Quoted 7 lines
drivers/usb/host/Kconfig +1 -0
@@ -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
#93 lore raw

Re: [PATCH 31/31] USB: ehci-omap: Select NOP USB transceiver driver

Quoted 11 lines · Alan Stern
Quoted 9 lines · Roger Quadros

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

---
 drivers/usb/host/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Quoted 14 lines

drivers/usb/host/Kconfig config USB_EHCI_MXC · line 163

Quoted 12 lines
drivers/usb/host/Kconfig +1 -0
index 11e102e..2d2975d 100644
@@ -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
Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130205/915373a1/attachment.sig>
#94 lore raw
In reply to Roger Quadros

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

Quoted 107 lines · Roger Quadros

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(-)
maintainer
#95 lore raw
Quoted 4 lines · Roger Quadros

Hi Tony & Greg,

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

Quoted 8 lines

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

maintainer
#96 lore raw
Quoted 7 lines · Greg KH
Quoted 6 lines · Roger Quadros

Hi Tony & Greg,

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

All patches have been acked by respective maintainers.

Quoted 8 lines
Quoted 6 lines

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

#97 lore raw
Quoted 11 lines · Tony Lindgren
Quoted 10 lines · Greg KH
Quoted 9 lines · Roger Quadros

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?

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

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

maintainer
#98 lore raw
Quoted 18 lines · Roger Quadros
Quoted 17 lines · Tony Lindgren
Quoted 15 lines · Greg KH
Quoted 4 lines · Roger Quadros

Hi Tony & Greg,

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

Quoted 8 lines

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.

Quoted 8 lines
Quoted 3 lines

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.

Quoted 2 lines

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

Quoted 5 lines

[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

maintainer
#99 lore raw
Quoted 23 lines · Tony Lindgren
Quoted 22 lines · Roger Quadros
Quoted 20 lines · Tony Lindgren
Quoted 7 lines · Greg KH
Quoted 6 lines · Roger Quadros

Hi Tony & Greg,

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

All patches have been acked by respective maintainers.

Quoted 8 lines
Quoted 6 lines

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?

Quoted 8 lines
Quoted 4 lines

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

#100 lore raw
In reply to Tony Lindgren
Quoted 32 lines · Tony Lindgren
Quoted 18 lines · Roger Quadros
Quoted 17 lines · Tony Lindgren
Quoted 15 lines · Greg KH
Quoted 4 lines · Roger Quadros

Hi Tony & Greg,

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

Quoted 8 lines

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.

Quoted 8 lines
Quoted 3 lines

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.

Quoted 9 lines
Quoted 2 lines

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