* [PATCH] arm: omap3beagle: init musb default role by Kconfig
@ 2011-02-15 8:55 Bob Liu
2011-02-15 11:23 ` Felipe Balbi
0 siblings, 1 reply; 6+ messages in thread
From: Bob Liu @ 2011-02-15 8:55 UTC (permalink / raw)
To: linux-omap; +Cc: archit, tony, balbi, adrian.hunter, Bob Liu
Currently musb is initialized to OTG mode by default in musb_board_data, it's
better to init it depending on Kconfig.
Signed-off-by: Bob Liu <lliubbo@gmail.com>
---
arch/arm/mach-omap2/board-omap3beagle.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 14f4224..fb82773 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -554,7 +554,13 @@ static struct omap_board_mux board_mux[] __initdata = {
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
- .mode = MUSB_OTG,
+#if defined(CONFIG_USB_MUSB_OTG)
+ .mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
--
1.6.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] arm: omap3beagle: init musb default role by Kconfig
2011-02-15 8:55 [PATCH] arm: omap3beagle: init musb default role by Kconfig Bob Liu
@ 2011-02-15 11:23 ` Felipe Balbi
2011-02-16 2:07 ` Bob Liu
0 siblings, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2011-02-15 11:23 UTC (permalink / raw)
To: Bob Liu; +Cc: linux-omap, archit, tony, balbi, adrian.hunter
Hi,
On Tue, Feb 15, 2011 at 04:55:00PM +0800, Bob Liu wrote:
> Currently musb is initialized to OTG mode by default in musb_board_data, it's
> better to init it depending on Kconfig.
what's the problem in always keeping OTG ? that board is wired for OTG
anyway.
--
balbi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arm: omap3beagle: init musb default role by Kconfig
2011-02-15 11:23 ` Felipe Balbi
@ 2011-02-16 2:07 ` Bob Liu
2011-02-16 8:05 ` Felipe Balbi
0 siblings, 1 reply; 6+ messages in thread
From: Bob Liu @ 2011-02-16 2:07 UTC (permalink / raw)
To: balbi; +Cc: linux-omap, archit, tony, adrian.hunter
On Tue, Feb 15, 2011 at 7:23 PM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Tue, Feb 15, 2011 at 04:55:00PM +0800, Bob Liu wrote:
>> Currently musb is initialized to OTG mode by default in musb_board_data, it's
>> better to init it depending on Kconfig.
>
> what's the problem in always keeping OTG ? that board is wired for OTG
> anyway.
>
Yeah, but it's better if user can make their choices by themselves.
Or mask the other choices in Kconfig if keeping OTG.
Currently user can select HOST-only mode in Kconfig, but will receive
compiler error.
In my opinion, this should be consist.
Another problem is if keeping in OTG mode, my board can't recognize usb device.
HOST-only mode works fine, I am still debugging on it.
But I think it's not related with current topic.
Thanks
--
Regards,
--Bob
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arm: omap3beagle: init musb default role by Kconfig
2011-02-16 2:07 ` Bob Liu
@ 2011-02-16 8:05 ` Felipe Balbi
2011-02-16 8:49 ` Bob Liu
0 siblings, 1 reply; 6+ messages in thread
From: Felipe Balbi @ 2011-02-16 8:05 UTC (permalink / raw)
To: Bob Liu; +Cc: balbi, linux-omap, archit, tony, adrian.hunter
On Wed, Feb 16, 2011 at 10:07:26AM +0800, Bob Liu wrote:
> On Tue, Feb 15, 2011 at 7:23 PM, Felipe Balbi <balbi@ti.com> wrote:
> > Hi,
> >
> > On Tue, Feb 15, 2011 at 04:55:00PM +0800, Bob Liu wrote:
> >> Currently musb is initialized to OTG mode by default in musb_board_data, it's
> >> better to init it depending on Kconfig.
> >
> > what's the problem in always keeping OTG ? that board is wired for OTG
> > anyway.
> >
>
> Yeah, but it's better if user can make their choices by themselves.
> Or mask the other choices in Kconfig if keeping OTG.
> Currently user can select HOST-only mode in Kconfig, but will receive
> compiler error.
> In my opinion, this should be consist.
compile error ?? Would you share that ? All I see is a dev_err() when
Kconfig doesn't match board-file.
> Another problem is if keeping in OTG mode, my board can't recognize usb device.
> HOST-only mode works fine, I am still debugging on it.
> But I think it's not related with current topic.
I can be related. Try this:
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 54a8bd1..bc29655 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1949,31 +1949,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
goto fail0;
}
- switch (plat->mode) {
- case MUSB_HOST:
-#ifdef CONFIG_USB_MUSB_HDRC_HCD
- break;
-#else
- goto bad_config;
-#endif
- case MUSB_PERIPHERAL:
-#ifdef CONFIG_USB_GADGET_MUSB_HDRC
- break;
-#else
- goto bad_config;
-#endif
- case MUSB_OTG:
-#ifdef CONFIG_USB_MUSB_OTG
- break;
-#else
-bad_config:
-#endif
- default:
- dev_err(dev, "incompatible Kconfig role setting\n");
- status = -EINVAL;
- goto fail0;
- }
-
/* allocate */
musb = allocate_instance(dev, plat->config, ctrl);
if (!musb) {
--
balbi
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] arm: omap3beagle: init musb default role by Kconfig
2011-02-16 8:05 ` Felipe Balbi
@ 2011-02-16 8:49 ` Bob Liu
2011-02-16 9:02 ` Felipe Balbi
0 siblings, 1 reply; 6+ messages in thread
From: Bob Liu @ 2011-02-16 8:49 UTC (permalink / raw)
To: balbi; +Cc: linux-omap, archit, tony, adrian.hunter
On Wed, Feb 16, 2011 at 4:05 PM, Felipe Balbi <balbi@ti.com> wrote:
> On Wed, Feb 16, 2011 at 10:07:26AM +0800, Bob Liu wrote:
>> On Tue, Feb 15, 2011 at 7:23 PM, Felipe Balbi <balbi@ti.com> wrote:
>> > Hi,
>> >
>> > On Tue, Feb 15, 2011 at 04:55:00PM +0800, Bob Liu wrote:
>> >> Currently musb is initialized to OTG mode by default in musb_board_data, it's
>> >> better to init it depending on Kconfig.
>> >
>> > what's the problem in always keeping OTG ? that board is wired for OTG
>> > anyway.
>> >
>>
>> Yeah, but it's better if user can make their choices by themselves.
>> Or mask the other choices in Kconfig if keeping OTG.
>> Currently user can select HOST-only mode in Kconfig, but will receive
>> compiler error.
>> In my opinion, this should be consist.
>
> compile error ?? Would you share that ? All I see is a dev_err() when
> Kconfig doesn't match board-file.
>
>> Another problem is if keeping in OTG mode, my board can't recognize usb device.
>> HOST-only mode works fine, I am still debugging on it.
>> But I think it's not related with current topic.
>
> I can be related. Try this:
Yeah, it works. Thanks, sorry for the noise
.
BTW: Is the below patch which about musb_core.c will be merged into mainline ?
>
> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> index 54a8bd1..bc29655 100644
> --- a/drivers/usb/musb/musb_core.c
> +++ b/drivers/usb/musb/musb_core.c
> @@ -1949,31 +1949,6 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
> goto fail0;
> }
>
> - switch (plat->mode) {
> - case MUSB_HOST:
> -#ifdef CONFIG_USB_MUSB_HDRC_HCD
> - break;
> -#else
> - goto bad_config;
> -#endif
> - case MUSB_PERIPHERAL:
> -#ifdef CONFIG_USB_GADGET_MUSB_HDRC
> - break;
> -#else
> - goto bad_config;
> -#endif
> - case MUSB_OTG:
> -#ifdef CONFIG_USB_MUSB_OTG
> - break;
> -#else
> -bad_config:
> -#endif
> - default:
> - dev_err(dev, "incompatible Kconfig role setting\n");
> - status = -EINVAL;
> - goto fail0;
> - }
> -
> /* allocate */
> musb = allocate_instance(dev, plat->config, ctrl);
> if (!musb) {
>
--
Regards,
--Bob
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] arm: omap3beagle: init musb default role by Kconfig
2011-02-16 8:49 ` Bob Liu
@ 2011-02-16 9:02 ` Felipe Balbi
0 siblings, 0 replies; 6+ messages in thread
From: Felipe Balbi @ 2011-02-16 9:02 UTC (permalink / raw)
To: Bob Liu; +Cc: balbi, linux-omap, archit, tony, adrian.hunter
Hi,
On Wed, Feb 16, 2011 at 04:49:34PM +0800, Bob Liu wrote:
> > I can be related. Try this:
>
> Yeah, it works. Thanks, sorry for the noise
> .
> BTW: Is the below patch which about musb_core.c will be merged into mainline ?
I thinking on doing that, yes.
--
balbi
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-02-16 9:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15 8:55 [PATCH] arm: omap3beagle: init musb default role by Kconfig Bob Liu
2011-02-15 11:23 ` Felipe Balbi
2011-02-16 2:07 ` Bob Liu
2011-02-16 8:05 ` Felipe Balbi
2011-02-16 8:49 ` Bob Liu
2011-02-16 9:02 ` Felipe Balbi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox