All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
@ 2013-03-07  9:35 Felipe Balbi
  2013-03-07  9:36 ` [PATCH 01/10] usb: otg: prefix otg_state_string with usb_ Felipe Balbi
                   ` (9 more replies)
  0 siblings, 10 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:35 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou, dwmw2, stern, swarren, arnd, linux-tegra,
	linux-omap, Felipe Balbi

Hi folks,

inspired by Paul's DWC2 patchset which added usb_otg_state_string()
(a copy of otg_state_string()) I have now renamed otg_state_string()
to usb_otg_state_string(), moved it to usb-common, then moved all
phy drivers to drivers/usb/phy/ and completely deleted the otg directory.

We're also removing CONFIG_USB_OTG_UTILS since that has lots its
meaning long ago.

I have compiled all patches with allyes, allno and allmod configs,
but please make sure to test on your platforms to make sure we're
not leaking any more problems to mainline.

Felipe Balbi (10):
  usb: otg: prefix otg_state_string with usb_
  usb: otg: move usb_otg_state_string to usb-common.c
  usb: phy: convert EXPORT_SYMBOL to EXPORT_SYMBOL_GPL
  usb: phy: move all PHY drivers to drivers/usb/phy/
  usb: phy: make it a menuconfig
  usb: power: pda_power: check against CONFIG_USB_PHY
  usb: gadget: mv_udc_core: check against CONFIG_USB_PHY
  usb: ehci: marvel: check against CONFIG_USB_PHY
  usb: ehci: tegra: check against CONFIG_USB_PHY
  usb: phy: remove CONFIG_USB_OTG_UTILS

 drivers/Makefile                         |   2 +-
 drivers/power/pda_power.c                |  14 +--
 drivers/usb/Kconfig                      |   2 -
 drivers/usb/Makefile                     |   2 -
 drivers/usb/gadget/mv_udc_core.c         |   2 +-
 drivers/usb/host/ehci-mv.c               |   4 +-
 drivers/usb/host/ehci-tegra.c            |   6 +-
 drivers/usb/musb/am35x.c                 |   8 +-
 drivers/usb/musb/blackfin.c              |   6 +-
 drivers/usb/musb/da8xx.c                 |   8 +-
 drivers/usb/musb/davinci.c               |   4 +-
 drivers/usb/musb/musb_core.c             |  39 ++++----
 drivers/usb/musb/musb_dsps.c             |   8 +-
 drivers/usb/musb/musb_gadget.c           |   8 +-
 drivers/usb/musb/musb_host.c             |   2 +-
 drivers/usb/musb/musb_virthub.c          |   4 +-
 drivers/usb/musb/omap2430.c              |   6 +-
 drivers/usb/musb/tusb6010.c              |  14 +--
 drivers/usb/otg/Kconfig                  | 141 --------------------------
 drivers/usb/otg/Makefile                 |  24 -----
 drivers/usb/otg/otg.c                    |  47 ---------
 drivers/usb/phy/Kconfig                  | 166 ++++++++++++++++++++++++++-----
 drivers/usb/phy/Makefile                 |  26 ++++-
 drivers/usb/{otg => phy}/ab8500-usb.c    |   0
 drivers/usb/{otg => phy}/fsl_otg.c       |   2 +-
 drivers/usb/{otg => phy}/fsl_otg.h       |   0
 drivers/usb/{otg => phy}/gpio_vbus.c     |   0
 drivers/usb/{otg => phy}/isp1301_omap.c  |   6 +-
 drivers/usb/{otg => phy}/msm_otg.c       |   0
 drivers/usb/{otg => phy}/mv_otg.c        |   0
 drivers/usb/{otg => phy}/mv_otg.h        |   0
 drivers/usb/{otg => phy}/mxs-phy.c       |   0
 drivers/usb/{otg => phy}/nop-usb-xceiv.c |   0
 drivers/usb/{otg => phy}/otg_fsm.c       |   2 +-
 drivers/usb/{otg => phy}/otg_fsm.h       |   0
 drivers/usb/phy/phy.c                    |  20 ++--
 drivers/usb/{otg => phy}/twl4030-usb.c   |   0
 drivers/usb/{otg => phy}/twl6030-usb.c   |   0
 drivers/usb/{otg => phy}/ulpi.c          |   0
 drivers/usb/{otg => phy}/ulpi_viewport.c |   0
 drivers/usb/usb-common.c                 |  26 +++++
 include/linux/usb/otg.h                  |   9 +-
 include/linux/usb/phy.h                  |   2 +-
 43 files changed, 274 insertions(+), 336 deletions(-)
 delete mode 100644 drivers/usb/otg/Kconfig
 delete mode 100644 drivers/usb/otg/Makefile
 delete mode 100644 drivers/usb/otg/otg.c
 rename drivers/usb/{otg => phy}/ab8500-usb.c (100%)
 rename drivers/usb/{otg => phy}/fsl_otg.c (99%)
 rename drivers/usb/{otg => phy}/fsl_otg.h (100%)
 rename drivers/usb/{otg => phy}/gpio_vbus.c (100%)
 rename drivers/usb/{otg => phy}/isp1301_omap.c (99%)
 rename drivers/usb/{otg => phy}/msm_otg.c (100%)
 rename drivers/usb/{otg => phy}/mv_otg.c (100%)
 rename drivers/usb/{otg => phy}/mv_otg.h (100%)
 rename drivers/usb/{otg => phy}/mxs-phy.c (100%)
 rename drivers/usb/{otg => phy}/nop-usb-xceiv.c (100%)
 rename drivers/usb/{otg => phy}/otg_fsm.c (99%)
 rename drivers/usb/{otg => phy}/otg_fsm.h (100%)
 rename drivers/usb/{otg => phy}/twl4030-usb.c (100%)
 rename drivers/usb/{otg => phy}/twl6030-usb.c (100%)
 rename drivers/usb/{otg => phy}/ulpi.c (100%)
 rename drivers/usb/{otg => phy}/ulpi_viewport.c (100%)

-- 
1.8.1.rc1.5.g7e0651a


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

* [PATCH 01/10] usb: otg: prefix otg_state_string with usb_
  2013-03-07  9:35 [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Felipe Balbi
@ 2013-03-07  9:36 ` Felipe Balbi
  2013-03-07  9:36 ` [PATCH 02/10] usb: otg: move usb_otg_state_string to usb-common.c Felipe Balbi
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:36 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou, dwmw2, stern, swarren, arnd, linux-tegra,
	linux-omap, Felipe Balbi

all other functions under drivers/usb/ start
with usb_, let's do the same thing.

This patch is in preparation for moving otg_state_string
to usb-common.c and deleting otg.c completely.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/musb/am35x.c        |  8 ++++----
 drivers/usb/musb/blackfin.c     |  6 +++---
 drivers/usb/musb/da8xx.c        |  8 ++++----
 drivers/usb/musb/davinci.c      |  4 ++--
 drivers/usb/musb/musb_core.c    | 39 ++++++++++++++++++++-------------------
 drivers/usb/musb/musb_dsps.c    |  8 ++++----
 drivers/usb/musb/musb_gadget.c  |  8 ++++----
 drivers/usb/musb/musb_host.c    |  2 +-
 drivers/usb/musb/musb_virthub.c |  4 ++--
 drivers/usb/musb/omap2430.c     |  6 +++---
 drivers/usb/musb/tusb6010.c     | 14 +++++++-------
 drivers/usb/otg/fsl_otg.c       |  2 +-
 drivers/usb/otg/isp1301_omap.c  |  6 +++---
 drivers/usb/otg/otg.c           |  4 ++--
 drivers/usb/otg/otg_fsm.c       |  2 +-
 include/linux/usb/otg.h         |  4 ++--
 16 files changed, 63 insertions(+), 62 deletions(-)

diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index 59eea21..2231850 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -149,7 +149,7 @@ static void otg_timer(unsigned long _musb)
 	 */
 	devctl = musb_readb(mregs, MUSB_DEVCTL);
 	dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl,
-		otg_state_string(musb->xceiv->state));
+		usb_otg_state_string(musb->xceiv->state));
 
 	spin_lock_irqsave(&musb->lock, flags);
 	switch (musb->xceiv->state) {
@@ -195,7 +195,7 @@ static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout)
 	if (musb->is_active || (musb->a_wait_bcon == 0 &&
 				musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
 		dev_dbg(musb->controller, "%s active, deleting timer\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 		del_timer(&otg_workaround);
 		last_timer = jiffies;
 		return;
@@ -208,7 +208,7 @@ static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout)
 	last_timer = timeout;
 
 	dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n",
-		otg_state_string(musb->xceiv->state),
+		usb_otg_state_string(musb->xceiv->state),
 		jiffies_to_msecs(timeout - jiffies));
 	mod_timer(&otg_workaround, timeout);
 }
@@ -298,7 +298,7 @@ static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
 		/* NOTE: this must complete power-on within 100 ms. */
 		dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
 				drvvbus ? "on" : "off",
-				otg_state_string(musb->xceiv->state),
+				usb_otg_state_string(musb->xceiv->state),
 				err ? " ERROR" : "",
 				devctl);
 		ret = IRQ_HANDLED;
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c
index dbb31b3..5e63b16 100644
--- a/drivers/usb/musb/blackfin.c
+++ b/drivers/usb/musb/blackfin.c
@@ -280,13 +280,13 @@ static void musb_conn_timer_handler(unsigned long _musb)
 		break;
 	default:
 		dev_dbg(musb->controller, "%s state not handled\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 		break;
 	}
 	spin_unlock_irqrestore(&musb->lock, flags);
 
 	dev_dbg(musb->controller, "state is %s\n",
-		otg_state_string(musb->xceiv->state));
+		usb_otg_state_string(musb->xceiv->state));
 }
 
 static void bfin_musb_enable(struct musb *musb)
@@ -307,7 +307,7 @@ static void bfin_musb_set_vbus(struct musb *musb, int is_on)
 
 	dev_dbg(musb->controller, "VBUS %s, devctl %02x "
 		/* otg %3x conf %08x prcm %08x */ "\n",
-		otg_state_string(musb->xceiv->state),
+		usb_otg_state_string(musb->xceiv->state),
 		musb_readb(musb->mregs, MUSB_DEVCTL));
 }
 
diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c
index 7c71769d..ea7e591 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/drivers/usb/musb/da8xx.c
@@ -198,7 +198,7 @@ static void otg_timer(unsigned long _musb)
 	 */
 	devctl = musb_readb(mregs, MUSB_DEVCTL);
 	dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl,
-		otg_state_string(musb->xceiv->state));
+		usb_otg_state_string(musb->xceiv->state));
 
 	spin_lock_irqsave(&musb->lock, flags);
 	switch (musb->xceiv->state) {
@@ -267,7 +267,7 @@ static void da8xx_musb_try_idle(struct musb *musb, unsigned long timeout)
 	if (musb->is_active || (musb->a_wait_bcon == 0 &&
 				musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
 		dev_dbg(musb->controller, "%s active, deleting timer\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 		del_timer(&otg_workaround);
 		last_timer = jiffies;
 		return;
@@ -280,7 +280,7 @@ static void da8xx_musb_try_idle(struct musb *musb, unsigned long timeout)
 	last_timer = timeout;
 
 	dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n",
-		otg_state_string(musb->xceiv->state),
+		usb_otg_state_string(musb->xceiv->state),
 		jiffies_to_msecs(timeout - jiffies));
 	mod_timer(&otg_workaround, timeout);
 }
@@ -360,7 +360,7 @@ static irqreturn_t da8xx_musb_interrupt(int irq, void *hci)
 
 		dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
 				drvvbus ? "on" : "off",
-				otg_state_string(musb->xceiv->state),
+				usb_otg_state_string(musb->xceiv->state),
 				err ? " ERROR" : "",
 				devctl);
 		ret = IRQ_HANDLED;
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index e040d91..bea6cc3 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -215,7 +215,7 @@ static void otg_timer(unsigned long _musb)
 	 */
 	devctl = musb_readb(mregs, MUSB_DEVCTL);
 	dev_dbg(musb->controller, "poll devctl %02x (%s)\n", devctl,
-		otg_state_string(musb->xceiv->state));
+		usb_otg_state_string(musb->xceiv->state));
 
 	spin_lock_irqsave(&musb->lock, flags);
 	switch (musb->xceiv->state) {
@@ -349,7 +349,7 @@ static irqreturn_t davinci_musb_interrupt(int irq, void *__hci)
 		davinci_musb_source_power(musb, drvvbus, 0);
 		dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
 				drvvbus ? "on" : "off",
-				otg_state_string(musb->xceiv->state),
+				usb_otg_state_string(musb->xceiv->state),
 				err ? " ERROR" : "",
 				devctl);
 		retval = IRQ_HANDLED;
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 48609ea..b37bafc 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -372,13 +372,13 @@ static void musb_otg_timer_func(unsigned long data)
 	case OTG_STATE_A_SUSPEND:
 	case OTG_STATE_A_WAIT_BCON:
 		dev_dbg(musb->controller, "HNP: %s timeout\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 		musb_platform_set_vbus(musb, 0);
 		musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
 		break;
 	default:
 		dev_dbg(musb->controller, "HNP: Unhandled mode %s\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 	}
 	musb->ignore_disconnect = 0;
 	spin_unlock_irqrestore(&musb->lock, flags);
@@ -393,13 +393,14 @@ void musb_hnp_stop(struct musb *musb)
 	void __iomem	*mbase = musb->mregs;
 	u8	reg;
 
-	dev_dbg(musb->controller, "HNP: stop from %s\n", otg_state_string(musb->xceiv->state));
+	dev_dbg(musb->controller, "HNP: stop from %s\n",
+			usb_otg_state_string(musb->xceiv->state));
 
 	switch (musb->xceiv->state) {
 	case OTG_STATE_A_PERIPHERAL:
 		musb_g_disconnect(musb);
 		dev_dbg(musb->controller, "HNP: back to %s\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 		break;
 	case OTG_STATE_B_HOST:
 		dev_dbg(musb->controller, "HNP: Disabling HR\n");
@@ -413,7 +414,7 @@ void musb_hnp_stop(struct musb *musb)
 		break;
 	default:
 		dev_dbg(musb->controller, "HNP: Stopping in unknown state %s\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 	}
 
 	/*
@@ -451,7 +452,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
 	 */
 	if (int_usb & MUSB_INTR_RESUME) {
 		handled = IRQ_HANDLED;
-		dev_dbg(musb->controller, "RESUME (%s)\n", otg_state_string(musb->xceiv->state));
+		dev_dbg(musb->controller, "RESUME (%s)\n", usb_otg_state_string(musb->xceiv->state));
 
 		if (devctl & MUSB_DEVCTL_HM) {
 			void __iomem *mbase = musb->mregs;
@@ -493,7 +494,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
 			default:
 				WARNING("bogus %s RESUME (%s)\n",
 					"host",
-					otg_state_string(musb->xceiv->state));
+					usb_otg_state_string(musb->xceiv->state));
 			}
 		} else {
 			switch (musb->xceiv->state) {
@@ -522,7 +523,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
 			default:
 				WARNING("bogus %s RESUME (%s)\n",
 					"peripheral",
-					otg_state_string(musb->xceiv->state));
+					usb_otg_state_string(musb->xceiv->state));
 			}
 		}
 	}
@@ -538,7 +539,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
 		}
 
 		dev_dbg(musb->controller, "SESSION_REQUEST (%s)\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 
 		/* IRQ arrives from ID pin sense or (later, if VBUS power
 		 * is removed) SRP.  responses are time critical:
@@ -603,7 +604,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
 		}
 
 		dev_dbg(musb->controller, "VBUS_ERROR in %s (%02x, %s), retry #%d, port1 %08x\n",
-				otg_state_string(musb->xceiv->state),
+				usb_otg_state_string(musb->xceiv->state),
 				devctl,
 				({ char *s;
 				switch (devctl & MUSB_DEVCTL_VBUS) {
@@ -628,7 +629,7 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
 
 	if (int_usb & MUSB_INTR_SUSPEND) {
 		dev_dbg(musb->controller, "SUSPEND (%s) devctl %02x\n",
-			otg_state_string(musb->xceiv->state), devctl);
+			usb_otg_state_string(musb->xceiv->state), devctl);
 		handled = IRQ_HANDLED;
 
 		switch (musb->xceiv->state) {
@@ -745,12 +746,12 @@ b_host:
 			usb_hcd_resume_root_hub(hcd);
 
 		dev_dbg(musb->controller, "CONNECT (%s) devctl %02x\n",
-				otg_state_string(musb->xceiv->state), devctl);
+				usb_otg_state_string(musb->xceiv->state), devctl);
 	}
 
 	if ((int_usb & MUSB_INTR_DISCONNECT) && !musb->ignore_disconnect) {
 		dev_dbg(musb->controller, "DISCONNECT (%s) as %s, devctl %02x\n",
-				otg_state_string(musb->xceiv->state),
+				usb_otg_state_string(musb->xceiv->state),
 				MUSB_MODE(musb), devctl);
 		handled = IRQ_HANDLED;
 
@@ -787,7 +788,7 @@ b_host:
 			break;
 		default:
 			WARNING("unhandled DISCONNECT transition (%s)\n",
-				otg_state_string(musb->xceiv->state));
+				usb_otg_state_string(musb->xceiv->state));
 			break;
 		}
 	}
@@ -813,7 +814,7 @@ b_host:
 			}
 		} else {
 			dev_dbg(musb->controller, "BUS RESET as %s\n",
-				otg_state_string(musb->xceiv->state));
+				usb_otg_state_string(musb->xceiv->state));
 			switch (musb->xceiv->state) {
 			case OTG_STATE_A_SUSPEND:
 				/* We need to ignore disconnect on suspend
@@ -826,7 +827,7 @@ b_host:
 			case OTG_STATE_A_WAIT_BCON:	/* OPT TD.4.7-900ms */
 				/* never use invalid T(a_wait_bcon) */
 				dev_dbg(musb->controller, "HNP: in %s, %d msec timeout\n",
-					otg_state_string(musb->xceiv->state),
+					usb_otg_state_string(musb->xceiv->state),
 					TA_WAIT_BCON(musb));
 				mod_timer(&musb->otg_timer, jiffies
 					+ msecs_to_jiffies(TA_WAIT_BCON(musb)));
@@ -838,7 +839,7 @@ b_host:
 				break;
 			case OTG_STATE_B_WAIT_ACON:
 				dev_dbg(musb->controller, "HNP: RESET (%s), to b_peripheral\n",
-					otg_state_string(musb->xceiv->state));
+					usb_otg_state_string(musb->xceiv->state));
 				musb->xceiv->state = OTG_STATE_B_PERIPHERAL;
 				musb_g_reset(musb);
 				break;
@@ -850,7 +851,7 @@ b_host:
 				break;
 			default:
 				dev_dbg(musb->controller, "Unhandled BUS RESET as %s\n",
-					otg_state_string(musb->xceiv->state));
+					usb_otg_state_string(musb->xceiv->state));
 			}
 		}
 	}
@@ -1634,7 +1635,7 @@ musb_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
 	int ret = -EINVAL;
 
 	spin_lock_irqsave(&musb->lock, flags);
-	ret = sprintf(buf, "%s\n", otg_state_string(musb->xceiv->state));
+	ret = sprintf(buf, "%s\n", usb_otg_state_string(musb->xceiv->state));
 	spin_unlock_irqrestore(&musb->lock, flags);
 
 	return ret;
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 4b49874..1ea553d 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -225,7 +225,7 @@ static void otg_timer(unsigned long _musb)
 	 */
 	devctl = dsps_readb(mregs, MUSB_DEVCTL);
 	dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl,
-				otg_state_string(musb->xceiv->state));
+				usb_otg_state_string(musb->xceiv->state));
 
 	spin_lock_irqsave(&musb->lock, flags);
 	switch (musb->xceiv->state) {
@@ -274,7 +274,7 @@ static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
 	if (musb->is_active || (musb->a_wait_bcon == 0 &&
 				musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
 		dev_dbg(musb->controller, "%s active, deleting timer\n",
-				otg_state_string(musb->xceiv->state));
+				usb_otg_state_string(musb->xceiv->state));
 		del_timer(&glue->timer[pdev->id]);
 		glue->last_timer[pdev->id] = jiffies;
 		return;
@@ -289,7 +289,7 @@ static void dsps_musb_try_idle(struct musb *musb, unsigned long timeout)
 	glue->last_timer[pdev->id] = timeout;
 
 	dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n",
-		otg_state_string(musb->xceiv->state),
+		usb_otg_state_string(musb->xceiv->state),
 			jiffies_to_msecs(timeout - jiffies));
 	mod_timer(&glue->timer[pdev->id], timeout);
 }
@@ -378,7 +378,7 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
 		/* NOTE: this must complete power-on within 100 ms. */
 		dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
 				drvvbus ? "on" : "off",
-				otg_state_string(musb->xceiv->state),
+				usb_otg_state_string(musb->xceiv->state),
 				err ? " ERROR" : "",
 				devctl);
 		ret = IRQ_HANDLED;
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 376536e..ccc5872 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1519,7 +1519,7 @@ static int musb_gadget_wakeup(struct usb_gadget *gadget)
 		goto done;
 	default:
 		dev_dbg(musb->controller, "Unhandled wake: %s\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 		goto done;
 	}
 
@@ -1918,7 +1918,7 @@ void musb_g_resume(struct musb *musb)
 		break;
 	default:
 		WARNING("unhandled RESUME transition (%s)\n",
-				otg_state_string(musb->xceiv->state));
+				usb_otg_state_string(musb->xceiv->state));
 	}
 }
 
@@ -1948,7 +1948,7 @@ void musb_g_suspend(struct musb *musb)
 		 * A_PERIPHERAL may need care too
 		 */
 		WARNING("unhandled SUSPEND transition (%s)\n",
-				otg_state_string(musb->xceiv->state));
+				usb_otg_state_string(musb->xceiv->state));
 	}
 }
 
@@ -1982,7 +1982,7 @@ void musb_g_disconnect(struct musb *musb)
 	switch (musb->xceiv->state) {
 	default:
 		dev_dbg(musb->controller, "Unhandled disconnect %s, setting a_idle\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 		musb->xceiv->state = OTG_STATE_A_IDLE;
 		MUSB_HST_MODE(musb);
 		break;
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 1ce1fcf..51e9e8a 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -2453,7 +2453,7 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
 
 	if (musb->is_active) {
 		WARNING("trying to suspend as %s while active\n",
-				otg_state_string(musb->xceiv->state));
+				usb_otg_state_string(musb->xceiv->state));
 		return -EBUSY;
 	} else
 		return 0;
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c
index f705791..ef7d110 100644
--- a/drivers/usb/musb/musb_virthub.c
+++ b/drivers/usb/musb/musb_virthub.c
@@ -95,7 +95,7 @@ static void musb_port_suspend(struct musb *musb, bool do_suspend)
 			break;
 		default:
 			dev_dbg(musb->controller, "bogus rh suspend? %s\n",
-				otg_state_string(musb->xceiv->state));
+				usb_otg_state_string(musb->xceiv->state));
 		}
 	} else if (power & MUSB_POWER_SUSPENDM) {
 		power &= ~MUSB_POWER_SUSPENDM;
@@ -203,7 +203,7 @@ void musb_root_disconnect(struct musb *musb)
 		break;
 	default:
 		dev_dbg(musb->controller, "host disconnect (%s)\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 	}
 }
 
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 1762354..9977fd8 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -117,7 +117,7 @@ static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout)
 	if (musb->is_active || ((musb->a_wait_bcon == 0)
 			&& (musb->xceiv->state == OTG_STATE_A_WAIT_BCON))) {
 		dev_dbg(musb->controller, "%s active, deleting timer\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 		del_timer(&musb_idle_timer);
 		last_timer = jiffies;
 		return;
@@ -134,7 +134,7 @@ static void omap2430_musb_try_idle(struct musb *musb, unsigned long timeout)
 	last_timer = timeout;
 
 	dev_dbg(musb->controller, "%s inactive, for idle timer for %lu ms\n",
-		otg_state_string(musb->xceiv->state),
+		usb_otg_state_string(musb->xceiv->state),
 		(unsigned long)jiffies_to_msecs(timeout - jiffies));
 	mod_timer(&musb_idle_timer, timeout);
 }
@@ -200,7 +200,7 @@ static void omap2430_musb_set_vbus(struct musb *musb, int is_on)
 
 	dev_dbg(musb->controller, "VBUS %s, devctl %02x "
 		/* otg %3x conf %08x prcm %08x */ "\n",
-		otg_state_string(musb->xceiv->state),
+		usb_otg_state_string(musb->xceiv->state),
 		musb_readb(musb->mregs, MUSB_DEVCTL));
 }
 
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c
index 464bd23..7369ba3 100644
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -423,7 +423,7 @@ static void musb_do_idle(unsigned long _musb)
 			&& (musb->idle_timeout == 0
 				|| time_after(jiffies, musb->idle_timeout))) {
 			dev_dbg(musb->controller, "Nothing connected %s, turning off VBUS\n",
-					otg_state_string(musb->xceiv->state));
+					usb_otg_state_string(musb->xceiv->state));
 		}
 		/* FALLTHROUGH */
 	case OTG_STATE_A_IDLE:
@@ -478,7 +478,7 @@ static void tusb_musb_try_idle(struct musb *musb, unsigned long timeout)
 	if (musb->is_active || ((musb->a_wait_bcon == 0)
 			&& (musb->xceiv->state == OTG_STATE_A_WAIT_BCON))) {
 		dev_dbg(musb->controller, "%s active, deleting timer\n",
-			otg_state_string(musb->xceiv->state));
+			usb_otg_state_string(musb->xceiv->state));
 		del_timer(&musb_idle_timer);
 		last_timer = jiffies;
 		return;
@@ -495,7 +495,7 @@ static void tusb_musb_try_idle(struct musb *musb, unsigned long timeout)
 	last_timer = timeout;
 
 	dev_dbg(musb->controller, "%s inactive, for idle timer for %lu ms\n",
-		otg_state_string(musb->xceiv->state),
+		usb_otg_state_string(musb->xceiv->state),
 		(unsigned long)jiffies_to_msecs(timeout - jiffies));
 	mod_timer(&musb_idle_timer, timeout);
 }
@@ -571,7 +571,7 @@ static void tusb_musb_set_vbus(struct musb *musb, int is_on)
 	musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
 
 	dev_dbg(musb->controller, "VBUS %s, devctl %02x otg %3x conf %08x prcm %08x\n",
-		otg_state_string(musb->xceiv->state),
+		usb_otg_state_string(musb->xceiv->state),
 		musb_readb(musb->mregs, MUSB_DEVCTL),
 		musb_readl(tbase, TUSB_DEV_OTG_STAT),
 		conf, prcm);
@@ -678,13 +678,13 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
 				musb->is_active = 0;
 			}
 			dev_dbg(musb->controller, "vbus change, %s, otg %03x\n",
-				otg_state_string(musb->xceiv->state), otg_stat);
+				usb_otg_state_string(musb->xceiv->state), otg_stat);
 			idle_timeout = jiffies + (1 * HZ);
 			schedule_work(&musb->irq_work);
 
 		} else /* A-dev state machine */ {
 			dev_dbg(musb->controller, "vbus change, %s, otg %03x\n",
-				otg_state_string(musb->xceiv->state), otg_stat);
+				usb_otg_state_string(musb->xceiv->state), otg_stat);
 
 			switch (musb->xceiv->state) {
 			case OTG_STATE_A_IDLE:
@@ -733,7 +733,7 @@ tusb_otg_ints(struct musb *musb, u32 int_src, void __iomem *tbase)
 		u8	devctl;
 
 		dev_dbg(musb->controller, "%s timer, %03x\n",
-			otg_state_string(musb->xceiv->state), otg_stat);
+			usb_otg_state_string(musb->xceiv->state), otg_stat);
 
 		switch (musb->xceiv->state) {
 		case OTG_STATE_A_WAIT_VRISE:
diff --git a/drivers/usb/otg/fsl_otg.c b/drivers/usb/otg/fsl_otg.c
index 37e8e15..72a2a00 100644
--- a/drivers/usb/otg/fsl_otg.c
+++ b/drivers/usb/otg/fsl_otg.c
@@ -992,7 +992,7 @@ static int show_fsl_usb2_otg_state(struct device *dev,
 	/* State */
 	t = scnprintf(next, size,
 		      "OTG state: %s\n\n",
-		      otg_state_string(fsl_otg_dev->phy.state));
+		      usb_otg_state_string(fsl_otg_dev->phy.state));
 	size -= t;
 	next += t;
 
diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c
index af9cb11..8fe0c3b 100644
--- a/drivers/usb/otg/isp1301_omap.c
+++ b/drivers/usb/otg/isp1301_omap.c
@@ -236,7 +236,7 @@ isp1301_clear_bits(struct isp1301 *isp, u8 reg, u8 bits)
 
 static inline const char *state_name(struct isp1301 *isp)
 {
-	return otg_state_string(isp->phy.state);
+	return usb_otg_state_string(isp->phy.state);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -481,7 +481,7 @@ static void check_state(struct isp1301 *isp, const char *tag)
 	if (isp->phy.state == state && !extra)
 		return;
 	pr_debug("otg: %s FSM %s/%02x, %s, %06x\n", tag,
-		otg_state_string(state), fsm, state_name(isp),
+		usb_otg_state_string(state), fsm, state_name(isp),
 		omap_readl(OTG_CTRL));
 }
 
@@ -1077,7 +1077,7 @@ static void isp_update_otg(struct isp1301 *isp, u8 stat)
 
 	if (state != isp->phy.state)
 		pr_debug("  isp, %s -> %s\n",
-				otg_state_string(state), state_name(isp));
+				usb_otg_state_string(state), state_name(isp));
 
 #ifdef	CONFIG_USB_OTG
 	/* update the OTG controller state to match the isp1301; may
diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
index 358cfd9..fd9a4b7 100644
--- a/drivers/usb/otg/otg.c
+++ b/drivers/usb/otg/otg.c
@@ -11,7 +11,7 @@
 #include <linux/export.h>
 #include <linux/usb/otg.h>
 
-const char *otg_state_string(enum usb_otg_state state)
+const char *usb_otg_state_string(enum usb_otg_state state)
 {
 	switch (state) {
 	case OTG_STATE_A_IDLE:
@@ -44,4 +44,4 @@ const char *otg_state_string(enum usb_otg_state state)
 		return "UNDEFINED";
 	}
 }
-EXPORT_SYMBOL(otg_state_string);
+EXPORT_SYMBOL(usb_otg_state_string);
diff --git a/drivers/usb/otg/otg_fsm.c b/drivers/usb/otg/otg_fsm.c
index ade131a..1f729a1 100644
--- a/drivers/usb/otg/otg_fsm.c
+++ b/drivers/usb/otg/otg_fsm.c
@@ -119,7 +119,7 @@ int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
 	state_changed = 1;
 	if (fsm->otg->phy->state == new_state)
 		return 0;
-	VDBG("Set state: %s\n", otg_state_string(new_state));
+	VDBG("Set state: %s\n", usb_otg_state_string(new_state));
 	otg_leave_state(fsm, fsm->otg->phy->state);
 	switch (new_state) {
 	case OTG_STATE_B_IDLE:
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index e8a5fe8..9f9fb39 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -37,9 +37,9 @@ struct usb_otg {
 };
 
 #ifdef CONFIG_USB_OTG_UTILS
-extern const char *otg_state_string(enum usb_otg_state state);
+extern const char *usb_otg_state_string(enum usb_otg_state state);
 #else
-static inline const char *otg_state_string(enum usb_otg_state state)
+static inline const char *usb_otg_state_string(enum usb_otg_state state)
 {
 	return NULL;
 }
-- 
1.8.1.rc1.5.g7e0651a


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

* [PATCH 02/10] usb: otg: move usb_otg_state_string to usb-common.c
  2013-03-07  9:35 [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Felipe Balbi
  2013-03-07  9:36 ` [PATCH 01/10] usb: otg: prefix otg_state_string with usb_ Felipe Balbi
@ 2013-03-07  9:36 ` Felipe Balbi
  2013-03-07  9:36 ` [PATCH 03/10] usb: phy: convert EXPORT_SYMBOL to EXPORT_SYMBOL_GPL Felipe Balbi
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:36 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou, dwmw2, stern, swarren, arnd, linux-tegra,
	linux-omap, Felipe Balbi

otg.c only had a single function definition
which might make more sense to be placed in
usb-common.c. While doing that, we also delete
otg.c since it's now empty.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/otg/Makefile |  3 ---
 drivers/usb/otg/otg.c    | 47 -----------------------------------------------
 drivers/usb/usb-common.c | 26 ++++++++++++++++++++++++++
 include/linux/usb/otg.h  |  7 -------
 4 files changed, 26 insertions(+), 57 deletions(-)
 delete mode 100644 drivers/usb/otg/otg.c

diff --git a/drivers/usb/otg/Makefile b/drivers/usb/otg/Makefile
index a844b8d..6abc453 100644
--- a/drivers/usb/otg/Makefile
+++ b/drivers/usb/otg/Makefile
@@ -5,9 +5,6 @@
 ccflags-$(CONFIG_USB_DEBUG)		:= -DDEBUG
 ccflags-$(CONFIG_USB_GADGET_DEBUG)	+= -DDEBUG
 
-# infrastructure
-obj-$(CONFIG_USB_OTG_UTILS)	+= otg.o
-
 # transceiver drivers
 obj-$(CONFIG_USB_GPIO_VBUS)	+= gpio_vbus.o
 obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_omap.o
diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
deleted file mode 100644
index fd9a4b7..0000000
--- a/drivers/usb/otg/otg.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * otg.c -- USB OTG utility code
- *
- * Copyright (C) 2004 Texas Instruments
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-#include <linux/export.h>
-#include <linux/usb/otg.h>
-
-const char *usb_otg_state_string(enum usb_otg_state state)
-{
-	switch (state) {
-	case OTG_STATE_A_IDLE:
-		return "a_idle";
-	case OTG_STATE_A_WAIT_VRISE:
-		return "a_wait_vrise";
-	case OTG_STATE_A_WAIT_BCON:
-		return "a_wait_bcon";
-	case OTG_STATE_A_HOST:
-		return "a_host";
-	case OTG_STATE_A_SUSPEND:
-		return "a_suspend";
-	case OTG_STATE_A_PERIPHERAL:
-		return "a_peripheral";
-	case OTG_STATE_A_WAIT_VFALL:
-		return "a_wait_vfall";
-	case OTG_STATE_A_VBUS_ERR:
-		return "a_vbus_err";
-	case OTG_STATE_B_IDLE:
-		return "b_idle";
-	case OTG_STATE_B_SRP_INIT:
-		return "b_srp_init";
-	case OTG_STATE_B_PERIPHERAL:
-		return "b_peripheral";
-	case OTG_STATE_B_WAIT_ACON:
-		return "b_wait_acon";
-	case OTG_STATE_B_HOST:
-		return "b_host";
-	default:
-		return "UNDEFINED";
-	}
-}
-EXPORT_SYMBOL(usb_otg_state_string);
diff --git a/drivers/usb/usb-common.c b/drivers/usb/usb-common.c
index 070b681..0db0a91 100644
--- a/drivers/usb/usb-common.c
+++ b/drivers/usb/usb-common.c
@@ -14,6 +14,32 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/usb/ch9.h>
+#include <linux/usb/otg.h>
+
+const char *usb_otg_state_string(enum usb_otg_state state)
+{
+	static const char *const names[] = {
+		[OTG_STATE_A_IDLE] = "a_idle",
+		[OTG_STATE_A_WAIT_VRISE] = "a_wait_vrise",
+		[OTG_STATE_A_WAIT_BCON] = "a_wait_bcon",
+		[OTG_STATE_A_HOST] = "a_host",
+		[OTG_STATE_A_SUSPEND] = "a_suspend",
+		[OTG_STATE_A_PERIPHERAL] = "a_peripheral",
+		[OTG_STATE_A_WAIT_VFALL] = "a_wait_vfall",
+		[OTG_STATE_A_VBUS_ERR] = "a_vbus_err",
+		[OTG_STATE_B_IDLE] = "b_idle",
+		[OTG_STATE_B_SRP_INIT] = "b_srp_init",
+		[OTG_STATE_B_PERIPHERAL] = "b_peripheral",
+		[OTG_STATE_B_WAIT_ACON] = "b_wait_acon",
+		[OTG_STATE_B_HOST] = "b_host",
+	};
+
+	if (state < 0 || state >= ARRAY_SIZE(names))
+		return "UNDEFINED";
+
+	return names[state];
+}
+EXPORT_SYMBOL_GPL(usb_otg_state_string);
 
 const char *usb_speed_string(enum usb_device_speed speed)
 {
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 9f9fb39..291e01b 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -36,14 +36,7 @@ struct usb_otg {
 
 };
 
-#ifdef CONFIG_USB_OTG_UTILS
 extern const char *usb_otg_state_string(enum usb_otg_state state);
-#else
-static inline const char *usb_otg_state_string(enum usb_otg_state state)
-{
-	return NULL;
-}
-#endif
 
 /* Context: can sleep */
 static inline int
