* [PATCH 0/2] Few MUSB fixes for ifdef removal
@ 2012-06-13 10:15 Tony Lindgren
2012-06-13 10:15 ` [PATCH 1/2] ARM: OMAP2+: Fix MUSB ifdefs for platform init code Tony Lindgren
2012-06-13 10:15 ` [PATCH 2/2] ARM: OMAP2: Fix tusb6010 GPIO interrupt for n8x0 Tony Lindgren
0 siblings, 2 replies; 7+ messages in thread
From: Tony Lindgren @ 2012-06-13 10:15 UTC (permalink / raw)
To: linux-arm-kernel
Hi all,
Here are two regression fixes for the MUSB ifdef removal.
Note that this series does not fix things for blackfin
or davinci, similar fixes should be done for those.
Regards,
Tony
---
Tony Lindgren (2):
ARM: OMAP2+: Fix MUSB ifdefs for platform init code
ARM: OMAP2: Fix tusb6010 GPIO interrupt for n8x0
arch/arm/mach-omap2/board-n8x0.c | 6 ++----
arch/arm/mach-omap2/omap_phy_internal.c | 6 ------
arch/arm/mach-omap2/usb-musb.c | 6 ++----
arch/arm/mach-omap2/usb-tusb6010.c | 2 +-
4 files changed, 5 insertions(+), 15 deletions(-)
--
Signature
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] ARM: OMAP2+: Fix MUSB ifdefs for platform init code
2012-06-13 10:15 [PATCH 0/2] Few MUSB fixes for ifdef removal Tony Lindgren
@ 2012-06-13 10:15 ` Tony Lindgren
2012-06-22 10:15 ` Felipe Balbi
2012-06-13 10:15 ` [PATCH 2/2] ARM: OMAP2: Fix tusb6010 GPIO interrupt for n8x0 Tony Lindgren
1 sibling, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2012-06-13 10:15 UTC (permalink / raw)
To: linux-arm-kernel
Commit 62285963 (usb: musb: drop a gigantic amount of ifdeferry)
got rid of a bunch of ifdefs in the MUSB code. Looks like the
platform init code is still using these dropped defines though,
which in many cases results the board defaulting always to host
mode.
Currently the situation is that USB_MUSB_HDRC is the main
Kconfig option with additional USB_GADGET_MUSB_HDRC so only
these two should be used to select between host and OTG mode.
Fix the situation for omaps. The following users should fix the
platform init code in a similar way:
Dropped Kconfig option Current users
USB_MUSB_OTG blackfin, davinci, not in Kconfigs
USB_MUSB_PERIPHERAL davinci, not in Kconfigs
USB_MUSB_HOST davinci, not in Kconfigs
USB_MUSB_HDRC_HCD blackfin, not in Kconfigs
USB_MUSB_OTG blackfin, not in Kconfigs
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: linux-usb at vger.kernel.org
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/board-n8x0.c | 6 ++----
arch/arm/mach-omap2/omap_phy_internal.c | 6 ------
arch/arm/mach-omap2/usb-musb.c | 6 ++----
3 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 1b582c6..b3e1afe 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -86,11 +86,9 @@ static struct musb_hdrc_config musb_config = {
};
static struct musb_hdrc_platform_data tusb_data = {
-#if defined(CONFIG_USB_MUSB_OTG)
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
.mode = MUSB_OTG,
-#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
- .mode = MUSB_PERIPHERAL,
-#else /* defined(CONFIG_USB_MUSB_HOST) */
+#else
.mode = MUSB_HOST,
#endif
.set_power = tusb_set_power,
diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index 4c90477..d52651a 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -239,21 +239,15 @@ void am35x_set_mode(u8 musb_mode)
devconf2 &= ~CONF2_OTGMODE;
switch (musb_mode) {
-#ifdef CONFIG_USB_MUSB_HDRC_HCD
case MUSB_HOST: /* Force VBUS valid, ID = 0 */
devconf2 |= CONF2_FORCE_HOST;
break;
-#endif
-#ifdef CONFIG_USB_GADGET_MUSB_HDRC
case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */
devconf2 |= CONF2_FORCE_DEVICE;
break;
-#endif
-#ifdef CONFIG_USB_MUSB_OTG
case MUSB_OTG: /* Don't override the VBUS/ID comparators */
devconf2 |= CONF2_NO_OVERRIDE;
break;
-#endif
default:
pr_info(KERN_INFO "Unsupported mode %u\n", musb_mode);
}
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index b19d1b4..c4a5768 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -41,12 +41,10 @@ static struct musb_hdrc_config musb_config = {
};
static struct musb_hdrc_platform_data musb_plat = {
-#ifdef CONFIG_USB_MUSB_OTG
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
.mode = MUSB_OTG,
-#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+#else
.mode = MUSB_HOST,
-#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
- .mode = MUSB_PERIPHERAL,
#endif
/* .clock is set dynamically */
.config = &musb_config,
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: OMAP2: Fix tusb6010 GPIO interrupt for n8x0
2012-06-13 10:15 [PATCH 0/2] Few MUSB fixes for ifdef removal Tony Lindgren
2012-06-13 10:15 ` [PATCH 1/2] ARM: OMAP2+: Fix MUSB ifdefs for platform init code Tony Lindgren
@ 2012-06-13 10:15 ` Tony Lindgren
2012-06-25 9:38 ` Felipe Balbi
1 sibling, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2012-06-13 10:15 UTC (permalink / raw)
To: linux-arm-kernel
Here's one more gpio_to_irq conversion that we missed
earlier. Tested with n800 in gadget mode using USB_ETH.
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/mach-omap2/usb-tusb6010.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c
index db84a46..805bea6 100644
--- a/arch/arm/mach-omap2/usb-tusb6010.c
+++ b/arch/arm/mach-omap2/usb-tusb6010.c
@@ -300,7 +300,7 @@ tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
printk(error, 3, status);
return status;
}
- tusb_resources[2].start = irq + IH_GPIO_BASE;
+ tusb_resources[2].start = gpio_to_irq(irq);
/* set up memory timings ... can speed them up later */
if (!ps_refclk) {
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/2] ARM: OMAP2+: Fix MUSB ifdefs for platform init code
2012-06-13 10:15 ` [PATCH 1/2] ARM: OMAP2+: Fix MUSB ifdefs for platform init code Tony Lindgren
@ 2012-06-22 10:15 ` Felipe Balbi
2012-06-25 10:47 ` Tony Lindgren
0 siblings, 1 reply; 7+ messages in thread
From: Felipe Balbi @ 2012-06-22 10:15 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jun 13, 2012 at 03:15:06AM -0700, Tony Lindgren wrote:
> Commit 62285963 (usb: musb: drop a gigantic amount of ifdeferry)
> got rid of a bunch of ifdefs in the MUSB code. Looks like the
> platform init code is still using these dropped defines though,
> which in many cases results the board defaulting always to host
> mode.
>
> Currently the situation is that USB_MUSB_HDRC is the main
> Kconfig option with additional USB_GADGET_MUSB_HDRC so only
> these two should be used to select between host and OTG mode.
>
> Fix the situation for omaps. The following users should fix the
> platform init code in a similar way:
>
> Dropped Kconfig option Current users
>
> USB_MUSB_OTG blackfin, davinci, not in Kconfigs
> USB_MUSB_PERIPHERAL davinci, not in Kconfigs
> USB_MUSB_HOST davinci, not in Kconfigs
> USB_MUSB_HDRC_HCD blackfin, not in Kconfigs
> USB_MUSB_OTG blackfin, not in Kconfigs
>
> Cc: Mike Frysinger <vapier@gentoo.org>
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: linux-usb at vger.kernel.org
> Cc: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
Looks ok, though I would stick to things boards are wired to do. e.g.:
all development boards are wired for OTG (with a few exceptions),
n800 is peripheral only
n810 is OTG
and so on. That way you remove all the clutter.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120622/1655eeeb/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] ARM: OMAP2: Fix tusb6010 GPIO interrupt for n8x0
2012-06-13 10:15 ` [PATCH 2/2] ARM: OMAP2: Fix tusb6010 GPIO interrupt for n8x0 Tony Lindgren
@ 2012-06-25 9:38 ` Felipe Balbi
0 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2012-06-25 9:38 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jun 13, 2012 at 03:15:12AM -0700, Tony Lindgren wrote:
> Here's one more gpio_to_irq conversion that we missed
> earlier. Tested with n800 in gadget mode using USB_ETH.
>
> Cc: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Felipe Balbi <balbi@ti.com>
> ---
> arch/arm/mach-omap2/usb-tusb6010.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c
> index db84a46..805bea6 100644
> --- a/arch/arm/mach-omap2/usb-tusb6010.c
> +++ b/arch/arm/mach-omap2/usb-tusb6010.c
> @@ -300,7 +300,7 @@ tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
> printk(error, 3, status);
> return status;
> }
> - tusb_resources[2].start = irq + IH_GPIO_BASE;
> + tusb_resources[2].start = gpio_to_irq(irq);
>
> /* set up memory timings ... can speed them up later */
> if (!ps_refclk) {
>
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120625/bd7020b7/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] ARM: OMAP2+: Fix MUSB ifdefs for platform init code
2012-06-22 10:15 ` Felipe Balbi
@ 2012-06-25 10:47 ` Tony Lindgren
2012-06-25 10:53 ` Felipe Balbi
0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2012-06-25 10:47 UTC (permalink / raw)
To: linux-arm-kernel
* Felipe Balbi <balbi@ti.com> [120622 03:22]:
> On Wed, Jun 13, 2012 at 03:15:06AM -0700, Tony Lindgren wrote:
> > Commit 62285963 (usb: musb: drop a gigantic amount of ifdeferry)
> > got rid of a bunch of ifdefs in the MUSB code. Looks like the
> > platform init code is still using these dropped defines though,
> > which in many cases results the board defaulting always to host
> > mode.
> >
> > Currently the situation is that USB_MUSB_HDRC is the main
> > Kconfig option with additional USB_GADGET_MUSB_HDRC so only
> > these two should be used to select between host and OTG mode.
> >
> > Fix the situation for omaps. The following users should fix the
> > platform init code in a similar way:
> >
> > Dropped Kconfig option Current users
> >
> > USB_MUSB_OTG blackfin, davinci, not in Kconfigs
> > USB_MUSB_PERIPHERAL davinci, not in Kconfigs
> > USB_MUSB_HOST davinci, not in Kconfigs
> > USB_MUSB_HDRC_HCD blackfin, not in Kconfigs
> > USB_MUSB_OTG blackfin, not in Kconfigs
> >
> > Cc: Mike Frysinger <vapier@gentoo.org>
> > Cc: Sekhar Nori <nsekhar@ti.com>
> > Cc: linux-usb at vger.kernel.org
> > Cc: Felipe Balbi <balbi@ti.com>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
>
> Looks ok, though I would stick to things boards are wired to do. e.g.:
>
> all development boards are wired for OTG (with a few exceptions),
> n800 is peripheral only
> n810 is OTG
>
> and so on. That way you remove all the clutter.
FYI, these got already merged last week as fixes because of the
broken Kconfig options.
What you're suggesting sounds like a good follow-up patch to improve
things, although I suggest that we remove CONFIG_USB_GADGET_MUSB_HDRC
ifdef else from board-*.c files, and always set host = MUSB_OTG.
For example, both n800 and n810 are wired up the same way except for
the mini-B vs mini-AB connector. The connector alone should be enough
to keep n800 as peripheral unless somebody specifically wants to force
it into host mode by using a non-standard cable or the debug options.
AFAIK, this same logic should apply to all the devices, or do you
see issues with it?
Regards,
Tony
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] ARM: OMAP2+: Fix MUSB ifdefs for platform init code
2012-06-25 10:47 ` Tony Lindgren
@ 2012-06-25 10:53 ` Felipe Balbi
0 siblings, 0 replies; 7+ messages in thread
From: Felipe Balbi @ 2012-06-25 10:53 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Mon, Jun 25, 2012 at 03:47:20AM -0700, Tony Lindgren wrote:
> * Felipe Balbi <balbi@ti.com> [120622 03:22]:
> > On Wed, Jun 13, 2012 at 03:15:06AM -0700, Tony Lindgren wrote:
> > > Commit 62285963 (usb: musb: drop a gigantic amount of ifdeferry)
> > > got rid of a bunch of ifdefs in the MUSB code. Looks like the
> > > platform init code is still using these dropped defines though,
> > > which in many cases results the board defaulting always to host
> > > mode.
> > >
> > > Currently the situation is that USB_MUSB_HDRC is the main
> > > Kconfig option with additional USB_GADGET_MUSB_HDRC so only
> > > these two should be used to select between host and OTG mode.
> > >
> > > Fix the situation for omaps. The following users should fix the
> > > platform init code in a similar way:
> > >
> > > Dropped Kconfig option Current users
> > >
> > > USB_MUSB_OTG blackfin, davinci, not in Kconfigs
> > > USB_MUSB_PERIPHERAL davinci, not in Kconfigs
> > > USB_MUSB_HOST davinci, not in Kconfigs
> > > USB_MUSB_HDRC_HCD blackfin, not in Kconfigs
> > > USB_MUSB_OTG blackfin, not in Kconfigs
> > >
> > > Cc: Mike Frysinger <vapier@gentoo.org>
> > > Cc: Sekhar Nori <nsekhar@ti.com>
> > > Cc: linux-usb at vger.kernel.org
> > > Cc: Felipe Balbi <balbi@ti.com>
> > > Signed-off-by: Tony Lindgren <tony@atomide.com>
> >
> > Looks ok, though I would stick to things boards are wired to do. e.g.:
> >
> > all development boards are wired for OTG (with a few exceptions),
> > n800 is peripheral only
> > n810 is OTG
> >
> > and so on. That way you remove all the clutter.
>
> FYI, these got already merged last week as fixes because of the
> broken Kconfig options.
>
> What you're suggesting sounds like a good follow-up patch to improve
> things, although I suggest that we remove CONFIG_USB_GADGET_MUSB_HDRC
> ifdef else from board-*.c files, and always set host = MUSB_OTG.
>
> For example, both n800 and n810 are wired up the same way except for
> the mini-B vs mini-AB connector. The connector alone should be enough
> to keep n800 as peripheral unless somebody specifically wants to force
> it into host mode by using a non-standard cable or the debug options.
>
> AFAIK, this same logic should apply to all the devices, or do you
> see issues with it?
no, that's pretty much what I tried to say ;-) If board has a
mini/micro-B receptacle, then it can't be host/OTG/DRD (unless you hack
the cable, or change ID pin rules on the transceiver, or you force the
IP to host mode through the testmode register).
Now if board has mini/micro-AB, then it's surely supporting OTG, so we
can set board_file to MUSB_OTG. That will drop all ifdeferry too.
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120625/52735491/attachment-0001.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-06-25 10:53 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-13 10:15 [PATCH 0/2] Few MUSB fixes for ifdef removal Tony Lindgren
2012-06-13 10:15 ` [PATCH 1/2] ARM: OMAP2+: Fix MUSB ifdefs for platform init code Tony Lindgren
2012-06-22 10:15 ` Felipe Balbi
2012-06-25 10:47 ` Tony Lindgren
2012-06-25 10:53 ` Felipe Balbi
2012-06-13 10:15 ` [PATCH 2/2] ARM: OMAP2: Fix tusb6010 GPIO interrupt for n8x0 Tony Lindgren
2012-06-25 9:38 ` Felipe Balbi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).