-- 
1.8.1.rc1.5.g7e0651a


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

* [PATCH 03/10] usb: phy: convert EXPORT_SYMBOL to EXPORT_SYMBOL_GPL
  2013-03-07  9:35 [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Felipe Balbi
  2013-03-07  9:36 ` [PATCH 01/10] usb: otg: prefix otg_state_string with usb_ Felipe Balbi
  2013-03-07  9:36 ` [PATCH 02/10] usb: otg: move usb_otg_state_string to usb-common.c Felipe Balbi
@ 2013-03-07  9:36 ` Felipe Balbi
  2013-03-07  9:36 ` [PATCH 04/10] usb: phy: move all PHY drivers to drivers/usb/phy/ Felipe Balbi
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:36 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou, dwmw2, stern, swarren, arnd, linux-tegra,
	linux-omap, Felipe Balbi

we only want GPL users for our generic functions,
so let's switch over to EXPORT_SYMBOL_GPL.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/phy/phy.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index bc1970c..f52c006 100644
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -109,7 +109,7 @@ struct usb_phy *devm_usb_get_phy(struct device *dev, enum usb_phy_type type)
 
 	return phy;
 }
-EXPORT_SYMBOL(devm_usb_get_phy);
+EXPORT_SYMBOL_GPL(devm_usb_get_phy);
 
 /**
  * usb_get_phy - find the USB PHY
@@ -142,7 +142,7 @@ err0:
 
 	return phy;
 }
-EXPORT_SYMBOL(usb_get_phy);
+EXPORT_SYMBOL_GPL(usb_get_phy);
 
  /**
  * devm_usb_get_phy_by_phandle - find the USB PHY by phandle
@@ -206,7 +206,7 @@ err0:
 
 	return phy;
 }
-EXPORT_SYMBOL(devm_usb_get_phy_by_phandle);
+EXPORT_SYMBOL_GPL(devm_usb_get_phy_by_phandle);
 
 /**
  * usb_get_phy_dev - find the USB PHY
@@ -239,7 +239,7 @@ err0:
 
 	return phy;
 }
-EXPORT_SYMBOL(usb_get_phy_dev);
+EXPORT_SYMBOL_GPL(usb_get_phy_dev);
 
 /**
  * devm_usb_get_phy_dev - find the USB PHY using device ptr and index
@@ -269,7 +269,7 @@ struct usb_phy *devm_usb_get_phy_dev(struct device *dev, u8 index)
 
 	return phy;
 }
-EXPORT_SYMBOL(devm_usb_get_phy_dev);
+EXPORT_SYMBOL_GPL(devm_usb_get_phy_dev);
 
 /**
  * devm_usb_put_phy - release the USB PHY
@@ -288,7 +288,7 @@ void devm_usb_put_phy(struct device *dev, struct usb_phy *phy)
 	r = devres_destroy(dev, devm_usb_phy_release, devm_usb_phy_match, phy);
 	dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n");
 }
-EXPORT_SYMBOL(devm_usb_put_phy);
+EXPORT_SYMBOL_GPL(devm_usb_put_phy);
 
 /**
  * usb_put_phy - release the USB PHY
@@ -307,7 +307,7 @@ void usb_put_phy(struct usb_phy *x)
 		module_put(owner);
 	}
 }
-EXPORT_SYMBOL(usb_put_phy);
+EXPORT_SYMBOL_GPL(usb_put_phy);
 
 /**
  * usb_add_phy - declare the USB PHY
@@ -347,7 +347,7 @@ out:
 	spin_unlock_irqrestore(&phy_lock, flags);
 	return ret;
 }
-EXPORT_SYMBOL(usb_add_phy);
+EXPORT_SYMBOL_GPL(usb_add_phy);
 
 /**
  * usb_add_phy_dev - declare the USB PHY
@@ -377,7 +377,7 @@ int usb_add_phy_dev(struct usb_phy *x)
 	spin_unlock_irqrestore(&phy_lock, flags);
 	return 0;
 }
-EXPORT_SYMBOL(usb_add_phy_dev);
+EXPORT_SYMBOL_GPL(usb_add_phy_dev);
 
 /**
  * usb_remove_phy - remove the OTG PHY
@@ -399,7 +399,7 @@ void usb_remove_phy(struct usb_phy *x)
 	}
 	spin_unlock_irqrestore(&phy_lock, flags);
 }
-EXPORT_SYMBOL(usb_remove_phy);
+EXPORT_SYMBOL_GPL(usb_remove_phy);
 
 /**
  * usb_bind_phy - bind the phy and the controller that uses the phy
-- 
1.8.1.rc1.5.g7e0651a


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

* [PATCH 04/10] usb: phy: move all PHY drivers to drivers/usb/phy/
  2013-03-07  9:35 [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Felipe Balbi
                   ` (2 preceding siblings ...)
  2013-03-07  9:36 ` [PATCH 03/10] usb: phy: convert EXPORT_SYMBOL to EXPORT_SYMBOL_GPL Felipe Balbi
@ 2013-03-07  9:36 ` Felipe Balbi
  2013-03-07  9:36 ` [PATCH 05/10] usb: phy: make it a menuconfig Felipe Balbi
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:36 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou, dwmw2, stern, swarren, arnd, linux-tegra,
	linux-omap, Felipe Balbi

that's a much more reasonable location for
those drivers. It helps us saving drivers/usb/otg/
for when we actually start adding generic OTG
code.

Also completely delete drivers/usb/otg/ as there's
nothing left there.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/Kconfig                      |   2 -
 drivers/usb/Makefile                     |   2 -
 drivers/usb/otg/Kconfig                  | 141 --------------------------
 drivers/usb/otg/Makefile                 |  21 ----
 drivers/usb/phy/Kconfig                  | 168 +++++++++++++++++++++++++++----
 drivers/usb/phy/Makefile                 |  24 ++++-
 drivers/usb/{otg => phy}/ab8500-usb.c    |   0
 drivers/usb/{otg => phy}/fsl_otg.c       |   0
 drivers/usb/{otg => phy}/fsl_otg.h       |   0
 drivers/usb/{otg => phy}/gpio_vbus.c     |   0
 drivers/usb/{otg => phy}/isp1301_omap.c  |   0
 drivers/usb/{otg => phy}/msm_otg.c       |   0
 drivers/usb/{otg => phy}/mv_otg.c        |   0
 drivers/usb/{otg => phy}/mv_otg.h        |   0
 drivers/usb/{otg => phy}/mxs-phy.c       |   0
 drivers/usb/{otg => phy}/nop-usb-xceiv.c |   0
 drivers/usb/{otg => phy}/otg_fsm.c       |   0
 drivers/usb/{otg => phy}/otg_fsm.h       |   0
 drivers/usb/{otg => phy}/twl4030-usb.c   |   0
 drivers/usb/{otg => phy}/twl6030-usb.c   |   0
 drivers/usb/{otg => phy}/ulpi.c          |   0
 drivers/usb/{otg => phy}/ulpi_viewport.c |   0
 22 files changed, 171 insertions(+), 187 deletions(-)
 delete mode 100644 drivers/usb/otg/Kconfig
 delete mode 100644 drivers/usb/otg/Makefile
 rename drivers/usb/{otg => phy}/ab8500-usb.c (100%)
 rename drivers/usb/{otg => phy}/fsl_otg.c (100%)
 rename drivers/usb/{otg => phy}/fsl_otg.h (100%)
 rename drivers/usb/{otg => phy}/gpio_vbus.c (100%)
 rename drivers/usb/{otg => phy}/isp1301_omap.c (100%)
 rename drivers/usb/{otg => phy}/msm_otg.c (100%)
 rename drivers/usb/{otg => phy}/mv_otg.c (100%)
 rename drivers/usb/{otg => phy}/mv_otg.h (100%)
 rename drivers/usb/{otg => phy}/mxs-phy.c (100%)
 rename drivers/usb/{otg => phy}/nop-usb-xceiv.c (100%)
 rename drivers/usb/{otg => phy}/otg_fsm.c (100%)
 rename drivers/usb/{otg => phy}/otg_fsm.h (100%)
 rename drivers/usb/{otg => phy}/twl4030-usb.c (100%)
 rename drivers/usb/{otg => phy}/twl6030-usb.c (100%)
 rename drivers/usb/{otg => phy}/ulpi.c (100%)
 rename drivers/usb/{otg => phy}/ulpi_viewport.c (100%)

diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 640ae6c..2c481b8 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -186,6 +186,4 @@ source "drivers/usb/atm/Kconfig"
 
 source "drivers/usb/gadget/Kconfig"
 
-source "drivers/usb/otg/Kconfig"
-
 endif # USB_SUPPORT
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index f5ed3d7..5aa98f0 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -6,8 +6,6 @@
 
 obj-$(CONFIG_USB)		+= core/
 
-obj-$(CONFIG_USB_OTG_UTILS)	+= otg/
-
 obj-$(CONFIG_USB_DWC3)		+= dwc3/
 
 obj-$(CONFIG_USB_MON)		+= mon/
diff --git a/drivers/usb/otg/Kconfig b/drivers/usb/otg/Kconfig
deleted file mode 100644
index 37962c9..0000000
--- a/drivers/usb/otg/Kconfig
+++ /dev/null
@@ -1,141 +0,0 @@
-#
-# USB OTG infrastructure may be needed for peripheral-only, host-only,
-# or OTG-capable configurations when OTG transceivers or controllers
-# are used.
-#
-
-comment "OTG and related infrastructure"
-
-config USB_OTG_UTILS
-	bool
-	help
-	  Select this to make sure the build includes objects from
-	  the OTG infrastructure directory.
-
-if USB || USB_GADGET
-
-#
-# USB Transceiver Drivers
-#
-config USB_GPIO_VBUS
-	tristate "GPIO based peripheral-only VBUS sensing 'transceiver'"
-	depends on GENERIC_GPIO
-	select USB_OTG_UTILS
-	help
-	  Provides simple GPIO VBUS sensing for controllers with an
-	  internal transceiver via the usb_phy interface, and
-	  optionally control of a D+ pullup GPIO as well as a VBUS
-	  current limit regulator.
-
-config ISP1301_OMAP
-	tristate "Philips ISP1301 with OMAP OTG"
-	depends on I2C && ARCH_OMAP_OTG
-	select USB_OTG_UTILS
-	help
-	  If you say yes here you get support for the Philips ISP1301
-	  USB-On-The-Go transceiver working with the OMAP OTG controller.
-	  The ISP1301 is a full speed USB  transceiver which is used in
-	  products including H2, H3, and H4 development boards for Texas
-	  Instruments OMAP processors.
-
-	  This driver can also be built as a module.  If so, the module
-	  will be called isp1301_omap.
-
-config USB_ULPI
-	bool "Generic ULPI Transceiver Driver"
-	depends on ARM
-	select USB_OTG_UTILS
-	help
-	  Enable this to support ULPI connected USB OTG transceivers which
-	  are likely found on embedded boards.
-
-config USB_ULPI_VIEWPORT
-	bool
-	depends on USB_ULPI
-	help
-	  Provides read/write operations to the ULPI phy register set for
-	  controllers with a viewport register (e.g. Chipidea/ARC controllers).
-
-config TWL4030_USB
-	tristate "TWL4030 USB Transceiver Driver"
-	depends on TWL4030_CORE && REGULATOR_TWL4030 && USB_MUSB_OMAP2PLUS
-	select USB_OTG_UTILS
-	help
-	  Enable this to support the USB OTG transceiver on TWL4030
-	  family chips (including the TWL5030 and TPS659x0 devices).
-	  This transceiver supports high and full speed devices plus,
-	  in host mode, low speed.
-
-config TWL6030_USB
-	tristate "TWL6030 USB Transceiver Driver"
-	depends on TWL4030_CORE && OMAP_USB2 && USB_MUSB_OMAP2PLUS
-	select USB_OTG_UTILS
-	help
-	  Enable this to support the USB OTG transceiver on TWL6030
-	  family chips. This TWL6030 transceiver has the VBUS and ID GND
-	  and OTG SRP events capabilities. For all other transceiver functionality
-	  UTMI PHY is embedded in OMAP4430. The internal PHY configurations APIs
-	  are hooked to this driver through platform_data structure.
-	  The definition of internal PHY APIs are in the mach-omap2 layer.
-
-config NOP_USB_XCEIV
-	tristate "NOP USB Transceiver Driver"
-	select USB_OTG_UTILS
-	help
-	  This driver is to be used by all the usb transceiver which are either
-	  built-in with usb ip or which are autonomous and doesn't require any
-	  phy programming such as ISP1x04 etc.
-
-config USB_MSM_OTG
-	tristate "OTG support for Qualcomm on-chip USB controller"
-	depends on (USB || USB_GADGET) && ARCH_MSM
-	select USB_OTG_UTILS
-	help
-	  Enable this to support the USB OTG transceiver on MSM chips. It
-	  handles PHY initialization, clock management, and workarounds
-	  required after resetting the hardware and power management.
-	  This driver is required even for peripheral only or host only
-	  mode configurations.
-	  This driver is not supported on boards like trout which
-	  has an external PHY.
-
-config AB8500_USB
-	tristate "AB8500 USB Transceiver Driver"
-	depends on AB8500_CORE
-	select USB_OTG_UTILS
-	help
-	  Enable this to support the USB OTG transceiver in AB8500 chip.
-	  This transceiver supports high and full speed devices plus,
-	  in host mode, low speed.
-
-config FSL_USB2_OTG
-	bool "Freescale USB OTG Transceiver Driver"
-	depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_SUSPEND
-	select USB_OTG
-	select USB_OTG_UTILS
-	help
-	  Enable this to support Freescale USB OTG transceiver.
-
-config USB_MXS_PHY
-	tristate "Freescale MXS USB PHY support"
-	depends on ARCH_MXC || ARCH_MXS
-	select STMP_DEVICE
-	select USB_OTG_UTILS
-	help
-	  Enable this to support the Freescale MXS USB PHY.
-
-	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
-
-config USB_MV_OTG
-	tristate "Marvell USB OTG support"
-	depends on USB_EHCI_MV && USB_MV_UDC && USB_SUSPEND
-	select USB_OTG
-	select USB_OTG_UTILS
-	help
-	  Say Y here if you want to build Marvell USB OTG transciever
-	  driver in kernel (including PXA and MMP series). This driver
-	  implements role switch between EHCI host driver and gadget driver.
-
-	  To compile this driver as a module, choose M here.
-
-endif # USB || OTG
diff --git a/drivers/usb/otg/Makefile b/drivers/usb/otg/Makefile
deleted file mode 100644
index 6abc453..0000000
--- a/drivers/usb/otg/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# OTG infrastructure and transceiver drivers
-#
-
-ccflags-$(CONFIG_USB_DEBUG)		:= -DDEBUG
-ccflags-$(CONFIG_USB_GADGET_DEBUG)	+= -DDEBUG
-
-# transceiver drivers
-obj-$(CONFIG_USB_GPIO_VBUS)	+= gpio_vbus.o
-obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_omap.o
-obj-$(CONFIG_TWL4030_USB)	+= twl4030-usb.o
-obj-$(CONFIG_TWL6030_USB)	+= twl6030-usb.o
-obj-$(CONFIG_NOP_USB_XCEIV)	+= nop-usb-xceiv.o
-obj-$(CONFIG_USB_ULPI)		+= ulpi.o
-obj-$(CONFIG_USB_ULPI_VIEWPORT)	+= ulpi_viewport.o
-obj-$(CONFIG_USB_MSM_OTG)	+= msm_otg.o
-obj-$(CONFIG_AB8500_USB)	+= ab8500-usb.o
-fsl_usb2_otg-objs		:= fsl_otg.o otg_fsm.o
-obj-$(CONFIG_FSL_USB2_OTG)	+= fsl_usb2_otg.o
-obj-$(CONFIG_USB_MXS_PHY)	+= mxs-phy.o
-obj-$(CONFIG_USB_MV_OTG)	+= mv_otg.o
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 65217a5..32ce740 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -4,6 +4,73 @@
 comment "USB Physical Layer drivers"
 	depends on USB || USB_GADGET
 
+config USB_OTG_UTILS
+	bool
+	help
+	  Select this to make sure the build includes objects from
+	  the OTG infrastructure directory.
+
+if USB || USB_GADGET
+
+#
+# USB Transceiver Drivers
+#
+config AB8500_USB
+	tristate "AB8500 USB Transceiver Driver"
+	depends on AB8500_CORE
+	select USB_OTG_UTILS
+	help
+	  Enable this to support the USB OTG transceiver in AB8500 chip.
+	  This transceiver supports high and full speed devices plus,
+	  in host mode, low speed.
+
+config FSL_USB2_OTG
+	bool "Freescale USB OTG Transceiver Driver"
+	depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_SUSPEND
+	select USB_OTG
+	select USB_OTG_UTILS
+	help
+	  Enable this to support Freescale USB OTG transceiver.
+
+config ISP1301_OMAP
+	tristate "Philips ISP1301 with OMAP OTG"
+	depends on I2C && ARCH_OMAP_OTG
+	select USB_OTG_UTILS
+	help
+	  If you say yes here you get support for the Philips ISP1301
+	  USB-On-The-Go transceiver working with the OMAP OTG controller.
+	  The ISP1301 is a full speed USB  transceiver which is used in
+	  products including H2, H3, and H4 development boards for Texas
+	  Instruments OMAP processors.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called isp1301_omap.
+
+config MV_U3D_PHY
+	bool "Marvell USB 3.0 PHY controller Driver"
+	depends on USB_MV_U3D
+	select USB_OTG_UTILS
+	help
+	  Enable this to support Marvell USB 3.0 phy controller for Marvell
+	  SoC.
+
+config NOP_USB_XCEIV
+	tristate "NOP USB Transceiver Driver"
+	select USB_OTG_UTILS
+	help
+	  This driver is to be used by all the usb transceiver which are either
+	  built-in with usb ip or which are autonomous and doesn't require any
+	  phy programming such as ISP1x04 etc.
+
+config OMAP_CONTROL_USB
+	tristate "OMAP CONTROL USB Driver"
+	help
+	  Enable this to add support for the USB part present in the control
+	  module. This driver has API to power on the USB2 PHY and to write to
+	  the mailbox. The mailbox is present only in omap4 and the register to
+	  power on the USB2 PHY is present in OMAP4 and OMAP5. OMAP5 has an
+	  additional register to power on USB3 PHY.
+
 config OMAP_USB2
 	tristate "OMAP USB2 PHY Driver"
 	depends on ARCH_OMAP2PLUS
@@ -25,14 +92,45 @@ config OMAP_USB3
 	  This driver interacts with the "OMAP Control USB Driver" to power
 	  on/off the PHY.
 
-config OMAP_CONTROL_USB
-	tristate "OMAP CONTROL USB Driver"
+config SAMSUNG_USBPHY
+	bool "Samsung USB PHY controller Driver"
+	depends on USB_S3C_HSOTG || USB_EHCI_S5P || USB_OHCI_EXYNOS
+	select USB_OTG_UTILS
 	help
-	  Enable this to add support for the USB part present in the control
-	  module. This driver has API to power on the USB2 PHY and to write to
-	  the mailbox. The mailbox is present only in omap4 and the register to
-	  power on the USB2 PHY is present in OMAP4 and OMAP5. OMAP5 has an
-	  additional register to power on USB3 PHY.
+	  Enable this to support Samsung USB phy controller for samsung
+	  SoCs.
+
+config TWL4030_USB
+	tristate "TWL4030 USB Transceiver Driver"
+	depends on TWL4030_CORE && REGULATOR_TWL4030 && USB_MUSB_OMAP2PLUS
+	select USB_OTG_UTILS
+	help
+	  Enable this to support the USB OTG transceiver on TWL4030
+	  family chips (including the TWL5030 and TPS659x0 devices).
+	  This transceiver supports high and full speed devices plus,
+	  in host mode, low speed.
+
+config TWL6030_USB
+	tristate "TWL6030 USB Transceiver Driver"
+	depends on TWL4030_CORE && OMAP_USB2 && USB_MUSB_OMAP2PLUS
+	select USB_OTG_UTILS
+	help
+	  Enable this to support the USB OTG transceiver on TWL6030
+	  family chips. This TWL6030 transceiver has the VBUS and ID GND
+	  and OTG SRP events capabilities. For all other transceiver functionality
+	  UTMI PHY is embedded in OMAP4430. The internal PHY configurations APIs
+	  are hooked to this driver through platform_data structure.
+	  The definition of internal PHY APIs are in the mach-omap2 layer.
+
+config USB_GPIO_VBUS
+	tristate "GPIO based peripheral-only VBUS sensing 'transceiver'"
+	depends on GENERIC_GPIO
+	select USB_OTG_UTILS
+	help
+	  Provides simple GPIO VBUS sensing for controllers with an
+	  internal transceiver via the usb_phy interface, and
+	  optionally control of a D+ pullup GPIO as well as a VBUS
+	  current limit regulator.
 
 config USB_ISP1301
 	tristate "NXP ISP1301 USB transceiver support"
@@ -46,13 +144,40 @@ config USB_ISP1301
 	  To compile this driver as a module, choose M here: the
 	  module will be called isp1301.
 
-config MV_U3D_PHY
-	bool "Marvell USB 3.0 PHY controller Driver"
-	depends on USB_MV_U3D
+config USB_MSM_OTG
+	tristate "OTG support for Qualcomm on-chip USB controller"
+	depends on (USB || USB_GADGET) && ARCH_MSM
 	select USB_OTG_UTILS
 	help
-	  Enable this to support Marvell USB 3.0 phy controller for Marvell
-	  SoC.
+	  Enable this to support the USB OTG transceiver on MSM chips. It
+	  handles PHY initialization, clock management, and workarounds
+	  required after resetting the hardware and power management.
+	  This driver is required even for peripheral only or host only
+	  mode configurations.
+	  This driver is not supported on boards like trout which
+	  has an external PHY.
+
+config USB_MV_OTG
+	tristate "Marvell USB OTG support"
+	depends on USB_EHCI_MV && USB_MV_UDC && USB_SUSPEND
+	select USB_OTG
+	select USB_OTG_UTILS
+	help
+	  Say Y here if you want to build Marvell USB OTG transciever
+	  driver in kernel (including PXA and MMP series). This driver
+	  implements role switch between EHCI host driver and gadget driver.
+
+	  To compile this driver as a module, choose M here.
+
+config USB_MXS_PHY
+	tristate "Freescale MXS USB PHY support"
+	depends on ARCH_MXC || ARCH_MXS
+	select STMP_DEVICE
+	select USB_OTG_UTILS
+	help
+	  Enable this to support the Freescale MXS USB PHY.
+
+	  MXS Phy is used by some of the i.MX SoCs, for example imx23/28/6x.
 
 config USB_RCAR_PHY
 	tristate "Renesas R-Car USB phy support"
@@ -66,10 +191,19 @@ config USB_RCAR_PHY
 	  To compile this driver as a module, choose M here: the
 	  module will be called rcar-phy.
 
-config SAMSUNG_USBPHY
-	bool "Samsung USB PHY controller Driver"
-	depends on USB_S3C_HSOTG || USB_EHCI_S5P || USB_OHCI_EXYNOS
+config USB_ULPI
+	bool "Generic ULPI Transceiver Driver"
+	depends on ARM
 	select USB_OTG_UTILS
 	help
-	  Enable this to support Samsung USB phy controller for samsung
-	  SoCs.
+	  Enable this to support ULPI connected USB OTG transceivers which
+	  are likely found on embedded boards.
+
+config USB_ULPI_VIEWPORT
+	bool
+	depends on USB_ULPI
+	help
+	  Provides read/write operations to the ULPI phy register set for
+	  controllers with a viewport register (e.g. Chipidea/ARC controllers).
+
+endif # USB || OTG
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index 9fa6327..34488ce 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -5,11 +5,27 @@
 ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
 
 obj-$(CONFIG_USB_OTG_UTILS)		+= phy.o
+
+# transceiver drivers, keep the list sorted
+
+obj-$(CONFIG_AB8500_USB)		+= ab8500-usb.o
+fsl_usb2_otg-objs			:= fsl_otg.o otg_fsm.o
+obj-$(CONFIG_FSL_USB2_OTG)		+= fsl_usb2_otg.o
+obj-$(CONFIG_ISP1301_OMAP)		+= isp1301_omap.o
+obj-$(CONFIG_MV_U3D_PHY)		+= mv_u3d_phy.o
+obj-$(CONFIG_NOP_USB_XCEIV)		+= nop-usb-xceiv.o
+obj-$(CONFIG_OMAP_CONTROL_USB)		+= omap-control-usb.o
 obj-$(CONFIG_OMAP_USB2)			+= omap-usb2.o
 obj-$(CONFIG_OMAP_USB3)			+= omap-usb3.o
-obj-$(CONFIG_OMAP_CONTROL_USB)		+= omap-control-usb.o
+obj-$(CONFIG_SAMSUNG_USBPHY)		+= samsung-usbphy.o
+obj-$(CONFIG_TWL4030_USB)		+= twl4030-usb.o
+obj-$(CONFIG_TWL6030_USB)		+= twl6030-usb.o
+obj-$(CONFIG_USB_EHCI_TEGRA)		+= tegra_usb_phy.o
+obj-$(CONFIG_USB_GPIO_VBUS)		+= gpio_vbus.o
 obj-$(CONFIG_USB_ISP1301)		+= isp1301.o
-obj-$(CONFIG_MV_U3D_PHY)		+= mv_u3d_phy.o
-obj-$(CONFIG_USB_EHCI_TEGRA)	+= tegra_usb_phy.o
+obj-$(CONFIG_USB_MSM_OTG)		+= msm_otg.o
+obj-$(CONFIG_USB_MV_OTG)		+= mv_otg.o
+obj-$(CONFIG_USB_MXS_PHY)		+= mxs-phy.o
 obj-$(CONFIG_USB_RCAR_PHY)		+= rcar-phy.o
-obj-$(CONFIG_SAMSUNG_USBPHY)		+= samsung-usbphy.o
+obj-$(CONFIG_USB_ULPI)			+= ulpi.o
+obj-$(CONFIG_USB_ULPI_VIEWPORT)		+= ulpi_viewport.o
diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/phy/ab8500-usb.c
similarity index 100%
rename from drivers/usb/otg/ab8500-usb.c
rename to drivers/usb/phy/ab8500-usb.c
diff --git a/drivers/usb/otg/fsl_otg.c b/drivers/usb/phy/fsl_otg.c
similarity index 100%
rename from drivers/usb/otg/fsl_otg.c
rename to drivers/usb/phy/fsl_otg.c
diff --git a/drivers/usb/otg/fsl_otg.h b/drivers/usb/phy/fsl_otg.h
similarity index 100%
rename from drivers/usb/otg/fsl_otg.h
rename to drivers/usb/phy/fsl_otg.h
diff --git a/drivers/usb/otg/gpio_vbus.c b/drivers/usb/phy/gpio_vbus.c
similarity index 100%
rename from drivers/usb/otg/gpio_vbus.c
rename to drivers/usb/phy/gpio_vbus.c
diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/phy/isp1301_omap.c
similarity index 100%
rename from drivers/usb/otg/isp1301_omap.c
rename to drivers/usb/phy/isp1301_omap.c
diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/phy/msm_otg.c
similarity index 100%
rename from drivers/usb/otg/msm_otg.c
rename to drivers/usb/phy/msm_otg.c
diff --git a/drivers/usb/otg/mv_otg.c b/drivers/usb/phy/mv_otg.c
similarity index 100%
rename from drivers/usb/otg/mv_otg.c
rename to drivers/usb/phy/mv_otg.c
diff --git a/drivers/usb/otg/mv_otg.h b/drivers/usb/phy/mv_otg.h
similarity index 100%
rename from drivers/usb/otg/mv_otg.h
rename to drivers/usb/phy/mv_otg.h
diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/phy/mxs-phy.c
similarity index 100%
rename from drivers/usb/otg/mxs-phy.c
rename to drivers/usb/phy/mxs-phy.c
diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/phy/nop-usb-xceiv.c
similarity index 100%
rename from drivers/usb/otg/nop-usb-xceiv.c
rename to drivers/usb/phy/nop-usb-xceiv.c
diff --git a/drivers/usb/otg/otg_fsm.c b/drivers/usb/phy/otg_fsm.c
similarity index 100%
rename from drivers/usb/otg/otg_fsm.c
rename to drivers/usb/phy/otg_fsm.c
diff --git a/drivers/usb/otg/otg_fsm.h b/drivers/usb/phy/otg_fsm.h
similarity index 100%
rename from drivers/usb/otg/otg_fsm.h
rename to drivers/usb/phy/otg_fsm.h
diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/phy/twl4030-usb.c
similarity index 100%
rename from drivers/usb/otg/twl4030-usb.c
rename to drivers/usb/phy/twl4030-usb.c
diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/phy/twl6030-usb.c
similarity index 100%
rename from drivers/usb/otg/twl6030-usb.c
rename to drivers/usb/phy/twl6030-usb.c
diff --git a/drivers/usb/otg/ulpi.c b/drivers/usb/phy/ulpi.c
similarity index 100%
rename from drivers/usb/otg/ulpi.c
rename to drivers/usb/phy/ulpi.c
diff --git a/drivers/usb/otg/ulpi_viewport.c b/drivers/usb/phy/ulpi_viewport.c
similarity index 100%
rename from drivers/usb/otg/ulpi_viewport.c
rename to drivers/usb/phy/ulpi_viewport.c
-- 
1.8.1.rc1.5.g7e0651a


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

* [PATCH 05/10] usb: phy: make it a menuconfig
  2013-03-07  9:35 [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Felipe Balbi
                   ` (3 preceding siblings ...)
  2013-03-07  9:36 ` [PATCH 04/10] usb: phy: move all PHY drivers to drivers/usb/phy/ Felipe Balbi
@ 2013-03-07  9:36 ` Felipe Balbi
  2013-03-07  9:36 ` [PATCH 07/10] usb: gadget: mv_udc_core: check against CONFIG_USB_PHY Felipe Balbi
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:36 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou, dwmw2, stern, swarren, arnd, linux-tegra,
	linux-omap, Felipe Balbi

We already have a considerable amount of USB
PHY drivers, making it a menuconfig just
prevents us from adding too much churn to
USB's menuconfig.

While at that, also select USB_OTG_UTILS from
this new menuconfig just to keep backwards
compatibility until we manage to remove
that symbol.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/Makefile         |  2 +-
 drivers/usb/phy/Kconfig  | 17 ++++++++++++-----
 drivers/usb/phy/Makefile |  2 +-
 include/linux/usb/phy.h  |  2 +-
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index dce39a9..3c200a2 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -79,7 +79,7 @@ obj-$(CONFIG_ATA_OVER_ETH)	+= block/aoe/
 obj-$(CONFIG_PARIDE) 		+= block/paride/
 obj-$(CONFIG_TC)		+= tc/
 obj-$(CONFIG_UWB)		+= uwb/
-obj-$(CONFIG_USB_OTG_UTILS)	+= usb/
+obj-$(CONFIG_USB_PHY)		+= usb/
 obj-$(CONFIG_USB)		+= usb/
 obj-$(CONFIG_PCI)		+= usb/
 obj-$(CONFIG_USB_GADGET)	+= usb/
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 32ce740..832cd69 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -1,8 +1,17 @@
 #
 # Physical Layer USB driver configuration
 #
-comment "USB Physical Layer drivers"
-	depends on USB || USB_GADGET
+menuconfig USB_PHY
+	tristate "USB Physical Layer drivers"
+	select USB_OTG_UTILS
+	help
+	  USB controllers (those which are host, device or DRD) need a
+	  device to handle the physical layer signalling, commonly called
+	  a PHY.
+
+	  The following drivers add support for such PHY devices.
+
+if USB_PHY
 
 config USB_OTG_UTILS
 	bool
@@ -10,8 +19,6 @@ config USB_OTG_UTILS
 	  Select this to make sure the build includes objects from
 	  the OTG infrastructure directory.
 
-if USB || USB_GADGET
-
 #
 # USB Transceiver Drivers
 #
@@ -206,4 +213,4 @@ config USB_ULPI_VIEWPORT
 	  Provides read/write operations to the ULPI phy register set for
 	  controllers with a viewport register (e.g. Chipidea/ARC controllers).
 
-endif # USB || OTG
+endif # USB_PHY
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index 34488ce..d10a8b3 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -4,7 +4,7 @@
 
 ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
 
-obj-$(CONFIG_USB_OTG_UTILS)		+= phy.o
+obj-$(CONFIG_USB_PHY)			+= phy.o
 
 # transceiver drivers, keep the list sorted
 
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 15847cb..b001dc3 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -161,7 +161,7 @@ usb_phy_shutdown(struct usb_phy *x)
 }
 
 /* for usb host and peripheral controller drivers */
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 extern struct usb_phy *usb_get_phy(enum usb_phy_type type);
 extern struct usb_phy *devm_usb_get_phy(struct device *dev,
 	enum usb_phy_type type);
-- 
1.8.1.rc1.5.g7e0651a


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

* [PATCH 06/10] usb: power: pda_power: check against CONFIG_USB_PHY
       [not found] ` <1362648969-13737-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
@ 2013-03-07  9:36   ` Felipe Balbi
  2013-03-07  9:36   ` [PATCH 08/10] usb: ehci: marvel: " Felipe Balbi
  2013-03-07 21:20   ` [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Stephen Warren
  2 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:36 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou-JGs/UdohzUI, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	swarren-3lzwWm7+Weoh9ZMKESR00Q, arnd-r2nGTMty4D4,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi

CONFIG_USB_OTG_UTILS will be removed very
soon, so we should check CONFIG_USB_PHY
instead.

Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
---
 drivers/power/pda_power.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
index 7df7c5f..0c52e2a 100644
--- a/drivers/power/pda_power.c
+++ b/drivers/power/pda_power.c
@@ -35,7 +35,7 @@ static struct timer_list supply_timer;
 static struct timer_list polling_timer;
 static int polling;
 
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 static struct usb_phy *transceiver;
 static struct notifier_block otg_nb;
 #endif
@@ -218,7 +218,7 @@ static void polling_timer_func(unsigned long unused)
 		  jiffies + msecs_to_jiffies(pdata->polling_interval));
 }
 
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 static int otg_is_usb_online(void)
 {
 	return (transceiver->last_event == USB_EVENT_VBUS ||
@@ -315,7 +315,7 @@ static int pda_power_probe(struct platform_device *pdev)
 		pda_psy_usb.num_supplicants = pdata->num_supplicants;
 	}
 
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 	transceiver = usb_get_phy(USB_PHY_TYPE_USB2);
 	if (!IS_ERR_OR_NULL(transceiver)) {
 		if (!pdata->is_usb_online)
@@ -367,7 +367,7 @@ static int pda_power_probe(struct platform_device *pdev)
 		}
 	}
 
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 	if (!IS_ERR_OR_NULL(transceiver) && pdata->use_otg_notifier) {
 		otg_nb.notifier_call = otg_handle_notification;
 		ret = usb_register_notifier(transceiver, &otg_nb);
@@ -391,7 +391,7 @@ static int pda_power_probe(struct platform_device *pdev)
 
 	return 0;
 
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 otg_reg_notifier_failed:
 	if (pdata->is_usb_online && usb_irq)
 		free_irq(usb_irq->start, &pda_psy_usb);
@@ -402,7 +402,7 @@ usb_irq_failed:
 usb_supply_failed:
 	if (pdata->is_ac_online && ac_irq)
 		free_irq(ac_irq->start, &pda_psy_ac);
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 	if (!IS_ERR_OR_NULL(transceiver))
 		usb_put_phy(transceiver);
 #endif
@@ -437,7 +437,7 @@ static int pda_power_remove(struct platform_device *pdev)
 		power_supply_unregister(&pda_psy_usb);
 	if (pdata->is_ac_online)
 		power_supply_unregister(&pda_psy_ac);
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 	if (!IS_ERR_OR_NULL(transceiver))
 		usb_put_phy(transceiver);
 #endif
-- 
1.8.1.rc1.5.g7e0651a

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 07/10] usb: gadget: mv_udc_core: check against CONFIG_USB_PHY
  2013-03-07  9:35 [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Felipe Balbi
                   ` (4 preceding siblings ...)
  2013-03-07  9:36 ` [PATCH 05/10] usb: phy: make it a menuconfig Felipe Balbi
@ 2013-03-07  9:36 ` Felipe Balbi
  2013-03-07  9:36 ` [PATCH 09/10] usb: ehci: tegra: " Felipe Balbi
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:36 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou, dwmw2, stern, swarren, arnd, linux-tegra,
	linux-omap, Felipe Balbi

CONFIG_USB_OTG_UTILS will be removed very
soon, so we should check CONFIG_USB_PHY
instead.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/gadget/mv_udc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index d278e8f..d550b21 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -2127,7 +2127,7 @@ static int mv_udc_probe(struct platform_device *pdev)
 
 	udc->dev = pdev;
 
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 	if (pdata->mode == MV_USB_MODE_OTG) {
 		udc->transceiver = devm_usb_get_phy(&pdev->dev,
 					USB_PHY_TYPE_USB2);
-- 
1.8.1.rc1.5.g7e0651a


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

* [PATCH 08/10] usb: ehci: marvel: check against CONFIG_USB_PHY
       [not found] ` <1362648969-13737-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
  2013-03-07  9:36   ` [PATCH 06/10] usb: power: pda_power: check against CONFIG_USB_PHY Felipe Balbi
@ 2013-03-07  9:36   ` Felipe Balbi
  2013-03-07 21:20   ` [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Stephen Warren
  2 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:36 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou-JGs/UdohzUI, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	swarren-3lzwWm7+Weoh9ZMKESR00Q, arnd-r2nGTMty4D4,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi

CONFIG_USB_OTG_UTILS will be removed very
soon, so we should check CONFIG_USB_PHY
instead.

Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
---
 drivers/usb/host/ehci-mv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c
index 3065809..9751823 100644
--- a/drivers/usb/host/ehci-mv.c
+++ b/drivers/usb/host/ehci-mv.c
@@ -240,7 +240,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
 
 	ehci_mv->mode = pdata->mode;
 	if (ehci_mv->mode == MV_USB_MODE_OTG) {
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 		ehci_mv->otg = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
 		if (IS_ERR_OR_NULL(ehci_mv->otg)) {
 			dev_err(&pdev->dev,
@@ -260,7 +260,7 @@ static int mv_ehci_probe(struct platform_device *pdev)
 		mv_ehci_disable(ehci_mv);
 #else
 		dev_info(&pdev->dev, "MV_USB_MODE_OTG "
-			 "must have CONFIG_USB_OTG_UTILS enabled\n");
+			 "must have CONFIG_USB_PHY enabled\n");
 		goto err_disable_clk;
 #endif
 	} else {
-- 
1.8.1.rc1.5.g7e0651a

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH 09/10] usb: ehci: tegra: check against CONFIG_USB_PHY
  2013-03-07  9:35 [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Felipe Balbi
                   ` (5 preceding siblings ...)
  2013-03-07  9:36 ` [PATCH 07/10] usb: gadget: mv_udc_core: check against CONFIG_USB_PHY Felipe Balbi
@ 2013-03-07  9:36 ` Felipe Balbi
       [not found]   ` <1362648969-13737-10-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
  2013-03-07  9:36 ` [PATCH 10/10] usb: phy: remove CONFIG_USB_OTG_UTILS Felipe Balbi
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:36 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou, dwmw2, stern, swarren, arnd, linux-tegra,
	linux-omap, Felipe Balbi

CONFIG_USB_OTG_UTILS will be removed very
soon, so we should check CONFIG_USB_PHY
instead.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/host/ehci-tegra.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 568aecc..fafbc81 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -768,7 +768,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
 		goto fail;
 	}
 
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 	if (pdata->operating_mode == TEGRA_USB_OTG) {
 		tegra->transceiver =
 			devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
@@ -794,7 +794,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
 	return err;
 
 fail:
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 	if (!IS_ERR_OR_NULL(tegra->transceiver))
 		otg_set_host(tegra->transceiver->otg, NULL);
 #endif
@@ -815,7 +815,7 @@ static int tegra_ehci_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_put_noidle(&pdev->dev);
 
-#ifdef CONFIG_USB_OTG_UTILS
+#if IS_ENABLED(CONFIG_USB_PHY)
 	if (!IS_ERR_OR_NULL(tegra->transceiver))
 		otg_set_host(tegra->transceiver->otg, NULL);
 #endif
-- 
1.8.1.rc1.5.g7e0651a


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

* [PATCH 10/10] usb: phy: remove CONFIG_USB_OTG_UTILS
  2013-03-07  9:35 [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Felipe Balbi
                   ` (6 preceding siblings ...)
  2013-03-07  9:36 ` [PATCH 09/10] usb: ehci: tegra: " Felipe Balbi
@ 2013-03-07  9:36 ` Felipe Balbi
       [not found]   ` <1362648969-13737-11-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
  2013-03-07 16:01 ` [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Alan Stern
       [not found] ` <1362648969-13737-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
  9 siblings, 1 reply; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07  9:36 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou, dwmw2, stern, swarren, arnd, linux-tegra,
	linux-omap, Felipe Balbi

there are no more users of CONFIG_USB_OTG_UTILS
left in tree, we can remove it just fine.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/usb/phy/Kconfig | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 832cd69..97de6de 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -3,7 +3,6 @@
 #
 menuconfig USB_PHY
 	tristate "USB Physical Layer drivers"
-	select USB_OTG_UTILS
 	help
 	  USB controllers (those which are host, device or DRD) need a
 	  device to handle the physical layer signalling, commonly called
@@ -13,19 +12,12 @@ menuconfig USB_PHY
 
 if USB_PHY
 
-config USB_OTG_UTILS
-	bool
-	help
-	  Select this to make sure the build includes objects from
-	  the OTG infrastructure directory.
-
 #
 # USB Transceiver Drivers
 #
 config AB8500_USB
 	tristate "AB8500 USB Transceiver Driver"
 	depends on AB8500_CORE
-	select USB_OTG_UTILS
 	help
 	  Enable this to support the USB OTG transceiver in AB8500 chip.
 	  This transceiver supports high and full speed devices plus,
@@ -35,14 +27,12 @@ config FSL_USB2_OTG
 	bool "Freescale USB OTG Transceiver Driver"
 	depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_SUSPEND
 	select USB_OTG
-	select USB_OTG_UTILS
 	help
 	  Enable this to support Freescale USB OTG transceiver.
 
 config ISP1301_OMAP
 	tristate "Philips ISP1301 with OMAP OTG"
 	depends on I2C && ARCH_OMAP_OTG
-	select USB_OTG_UTILS
 	help
 	  If you say yes here you get support for the Philips ISP1301
 	  USB-On-The-Go transceiver working with the OMAP OTG controller.
@@ -56,14 +46,12 @@ config ISP1301_OMAP
 config MV_U3D_PHY
 	bool "Marvell USB 3.0 PHY controller Driver"
 	depends on USB_MV_U3D
-	select USB_OTG_UTILS
 	help
 	  Enable this to support Marvell USB 3.0 phy controller for Marvell
 	  SoC.
 
 config NOP_USB_XCEIV
 	tristate "NOP USB Transceiver Driver"
-	select USB_OTG_UTILS
 	help
 	  This driver is to be used by all the usb transceiver which are either
 	  built-in with usb ip or which are autonomous and doesn't require any
@@ -81,7 +69,6 @@ config OMAP_CONTROL_USB
 config OMAP_USB2
 	tristate "OMAP USB2 PHY Driver"
 	depends on ARCH_OMAP2PLUS
-	select USB_OTG_UTILS
 	select OMAP_CONTROL_USB
 	help
 	  Enable this to support the transceiver that is part of SOC. This
@@ -91,7 +78,6 @@ config OMAP_USB2
 
 config OMAP_USB3
 	tristate "OMAP USB3 PHY Driver"
-	select USB_OTG_UTILS
 	select OMAP_CONTROL_USB
 	help
 	  Enable this to support the USB3 PHY that is part of SOC. This
@@ -102,7 +88,6 @@ config OMAP_USB3
 config SAMSUNG_USBPHY
 	bool "Samsung USB PHY controller Driver"
 	depends on USB_S3C_HSOTG || USB_EHCI_S5P || USB_OHCI_EXYNOS
-	select USB_OTG_UTILS
 	help
 	  Enable this to support Samsung USB phy controller for samsung
 	  SoCs.
@@ -110,7 +95,6 @@ config SAMSUNG_USBPHY
 config TWL4030_USB
 	tristate "TWL4030 USB Transceiver Driver"
 	depends on TWL4030_CORE && REGULATOR_TWL4030 && USB_MUSB_OMAP2PLUS
-	select USB_OTG_UTILS
 	help
 	  Enable this to support the USB OTG transceiver on TWL4030
 	  family chips (including the TWL5030 and TPS659x0 devices).
@@ -120,7 +104,6 @@ config TWL4030_USB
 config TWL6030_USB
 	tristate "TWL6030 USB Transceiver Driver"
 	depends on TWL4030_CORE && OMAP_USB2 && USB_MUSB_OMAP2PLUS
-	select USB_OTG_UTILS
 	help
 	  Enable this to support the USB OTG transceiver on TWL6030
 	  family chips. This TWL6030 transceiver has the VBUS and ID GND
@@ -132,7 +115,6 @@ config TWL6030_USB
 config USB_GPIO_VBUS
 	tristate "GPIO based peripheral-only VBUS sensing 'transceiver'"
 	depends on GENERIC_GPIO
-	select USB_OTG_UTILS
 	help
 	  Provides simple GPIO VBUS sensing for controllers with an
 	  internal transceiver via the usb_phy interface, and
@@ -154,7 +136,6 @@ config USB_ISP1301
 config USB_MSM_OTG
 	tristate "OTG support for Qualcomm on-chip USB controller"
 	depends on (USB || USB_GADGET) && ARCH_MSM
-	select USB_OTG_UTILS
 	help
 	  Enable this to support the USB OTG transceiver on MSM chips. It
 	  handles PHY initialization, clock management, and workarounds
@@ -168,7 +149,6 @@ config USB_MV_OTG
 	tristate "Marvell USB OTG support"
 	depends on USB_EHCI_MV && USB_MV_UDC && USB_SUSPEND
 	select USB_OTG
-	select USB_OTG_UTILS
 	help
 	  Say Y here if you want to build Marvell USB OTG transciever
 	  driver in kernel (including PXA and MMP series). This driver
@@ -180,7 +160,6 @@ config USB_MXS_PHY
 	tristate "Freescale MXS USB PHY support"
 	depends on ARCH_MXC || ARCH_MXS
 	select STMP_DEVICE
-	select USB_OTG_UTILS
 	help
 	  Enable this to support the Freescale MXS USB PHY.
 
@@ -189,7 +168,6 @@ config USB_MXS_PHY
 config USB_RCAR_PHY
 	tristate "Renesas R-Car USB phy support"
 	depends on USB || USB_GADGET
-	select USB_OTG_UTILS
 	help
 	  Say Y here to add support for the Renesas R-Car USB phy driver.
 	  This chip is typically used as USB phy for USB host, gadget.
@@ -201,7 +179,6 @@ config USB_RCAR_PHY
 config USB_ULPI
 	bool "Generic ULPI Transceiver Driver"
 	depends on ARM
-	select USB_OTG_UTILS
 	help
 	  Enable this to support ULPI connected USB OTG transceivers which
 	  are likely found on embedded boards.
-- 
1.8.1.rc1.5.g7e0651a


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

* [PATCH v2] usb: phy: remove CONFIG_USB_OTG_UTILS
       [not found]   ` <1362648969-13737-11-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
@ 2013-03-07 14:41     ` Felipe Balbi
  0 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07 14:41 UTC (permalink / raw)
  To: Linux USB Mailing List
  Cc: Greg KH, cbou-JGs/UdohzUI, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	swarren-3lzwWm7+Weoh9ZMKESR00Q, arnd-r2nGTMty4D4,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi

there are no more users of CONFIG_USB_OTG_UTILS
left in tree, we can remove it just fine.

Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
---

v1 -> v2:
	. removed a few extra instances which my original (and stupid)
		grep didn't find

 drivers/power/Kconfig      |  2 +-
 drivers/usb/dwc3/Kconfig   |  1 -
 drivers/usb/gadget/Kconfig |  3 ---
 drivers/usb/host/Kconfig   |  1 -
 drivers/usb/musb/Kconfig   |  1 -
 drivers/usb/phy/Kconfig    | 23 -----------------------
 6 files changed, 1 insertion(+), 30 deletions(-)

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 9e00c38..ffe02fb 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -254,7 +254,7 @@ config BATTERY_RX51
 
 config CHARGER_ISP1704
 	tristate "ISP1704 USB Charger Detection"
-	depends on USB_OTG_UTILS
+	depends on USB_PHY
 	help
 	  Say Y to enable support for USB Charger Detection with
 	  ISP1707/ISP1704 USB transceivers.
diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 68e9a2c..ea5ee9c 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -1,7 +1,6 @@
 config USB_DWC3
 	tristate "DesignWare USB3 DRD Core Support"
 	depends on (USB || USB_GADGET) && GENERIC_HARDIRQS
-	select USB_OTG_UTILS
 	select USB_XHCI_PLATFORM if USB_SUPPORT && USB_XHCI_HCD
 	help
 	  Say Y or M here if your system has a Dual Role SuperSpeed
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 50586ff..7ad108a 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -195,7 +195,6 @@ config USB_OMAP
 	tristate "OMAP USB Device Controller"
 	depends on ARCH_OMAP1
 	select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG
-	select USB_OTG_UTILS if ARCH_OMAP
 	help
 	   Many Texas Instruments OMAP processors have flexible full
 	   speed USB device controllers, with support for up to 30
@@ -210,7 +209,6 @@ config USB_OMAP
 config USB_PXA25X
 	tristate "PXA 25x or IXP 4xx"
 	depends on (ARCH_PXA && PXA25x) || ARCH_IXP4XX
-	select USB_OTG_UTILS
 	help
 	   Intel's PXA 25x series XScale ARM-5TE processors include
 	   an integrated full speed USB 1.1 device controller.  The
@@ -258,7 +256,6 @@ config USB_RENESAS_USBHS_UDC
 
 config USB_PXA27X
 	tristate "PXA 27x"
-	select USB_OTG_UTILS
 	help
 	   Intel's PXA 27x series XScale ARM v5TE processors include
 	   an integrated full speed USB 1.1 device controller.
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index c59a112..ba1347c 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -300,7 +300,6 @@ config USB_OHCI_HCD
 	tristate "OHCI HCD support"
 	depends on USB && USB_ARCH_HAS_OHCI
 	select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3
-	select USB_OTG_UTILS if ARCH_OMAP
 	depends on USB_ISP1301 || !ARCH_LPC32XX
 	---help---
 	  The Open Host Controller Interface (OHCI) is a standard for accessing
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
index b387431..079330b 100644
--- a/drivers/usb/musb/Kconfig
+++ b/drivers/usb/musb/Kconfig
@@ -10,7 +10,6 @@ config USB_MUSB_HDRC
 	select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
 	select NOP_USB_XCEIV if (SOC_TI81XX || SOC_AM33XX)
 	select OMAP_CONTROL_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
-	select USB_OTG_UTILS
 	help
 	  Say Y here if your system has a dual role high speed USB
 	  controller based on the Mentor Graphics silicon IP.  Then
diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 832cd69..97de6de 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -3,7 +3,6 @@
 #
 menuconfig USB_PHY
 	tristate "USB Physical Layer drivers"
-	select USB_OTG_UTILS
 	help
 	  USB controllers (those which are host, device or DRD) need a
 	  device to handle the physical layer signalling, commonly called
@@ -13,19 +12,12 @@ menuconfig USB_PHY
 
 if USB_PHY
 
-config USB_OTG_UTILS
-	bool
-	help
-	  Select this to make sure the build includes objects from
-	  the OTG infrastructure directory.
-
 #
 # USB Transceiver Drivers
 #
 config AB8500_USB
 	tristate "AB8500 USB Transceiver Driver"
 	depends on AB8500_CORE
-	select USB_OTG_UTILS
 	help
 	  Enable this to support the USB OTG transceiver in AB8500 chip.
 	  This transceiver supports high and full speed devices plus,
@@ -35,14 +27,12 @@ config FSL_USB2_OTG
 	bool "Freescale USB OTG Transceiver Driver"
 	depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_SUSPEND
 	select USB_OTG
-	select USB_OTG_UTILS
 	help
 	  Enable this to support Freescale USB OTG transceiver.
 
 config ISP1301_OMAP
 	tristate "Philips ISP1301 with OMAP OTG"
 	depends on I2C && ARCH_OMAP_OTG
-	select USB_OTG_UTILS
 	help
 	  If you say yes here you get support for the Philips ISP1301
 	  USB-On-The-Go transceiver working with the OMAP OTG controller.
@@ -56,14 +46,12 @@ config ISP1301_OMAP
 config MV_U3D_PHY
 	bool "Marvell USB 3.0 PHY controller Driver"
 	depends on USB_MV_U3D
-	select USB_OTG_UTILS
 	help
 	  Enable this to support Marvell USB 3.0 phy controller for Marvell
 	  SoC.
 
 config NOP_USB_XCEIV
 	tristate "NOP USB Transceiver Driver"
-	select USB_OTG_UTILS
 	help
 	  This driver is to be used by all the usb transceiver which are either
 	  built-in with usb ip or which are autonomous and doesn't require any
@@ -81,7 +69,6 @@ config OMAP_CONTROL_USB
 config OMAP_USB2
 	tristate "OMAP USB2 PHY Driver"
 	depends on ARCH_OMAP2PLUS
-	select USB_OTG_UTILS
 	select OMAP_CONTROL_USB
 	help
 	  Enable this to support the transceiver that is part of SOC. This
@@ -91,7 +78,6 @@ config OMAP_USB2
 
 config OMAP_USB3
 	tristate "OMAP USB3 PHY Driver"
-	select USB_OTG_UTILS
 	select OMAP_CONTROL_USB
 	help
 	  Enable this to support the USB3 PHY that is part of SOC. This
@@ -102,7 +88,6 @@ config OMAP_USB3
 config SAMSUNG_USBPHY
 	bool "Samsung USB PHY controller Driver"
 	depends on USB_S3C_HSOTG || USB_EHCI_S5P || USB_OHCI_EXYNOS
-	select USB_OTG_UTILS
 	help
 	  Enable this to support Samsung USB phy controller for samsung
 	  SoCs.
@@ -110,7 +95,6 @@ config SAMSUNG_USBPHY
 config TWL4030_USB
 	tristate "TWL4030 USB Transceiver Driver"
 	depends on TWL4030_CORE && REGULATOR_TWL4030 && USB_MUSB_OMAP2PLUS
-	select USB_OTG_UTILS
 	help
 	  Enable this to support the USB OTG transceiver on TWL4030
 	  family chips (including the TWL5030 and TPS659x0 devices).
@@ -120,7 +104,6 @@ config TWL4030_USB
 config TWL6030_USB
 	tristate "TWL6030 USB Transceiver Driver"
 	depends on TWL4030_CORE && OMAP_USB2 && USB_MUSB_OMAP2PLUS
-	select USB_OTG_UTILS
 	help
 	  Enable this to support the USB OTG transceiver on TWL6030
 	  family chips. This TWL6030 transceiver has the VBUS and ID GND
@@ -132,7 +115,6 @@ config TWL6030_USB
 config USB_GPIO_VBUS
 	tristate "GPIO based peripheral-only VBUS sensing 'transceiver'"
 	depends on GENERIC_GPIO
-	select USB_OTG_UTILS
 	help
 	  Provides simple GPIO VBUS sensing for controllers with an
 	  internal transceiver via the usb_phy interface, and
@@ -154,7 +136,6 @@ config USB_ISP1301
 config USB_MSM_OTG
 	tristate "OTG support for Qualcomm on-chip USB controller"
 	depends on (USB || USB_GADGET) && ARCH_MSM
-	select USB_OTG_UTILS
 	help
 	  Enable this to support the USB OTG transceiver on MSM chips. It
 	  handles PHY initialization, clock management, and workarounds
@@ -168,7 +149,6 @@ config USB_MV_OTG
 	tristate "Marvell USB OTG support"
 	depends on USB_EHCI_MV && USB_MV_UDC && USB_SUSPEND
 	select USB_OTG
-	select USB_OTG_UTILS
 	help
 	  Say Y here if you want to build Marvell USB OTG transciever
 	  driver in kernel (including PXA and MMP series). This driver
@@ -180,7 +160,6 @@ config USB_MXS_PHY
 	tristate "Freescale MXS USB PHY support"
 	depends on ARCH_MXC || ARCH_MXS
 	select STMP_DEVICE
-	select USB_OTG_UTILS
 	help
 	  Enable this to support the Freescale MXS USB PHY.
 
@@ -189,7 +168,6 @@ config USB_MXS_PHY
 config USB_RCAR_PHY
 	tristate "Renesas R-Car USB phy support"
 	depends on USB || USB_GADGET
-	select USB_OTG_UTILS
 	help
 	  Say Y here to add support for the Renesas R-Car USB phy driver.
 	  This chip is typically used as USB phy for USB host, gadget.
@@ -201,7 +179,6 @@ config USB_RCAR_PHY
 config USB_ULPI
 	bool "Generic ULPI Transceiver Driver"
 	depends on ARM
-	select USB_OTG_UTILS
 	help
 	  Enable this to support ULPI connected USB OTG transceivers which
 	  are likely found on embedded boards.
-- 
1.8.1.rc1.5.g7e0651a

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
  2013-03-07  9:35 [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Felipe Balbi
                   ` (7 preceding siblings ...)
  2013-03-07  9:36 ` [PATCH 10/10] usb: phy: remove CONFIG_USB_OTG_UTILS Felipe Balbi
@ 2013-03-07 16:01 ` Alan Stern
       [not found]   ` <Pine.LNX.4.44L0.1303071101190.1646-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
       [not found] ` <1362648969-13737-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
  9 siblings, 1 reply; 27+ messages in thread
From: Alan Stern @ 2013-03-07 16:01 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Linux USB Mailing List, Greg KH, cbou, dwmw2, swarren, arnd,
	linux-tegra, linux-omap

On Thu, 7 Mar 2013, Felipe Balbi wrote:

> Hi folks,
> 
> inspired by Paul's DWC2 patchset which added usb_otg_state_string()
> (a copy of otg_state_string()) I have now renamed otg_state_string()
> to usb_otg_state_string(), moved it to usb-common, then moved all
> phy drivers to drivers/usb/phy/ and completely deleted the otg directory.
> 
> We're also removing CONFIG_USB_OTG_UTILS since that has lots its
> meaning long ago.
> 
> I have compiled all patches with allyes, allno and allmod configs,
> but please make sure to test on your platforms to make sure we're
> not leaking any more problems to mainline.

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

for the EHCI changes.


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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found]   ` <Pine.LNX.4.44L0.1303071101190.1646-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
@ 2013-03-07 16:41     ` Felipe Balbi
  0 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-07 16:41 UTC (permalink / raw)
  To: Alan Stern
  Cc: Felipe Balbi, Linux USB Mailing List, Greg KH, cbou-JGs/UdohzUI,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ, swarren-3lzwWm7+Weoh9ZMKESR00Q,
	arnd-r2nGTMty4D4, linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

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

On Thu, Mar 07, 2013 at 11:01:47AM -0500, Alan Stern wrote:
> On Thu, 7 Mar 2013, Felipe Balbi wrote:
> 
> > Hi folks,
> > 
> > inspired by Paul's DWC2 patchset which added usb_otg_state_string()
> > (a copy of otg_state_string()) I have now renamed otg_state_string()
> > to usb_otg_state_string(), moved it to usb-common, then moved all
> > phy drivers to drivers/usb/phy/ and completely deleted the otg directory.
> > 
> > We're also removing CONFIG_USB_OTG_UTILS since that has lots its
> > meaning long ago.
> > 
> > I have compiled all patches with allyes, allno and allmod configs,
> > but please make sure to test on your platforms to make sure we're
> > not leaking any more problems to mainline.
> 
> Acked-by: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
> 
> for the EHCI changes.

thanks, added your ack to the patches.

-- 
balbi

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

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

* Re: [PATCH 09/10] usb: ehci: tegra: check against CONFIG_USB_PHY
       [not found]   ` <1362648969-13737-10-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
@ 2013-03-07 20:54     ` Stephen Warren
  2013-03-08  7:10       ` Felipe Balbi
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Warren @ 2013-03-07 20:54 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Linux USB Mailing List, Greg KH, cbou-JGs/UdohzUI,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, arnd-r2nGTMty4D4,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

On 03/07/2013 02:36 AM, Felipe Balbi wrote:
> CONFIG_USB_OTG_UTILS will be removed very
> soon, so we should check CONFIG_USB_PHY
> instead.

The Tegra EHCI driver isn't very useful without the Tegra PHY driver.
Perhaps its Kconfig should simply "select USB_PHY", and the ifdefs be
removed rather than modified?

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found] ` <1362648969-13737-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
  2013-03-07  9:36   ` [PATCH 06/10] usb: power: pda_power: check against CONFIG_USB_PHY Felipe Balbi
  2013-03-07  9:36   ` [PATCH 08/10] usb: ehci: marvel: " Felipe Balbi
@ 2013-03-07 21:20   ` Stephen Warren
       [not found]     ` <513904A4.7040101-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2 siblings, 1 reply; 27+ messages in thread
From: Stephen Warren @ 2013-03-07 21:20 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Linux USB Mailing List, Greg KH, cbou-JGs/UdohzUI,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, arnd-r2nGTMty4D4,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

On 03/07/2013 02:35 AM, Felipe Balbi wrote:
> Hi folks,
> 
> inspired by Paul's DWC2 patchset which added usb_otg_state_string()
> (a copy of otg_state_string()) I have now renamed otg_state_string()
> to usb_otg_state_string(), moved it to usb-common, then moved all
> phy drivers to drivers/usb/phy/ and completely deleted the otg directory.
> 
> We're also removing CONFIG_USB_OTG_UTILS since that has lots its
> meaning long ago.
> 
> I have compiled all patches with allyes, allno and allmod configs,
> but please make sure to test on your platforms to make sure we're
> not leaking any more problems to mainline.

What branch do the patches apply to? They didn't "git am" for me on
either next-20130305, nor
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next.

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

* Re: [PATCH 09/10] usb: ehci: tegra: check against CONFIG_USB_PHY
  2013-03-07 20:54     ` Stephen Warren
@ 2013-03-08  7:10       ` Felipe Balbi
  0 siblings, 0 replies; 27+ messages in thread
From: Felipe Balbi @ 2013-03-08  7:10 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Felipe Balbi, Linux USB Mailing List, Greg KH, cbou, dwmw2,
	stern, arnd, linux-tegra, linux-omap

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

On Thu, Mar 07, 2013 at 01:54:53PM -0700, Stephen Warren wrote:
> On 03/07/2013 02:36 AM, Felipe Balbi wrote:
> > CONFIG_USB_OTG_UTILS will be removed very
> > soon, so we should check CONFIG_USB_PHY
> > instead.
> 
> The Tegra EHCI driver isn't very useful without the Tegra PHY driver.
> Perhaps its Kconfig should simply "select USB_PHY", and the ifdefs be

no selects anymore.

> removed rather than modified?

One can still compile-test the driver without a PHY. Ideally, though, we
would teach EHCI-core about PHYs.

-- 
balbi

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

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found]     ` <513904A4.7040101-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-03-08  7:14       ` Felipe Balbi
       [not found]         ` <20130308071453.GD21589-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Felipe Balbi @ 2013-03-08  7:14 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Felipe Balbi, Linux USB Mailing List, Greg KH, cbou-JGs/UdohzUI,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, arnd-r2nGTMty4D4,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

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

Hi,

On Thu, Mar 07, 2013 at 02:20:36PM -0700, Stephen Warren wrote:
> On 03/07/2013 02:35 AM, Felipe Balbi wrote:
> > Hi folks,
> > 
> > inspired by Paul's DWC2 patchset which added usb_otg_state_string()
> > (a copy of otg_state_string()) I have now renamed otg_state_string()
> > to usb_otg_state_string(), moved it to usb-common, then moved all
> > phy drivers to drivers/usb/phy/ and completely deleted the otg directory.
> > 
> > We're also removing CONFIG_USB_OTG_UTILS since that has lots its
> > meaning long ago.
> > 
> > I have compiled all patches with allyes, allno and allmod configs,
> > but please make sure to test on your platforms to make sure we're
> > not leaking any more problems to mainline.
> 
> What branch do the patches apply to? They didn't "git am" for me on
> either next-20130305, nor
> git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next.

they're on top of my testing branch. There were a few other patches
touching drivers/phy which you need. Namely :

0e3b847 usb: phy: mxs: use readl(), writel() instead of the _relaxed() versions
35f0683 usb: phy: mxs-phy: register phy with framework
f6797d0 usb: phy: move bulk of otg/otg.c to phy/phy.c

It's easier to cherry-pick them all from my testing branch, or merge the
full branch which contains a bunch of other cleanups.

-- 
balbi

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

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found]         ` <20130308071453.GD21589-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
@ 2013-03-08 17:14           ` Stephen Warren
       [not found]             ` <513A1C63.9050704-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Warren @ 2013-03-08 17:14 UTC (permalink / raw)
  To: balbi-l0cyMroinI0
  Cc: Linux USB Mailing List, Greg KH, cbou-JGs/UdohzUI,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, arnd-r2nGTMty4D4,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

On 03/08/2013 12:14 AM, Felipe Balbi wrote:
> Hi,
> 
> On Thu, Mar 07, 2013 at 02:20:36PM -0700, Stephen Warren wrote:
>> On 03/07/2013 02:35 AM, Felipe Balbi wrote:
>>> Hi folks,
>>> 
>>> inspired by Paul's DWC2 patchset which added
>>> usb_otg_state_string() (a copy of otg_state_string()) I have
>>> now renamed otg_state_string() to usb_otg_state_string(), moved
>>> it to usb-common, then moved all phy drivers to
>>> drivers/usb/phy/ and completely deleted the otg directory.
>>> 
>>> We're also removing CONFIG_USB_OTG_UTILS since that has lots
>>> its meaning long ago.
>>> 
>>> I have compiled all patches with allyes, allno and allmod
>>> configs, but please make sure to test on your platforms to make
>>> sure we're not leaking any more problems to mainline.
>> 
>> What branch do the patches apply to? They didn't "git am" for me
>> on either next-20130305, nor 
>> git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
>> next.
> 
> they're on top of my testing branch.

Ah, thanks. I took that whole branch, built ARM's tegra_defconfig, and
see:

> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects USB_ULPI
> which has unmet direct dependencies (USB_SUPPORT && USB_PHY &&
> ARM) warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects
> USB_ULPI_VIEWPORT which has unmet direct dependencies (USB_SUPPORT
> && USB_PHY && USB_ULPI) warning: (ARCH_TEGRA_2x_SOC &&
> ARCH_TEGRA_3x_SOC) selects USB_ULPI which has unmet direct
> dependencies (USB_SUPPORT && USB_PHY && ARM) warning:
> (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT
> which has unmet direct dependencies (USB_SUPPORT && USB_PHY &&
> USB_ULPI)

Manually enabling USB_PHY fixes this. However, this highlights an
issue with your removal of all selects (as mentioned in your other
email) - it will break perhaps any defconfig that has USB enabled.

After enabling USB_PHY, the code builds and runs without issue.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found]             ` <513A1C63.9050704-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-03-08 18:26               ` Felipe Balbi
       [not found]                 ` <20130308182623.GD900-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Felipe Balbi @ 2013-03-08 18:26 UTC (permalink / raw)
  To: Stephen Warren
  Cc: balbi-l0cyMroinI0, Linux USB Mailing List, Greg KH,
	cbou-JGs/UdohzUI, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, arnd-r2nGTMty4D4,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

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

On Fri, Mar 08, 2013 at 10:14:11AM -0700, Stephen Warren wrote:
> On 03/08/2013 12:14 AM, Felipe Balbi wrote:
> > Hi,
> > 
> > On Thu, Mar 07, 2013 at 02:20:36PM -0700, Stephen Warren wrote:
> >> On 03/07/2013 02:35 AM, Felipe Balbi wrote:
> >>> Hi folks,
> >>> 
> >>> inspired by Paul's DWC2 patchset which added
> >>> usb_otg_state_string() (a copy of otg_state_string()) I have
> >>> now renamed otg_state_string() to usb_otg_state_string(), moved
> >>> it to usb-common, then moved all phy drivers to
> >>> drivers/usb/phy/ and completely deleted the otg directory.
> >>> 
> >>> We're also removing CONFIG_USB_OTG_UTILS since that has lots
> >>> its meaning long ago.
> >>> 
> >>> I have compiled all patches with allyes, allno and allmod
> >>> configs, but please make sure to test on your platforms to make
> >>> sure we're not leaking any more problems to mainline.
> >> 
> >> What branch do the patches apply to? They didn't "git am" for me
> >> on either next-20130305, nor 
> >> git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
> >> next.
> > 
> > they're on top of my testing branch.
> 
> Ah, thanks. I took that whole branch, built ARM's tegra_defconfig, and
> see:
> 
> > warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects USB_ULPI
> > which has unmet direct dependencies (USB_SUPPORT && USB_PHY &&
> > ARM) warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects
> > USB_ULPI_VIEWPORT which has unmet direct dependencies (USB_SUPPORT
> > && USB_PHY && USB_ULPI) warning: (ARCH_TEGRA_2x_SOC &&
> > ARCH_TEGRA_3x_SOC) selects USB_ULPI which has unmet direct
> > dependencies (USB_SUPPORT && USB_PHY && ARM) warning:
> > (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT
> > which has unmet direct dependencies (USB_SUPPORT && USB_PHY &&
> > USB_ULPI)
> 
> Manually enabling USB_PHY fixes this. However, this highlights an
> issue with your removal of all selects (as mentioned in your other
> email) - it will break perhaps any defconfig that has USB enabled.
> 
> After enabling USB_PHY, the code builds and runs without issue.

fair enough, but then I'm just exposing the trouble. ARCH shouldn't
select USB_ULTI or any of the phy drivers, for that matter.

-- 
balbi

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

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found]                 ` <20130308182623.GD900-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
@ 2013-03-08 18:37                   ` Stephen Warren
       [not found]                     ` <513A2FDD.2040800-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2013-03-14 11:01                     ` Felipe Balbi
  0 siblings, 2 replies; 27+ messages in thread
From: Stephen Warren @ 2013-03-08 18:37 UTC (permalink / raw)
  To: balbi-l0cyMroinI0
  Cc: Linux USB Mailing List, Greg KH, cbou-JGs/UdohzUI,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, arnd-r2nGTMty4D4,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

On 03/08/2013 11:26 AM, Felipe Balbi wrote:
> On Fri, Mar 08, 2013 at 10:14:11AM -0700, Stephen Warren wrote:
>> On 03/08/2013 12:14 AM, Felipe Balbi wrote:
>>> Hi,
>>> 
>>> On Thu, Mar 07, 2013 at 02:20:36PM -0700, Stephen Warren
>>> wrote:
>>>> On 03/07/2013 02:35 AM, Felipe Balbi wrote:
>>>>> Hi folks,
>>>>> 
>>>>> inspired by Paul's DWC2 patchset which added 
>>>>> usb_otg_state_string() (a copy of otg_state_string()) I
>>>>> have now renamed otg_state_string() to
>>>>> usb_otg_state_string(), moved it to usb-common, then moved
>>>>> all phy drivers to drivers/usb/phy/ and completely deleted
>>>>> the otg directory.
>>>>> 
>>>>> We're also removing CONFIG_USB_OTG_UTILS since that has
>>>>> lots its meaning long ago.
>>>>> 
>>>>> I have compiled all patches with allyes, allno and allmod 
>>>>> configs, but please make sure to test on your platforms to
>>>>> make sure we're not leaking any more problems to mainline.
>>>> 
>>>> What branch do the patches apply to? They didn't "git am" for
>>>> me on either next-20130305, nor 
>>>> git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 
>>>> next.
>>> 
>>> they're on top of my testing branch.
>> 
>> Ah, thanks. I took that whole branch, built ARM's
>> tegra_defconfig, and see:
>> 
>>> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects
>>> USB_ULPI which has unmet direct dependencies (USB_SUPPORT &&
>>> USB_PHY && ARM) warning: (ARCH_TEGRA_2x_SOC &&
>>> ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT which has unmet
>>> direct dependencies (USB_SUPPORT && USB_PHY && USB_ULPI)
>>> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects
>>> USB_ULPI which has unmet direct dependencies (USB_SUPPORT &&
>>> USB_PHY && ARM) warning: (ARCH_TEGRA_2x_SOC &&
>>> ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT which has unmet
>>> direct dependencies (USB_SUPPORT && USB_PHY && USB_ULPI)
>> 
>> Manually enabling USB_PHY fixes this. However, this highlights
>> an issue with your removal of all selects (as mentioned in your
>> other email) - it will break perhaps any defconfig that has USB
>> enabled.
>> 
>> After enabling USB_PHY, the code builds and runs without issue.
> 
> fair enough, but then I'm just exposing the trouble. ARCH
> shouldn't select USB_ULTI or any of the phy drivers, for that
> matter.

Yes, I think it should instead work like:

ARCH_TEGRA* selects nothing in particular related to USB.

The Tegra EHCI controller Kconfig depends on ARCH_TEGRA so it doesn't
show up for other builds. I hope it's OK for the EHCI controller to
select USB_ARCH_HAS_EHCI?

The Tegra EHCI controller Kconfig selects everything needed for it to
be useful, i.e. PHY support and the Tegra PHY, and I guess the ULPI
viewport options.

The Tegra PHY Kconfig probably shouldn't be user-visible (relying on
being selected by the Tegra EHCI controller) and itself selects
anything it relies on.

Does that sound reasonable?

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found]                     ` <513A2FDD.2040800-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-03-08 23:08                       ` Arnd Bergmann
       [not found]                         ` <201303082308.31499.arnd-r2nGTMty4D4@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Arnd Bergmann @ 2013-03-08 23:08 UTC (permalink / raw)
  To: Stephen Warren
  Cc: balbi-l0cyMroinI0, Linux USB Mailing List, Greg KH,
	cbou-JGs/UdohzUI, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

On Friday 08 March 2013, Stephen Warren wrote:
> Yes, I think it should instead work like:
> 
> ARCH_TEGRA* selects nothing in particular related to USB.
> 
> The Tegra EHCI controller Kconfig depends on ARCH_TEGRA so it doesn't
> show up for other builds.

Yes, that's fine.

> I hope it's OK for the EHCI controller to select USB_ARCH_HAS_EHCI?

I think that would create a circular dependency, which Kconfig will
refuse. We talked about the USB_ARCH_HAS_* Kconfig symbols recently
and Alan Stern agreed to my suggestion of removing all of them,
reworking the logic so we can always enable USB and EHCI but even
when there is no bus glue enabled.

I'll have to do a proper patch one of these days, or find someone in
my team to do it right for all the corner cases.

> The Tegra PHY Kconfig probably shouldn't be user-visible (relying on
> being selected by the Tegra EHCI controller) and itself selects
> anything it relies on.
> 
> Does that sound reasonable?

It is often safer to express the logic using "depends on" than using
"select", e.g. doing

config USB_EHCI_TEGRA
	bool "EHCI support for NVIDIA Tegra"
	depends on USB_EHCI_HCD
	depends on ARCH_TEGRA

config USB_ULPI_VIEWPORT
	def_bool y
	depends on USB_EHCI_TEGRA

If USB_ULPI_VIEWPORT has any other dependencies, the best solution
in the above scenario is to make USB_EHCI_TEGRA depend on those.

	Arnd

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found]                         ` <201303082308.31499.arnd-r2nGTMty4D4@public.gmane.org>
@ 2013-03-08 23:23                           ` Stephen Warren
       [not found]                             ` <513A72E8.2070707-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Stephen Warren @ 2013-03-08 23:23 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: balbi-l0cyMroinI0, Linux USB Mailing List, Greg KH,
	cbou-JGs/UdohzUI, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

On 03/08/2013 04:08 PM, Arnd Bergmann wrote:
> On Friday 08 March 2013, Stephen Warren wrote:
>> Yes, I think it should instead work like:
>>
>> ARCH_TEGRA* selects nothing in particular related to USB.
>>
>> The Tegra EHCI controller Kconfig depends on ARCH_TEGRA so it doesn't
>> show up for other builds.
> 
> Yes, that's fine.
> 
>> I hope it's OK for the EHCI controller to select USB_ARCH_HAS_EHCI?
> 
> I think that would create a circular dependency, which Kconfig will
> refuse. We talked about the USB_ARCH_HAS_* Kconfig symbols recently
> and Alan Stern agreed to my suggestion of removing all of them,
> reworking the logic so we can always enable USB and EHCI but even
> when there is no bus glue enabled.
> 
> I'll have to do a proper patch one of these days, or find someone in
> my team to do it right for all the corner cases.
> 
>> The Tegra PHY Kconfig probably shouldn't be user-visible (relying on
>> being selected by the Tegra EHCI controller) and itself selects
>> anything it relies on.
>>
>> Does that sound reasonable?
> 
> It is often safer to express the logic using "depends on" than using
> "select", e.g. doing
> 
> config USB_EHCI_TEGRA
> 	bool "EHCI support for NVIDIA Tegra"
> 	depends on USB_EHCI_HCD
> 	depends on ARCH_TEGRA
> 
> config USB_ULPI_VIEWPORT
> 	def_bool y
> 	depends on USB_EHCI_TEGRA
> 
> If USB_ULPI_VIEWPORT has any other dependencies, the best solution
> in the above scenario is to make USB_EHCI_TEGRA depend on those.

USB_ULPI_VIEWPORT is, AFAIK, a generic piece of infra-structure that
USB_EHCI_TEGRA depends upon.

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found]                             ` <513A72E8.2070707-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-03-08 23:56                               ` Arnd Bergmann
       [not found]                                 ` <201303082356.35033.arnd-r2nGTMty4D4@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Arnd Bergmann @ 2013-03-08 23:56 UTC (permalink / raw)
  To: Stephen Warren
  Cc: balbi-l0cyMroinI0, Linux USB Mailing List, Greg KH,
	cbou-JGs/UdohzUI, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

On Friday 08 March 2013, Stephen Warren wrote:
> > config USB_ULPI_VIEWPORT
> >       def_bool y
> >       depends on USB_EHCI_TEGRA
> > 
> > If USB_ULPI_VIEWPORT has any other dependencies, the best solution
> > in the above scenario is to make USB_EHCI_TEGRA depend on those.
> 
> USB_ULPI_VIEWPORT is, AFAIK, a generic piece of infra-structure that
> USB_EHCI_TEGRA depends upon.

Sorry, I was probably confusing the symbol names. I meant whatever
you were going to "select" from USB_EHCI_TEGRA.

	Arnd

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found]                                 ` <201303082356.35033.arnd-r2nGTMty4D4@public.gmane.org>
@ 2013-03-09  0:10                                   ` Stephen Warren
  0 siblings, 0 replies; 27+ messages in thread
From: Stephen Warren @ 2013-03-09  0:10 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: balbi-l0cyMroinI0, Linux USB Mailing List, Greg KH,
	cbou-JGs/UdohzUI, dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

On 03/08/2013 04:56 PM, Arnd Bergmann wrote:
> On Friday 08 March 2013, Stephen Warren wrote:
>>> config USB_ULPI_VIEWPORT
>>>       def_bool y
>>>       depends on USB_EHCI_TEGRA
>>>
>>> If USB_ULPI_VIEWPORT has any other dependencies, the best solution
>>> in the above scenario is to make USB_EHCI_TEGRA depend on those.
>>
>> USB_ULPI_VIEWPORT is, AFAIK, a generic piece of infra-structure that
>> USB_EHCI_TEGRA depends upon.
> 
> Sorry, I was probably confusing the symbol names. I meant whatever
> you were going to "select" from USB_EHCI_TEGRA.

Ah OK, that'd be the Tegra PHY driver. Except now that I look, it
doesn't actually have its own Kconfig symbol (the Makefile builds it if
the Tegra EHCI driver is enabled). Perhaps it should? Otherwise, I guess
the Tegra EHCI driver Kconfig symbol would just have to depend on
everything that it and the PHY driver depend on.

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
  2013-03-08 18:37                   ` Stephen Warren
       [not found]                     ` <513A2FDD.2040800-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2013-03-14 11:01                     ` Felipe Balbi
       [not found]                       ` <20130314110129.GI32369-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
  1 sibling, 1 reply; 27+ messages in thread
From: Felipe Balbi @ 2013-03-14 11:01 UTC (permalink / raw)
  To: Stephen Warren
  Cc: balbi, Linux USB Mailing List, Greg KH, cbou, dwmw2, stern, arnd,
	linux-tegra, linux-omap

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

On Fri, Mar 08, 2013 at 11:37:17AM -0700, Stephen Warren wrote:
> On 03/08/2013 11:26 AM, Felipe Balbi wrote:
> > On Fri, Mar 08, 2013 at 10:14:11AM -0700, Stephen Warren wrote:
> >> On 03/08/2013 12:14 AM, Felipe Balbi wrote:
> >>> Hi,
> >>> 
> >>> On Thu, Mar 07, 2013 at 02:20:36PM -0700, Stephen Warren
> >>> wrote:
> >>>> On 03/07/2013 02:35 AM, Felipe Balbi wrote:
> >>>>> Hi folks,
> >>>>> 
> >>>>> inspired by Paul's DWC2 patchset which added 
> >>>>> usb_otg_state_string() (a copy of otg_state_string()) I
> >>>>> have now renamed otg_state_string() to
> >>>>> usb_otg_state_string(), moved it to usb-common, then moved
> >>>>> all phy drivers to drivers/usb/phy/ and completely deleted
> >>>>> the otg directory.
> >>>>> 
> >>>>> We're also removing CONFIG_USB_OTG_UTILS since that has
> >>>>> lots its meaning long ago.
> >>>>> 
> >>>>> I have compiled all patches with allyes, allno and allmod 
> >>>>> configs, but please make sure to test on your platforms to
> >>>>> make sure we're not leaking any more problems to mainline.
> >>>> 
> >>>> What branch do the patches apply to? They didn't "git am" for
> >>>> me on either next-20130305, nor 
> >>>> git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 
> >>>> next.
> >>> 
> >>> they're on top of my testing branch.
> >> 
> >> Ah, thanks. I took that whole branch, built ARM's
> >> tegra_defconfig, and see:
> >> 
> >>> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects
> >>> USB_ULPI which has unmet direct dependencies (USB_SUPPORT &&
> >>> USB_PHY && ARM) warning: (ARCH_TEGRA_2x_SOC &&
> >>> ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT which has unmet
> >>> direct dependencies (USB_SUPPORT && USB_PHY && USB_ULPI)
> >>> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects
> >>> USB_ULPI which has unmet direct dependencies (USB_SUPPORT &&
> >>> USB_PHY && ARM) warning: (ARCH_TEGRA_2x_SOC &&
> >>> ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT which has unmet
> >>> direct dependencies (USB_SUPPORT && USB_PHY && USB_ULPI)
> >> 
> >> Manually enabling USB_PHY fixes this. However, this highlights
> >> an issue with your removal of all selects (as mentioned in your
> >> other email) - it will break perhaps any defconfig that has USB
> >> enabled.
> >> 
> >> After enabling USB_PHY, the code builds and runs without issue.
> > 
> > fair enough, but then I'm just exposing the trouble. ARCH
> > shouldn't select USB_ULTI or any of the phy drivers, for that
> > matter.
> 
> Yes, I think it should instead work like:
> 
> ARCH_TEGRA* selects nothing in particular related to USB.
> 
> The Tegra EHCI controller Kconfig depends on ARCH_TEGRA so it doesn't
> show up for other builds. I hope it's OK for the EHCI controller to
> select USB_ARCH_HAS_EHCI?

that's something the ARCH should select but it has very little value. I
guess there has been some discussions about dropping that and I support
it.

> The Tegra EHCI controller Kconfig selects everything needed for it to
> be useful, i.e. PHY support and the Tegra PHY, and I guess the ULPI
> viewport options.

should it ? I don't know... There's no way to select something as
module, but there's no eas\(y\|ier\) way to make sure PHY is enabled
when building EHCI-tegra.

> The Tegra PHY Kconfig probably shouldn't be user-visible (relying on
> being selected by the Tegra EHCI controller) and itself selects
> anything it relies on.

That I really don't like. I think the driver should be selectable and
build in anything architecture. That's the easier way to:

a) build test a driver when applying patches; and
b) make sure drivers won't include <mach/*> or <asm/*>.

-- 
balbi

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

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

* Re: [PATCH 00/10] usb: phy: cleanups to Kconfig and directories
       [not found]                       ` <20130314110129.GI32369-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
@ 2013-03-15 20:50                         ` Stephen Warren
  0 siblings, 0 replies; 27+ messages in thread
From: Stephen Warren @ 2013-03-15 20:50 UTC (permalink / raw)
  To: balbi-l0cyMroinI0, Venu Byravarasu
  Cc: Linux USB Mailing List, Greg KH, cbou-JGs/UdohzUI,
	dwmw2-wEGCiKHe2LqWVfeAwA7xHQ,
	stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz, arnd-r2nGTMty4D4,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA

On 03/14/2013 05:01 AM, Felipe Balbi wrote:
> On Fri, Mar 08, 2013 at 11:37:17AM -0700, Stephen Warren wrote:
>> On 03/08/2013 11:26 AM, Felipe Balbi wrote:
>>> On Fri, Mar 08, 2013 at 10:14:11AM -0700, Stephen Warren
>>> wrote:
>>>> On 03/08/2013 12:14 AM, Felipe Balbi wrote:
>>>>> Hi,
>>>>> 
>>>>> On Thu, Mar 07, 2013 at 02:20:36PM -0700, Stephen Warren 
>>>>> wrote:
>>>>>> On 03/07/2013 02:35 AM, Felipe Balbi wrote:
>>>>>>> Hi folks,
>>>>>>> 
>>>>>>> inspired by Paul's DWC2 patchset which added 
>>>>>>> usb_otg_state_string() (a copy of otg_state_string())
>>>>>>> I have now renamed otg_state_string() to 
>>>>>>> usb_otg_state_string(), moved it to usb-common, then
>>>>>>> moved all phy drivers to drivers/usb/phy/ and
>>>>>>> completely deleted the otg directory.
>>>>>>> 
>>>>>>> We're also removing CONFIG_USB_OTG_UTILS since that
>>>>>>> has lots its meaning long ago.
>>>>>>> 
>>>>>>> I have compiled all patches with allyes, allno and
>>>>>>> allmod configs, but please make sure to test on your
>>>>>>> platforms to make sure we're not leaking any more
>>>>>>> problems to mainline.
>>>>>> 
>>>>>> What branch do the patches apply to? They didn't "git am"
>>>>>> for me on either next-20130305, nor 
>>>>>> git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
>>>>>>  next.
>>>>> 
>>>>> they're on top of my testing branch.
>>>> 
>>>> Ah, thanks. I took that whole branch, built ARM's 
>>>> tegra_defconfig, and see:
>>>> 
>>>>> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC) selects 
>>>>> USB_ULPI which has unmet direct dependencies (USB_SUPPORT
>>>>> && USB_PHY && ARM) warning: (ARCH_TEGRA_2x_SOC && 
>>>>> ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT which has
>>>>> unmet direct dependencies (USB_SUPPORT && USB_PHY &&
>>>>> USB_ULPI) warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC)
>>>>> selects USB_ULPI which has unmet direct dependencies
>>>>> (USB_SUPPORT && USB_PHY && ARM) warning: (ARCH_TEGRA_2x_SOC
>>>>> && ARCH_TEGRA_3x_SOC) selects USB_ULPI_VIEWPORT which has
>>>>> unmet direct dependencies (USB_SUPPORT && USB_PHY &&
>>>>> USB_ULPI)
>>>> 
>>>> Manually enabling USB_PHY fixes this. However, this
>>>> highlights an issue with your removal of all selects (as
>>>> mentioned in your other email) - it will break perhaps any
>>>> defconfig that has USB enabled.
>>>> 
>>>> After enabling USB_PHY, the code builds and runs without
>>>> issue.
>>> 
>>> fair enough, but then I'm just exposing the trouble. ARCH 
>>> shouldn't select USB_ULTI or any of the phy drivers, for that 
>>> matter.
>> 
>> Yes, I think it should instead work like:
>> 
>> ARCH_TEGRA* selects nothing in particular related to USB.
>> 
>> The Tegra EHCI controller Kconfig depends on ARCH_TEGRA so it
>> doesn't show up for other builds. I hope it's OK for the EHCI
>> controller to select USB_ARCH_HAS_EHCI?
> 
> that's something the ARCH should select but it has very little
> value. I guess there has been some discussions about dropping that
> and I support it.
> 
>> The Tegra EHCI controller Kconfig selects everything needed for
>> it to be useful, i.e. PHY support and the Tegra PHY, and I guess
>> the ULPI viewport options.
> 
> should it ? I don't know... There's no way to select something as 
> module, but there's no eas\(y\|ier\) way to make sure PHY is
> enabled when building EHCI-tegra.
> 
>> The Tegra PHY Kconfig probably shouldn't be user-visible (relying
>> on being selected by the Tegra EHCI controller) and itself
>> selects anything it relies on.
> 
> That I really don't like. I think the driver should be selectable
> and build in anything architecture. That's the easier way to:
> 
> a) build test a driver when applying patches; and b) make sure
> drivers won't include <mach/*> or <asm/*>.

Venu, can you please look into the right changes to make for Tegra,
and drive this forward. Thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2013-03-15 20:50 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-07  9:35 [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Felipe Balbi
2013-03-07  9:36 ` [PATCH 01/10] usb: otg: prefix otg_state_string with usb_ Felipe Balbi
2013-03-07  9:36 ` [PATCH 02/10] usb: otg: move usb_otg_state_string to usb-common.c Felipe Balbi
2013-03-07  9:36 ` [PATCH 03/10] usb: phy: convert EXPORT_SYMBOL to EXPORT_SYMBOL_GPL Felipe Balbi
2013-03-07  9:36 ` [PATCH 04/10] usb: phy: move all PHY drivers to drivers/usb/phy/ Felipe Balbi
2013-03-07  9:36 ` [PATCH 05/10] usb: phy: make it a menuconfig Felipe Balbi
2013-03-07  9:36 ` [PATCH 07/10] usb: gadget: mv_udc_core: check against CONFIG_USB_PHY Felipe Balbi
2013-03-07  9:36 ` [PATCH 09/10] usb: ehci: tegra: " Felipe Balbi
     [not found]   ` <1362648969-13737-10-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2013-03-07 20:54     ` Stephen Warren
2013-03-08  7:10       ` Felipe Balbi
2013-03-07  9:36 ` [PATCH 10/10] usb: phy: remove CONFIG_USB_OTG_UTILS Felipe Balbi
     [not found]   ` <1362648969-13737-11-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2013-03-07 14:41     ` [PATCH v2] " Felipe Balbi
2013-03-07 16:01 ` [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Alan Stern
     [not found]   ` <Pine.LNX.4.44L0.1303071101190.1646-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-03-07 16:41     ` Felipe Balbi
     [not found] ` <1362648969-13737-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2013-03-07  9:36   ` [PATCH 06/10] usb: power: pda_power: check against CONFIG_USB_PHY Felipe Balbi
2013-03-07  9:36   ` [PATCH 08/10] usb: ehci: marvel: " Felipe Balbi
2013-03-07 21:20   ` [PATCH 00/10] usb: phy: cleanups to Kconfig and directories Stephen Warren
     [not found]     ` <513904A4.7040101-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-03-08  7:14       ` Felipe Balbi
     [not found]         ` <20130308071453.GD21589-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-03-08 17:14           ` Stephen Warren
     [not found]             ` <513A1C63.9050704-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-03-08 18:26               ` Felipe Balbi
     [not found]                 ` <20130308182623.GD900-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-03-08 18:37                   ` Stephen Warren
     [not found]                     ` <513A2FDD.2040800-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-03-08 23:08                       ` Arnd Bergmann
     [not found]                         ` <201303082308.31499.arnd-r2nGTMty4D4@public.gmane.org>
2013-03-08 23:23                           ` Stephen Warren
     [not found]                             ` <513A72E8.2070707-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-03-08 23:56                               ` Arnd Bergmann
     [not found]                                 ` <201303082356.35033.arnd-r2nGTMty4D4@public.gmane.org>
2013-03-09  0:10                                   ` Stephen Warren
2013-03-14 11:01                     ` Felipe Balbi
     [not found]                       ` <20130314110129.GI32369-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-03-15 20:50                         ` Stephen Warren

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