arm: omap3beagle: init musb default role by Kconfig
Subsystems (5)
PATCH 1/1 arm: omap3beagle: init musb default role by Kconfig
Currently musb is initialized to OTG mode by default in musb_board_data, it's better to init it depending on Kconfig.
--- arch/arm/mach-omap2/board-omap3beagle.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-omap3beagle.c +7 -1
@@ -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 , };
Signature · 1 line
1.6.3.3
Hi,
Quoted 2 lines · Bob Liu
Currently musb is initialized to OTG mode by default in
musb_board_data, it's better to init it depending onKconfig.
what's the problem in always keeping OTG ? that board is wired for OTG anyway.
Signature · 1 line
balbi
Quoted 9 lines · Felipe Balbi
Hi,
Quoted 2 lines · Bob Liu
Currently musb is initialized to OTG mode by default in
musb_board_data, it's better to init it depending onKconfig.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
Signature · 2 lines
Regards, --Bob
Quoted 11 lines · Bob Liu
Quoted 9 lines · Felipe Balbi
Hi,
Quoted 2 lines · Bob Liu
Currently musb is initialized to OTG mode by default in
musb_board_data, it's better to init it depending onKconfig.what's the problem in always keeping OTG ? that board is wired for OTG anyway.
Quoted 5 lines
Yeah, but it's better if user can make their choices by themselves. Or mask the other choices in
Kconfigif keeping OTG. Currently user can select HOST-only mode inKconfig, 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.
Quoted 3 lines
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:
drivers/usb/musb/musb_core.c +0 -25
@@ -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) {
Signature · 1 line
balbi
Quoted 18 lines · Felipe Balbi
Quoted 11 lines · Bob Liu
Quoted 9 lines · Felipe Balbi
Hi,
Quoted 2 lines · Bob Liu
Currently musb is initialized to OTG mode by default in
musb_board_data, it's better to init it depending onKconfig.what's the problem in always keeping OTG ? that board is wired for OTG anyway.
Quoted 5 lines
Yeah, but it's better if user can make their choices by themselves. Or mask the other choices in
Kconfigif keeping OTG. Currently user can select HOST-only mode inKconfig, but will receive compiler error.
In my opinion, this should be consist.
Quoted 8 lines
compile error ?? Would you share that ? All I see is a
dev_err()whenKconfigdoesn't match board-file.Quoted 3 lines
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 ?
Quoted 38 lines
drivers/usb/musb/musb_core.c +0
-25@@ -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) {
Signature · 6 lines
Regards, --Bob -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
Quoted 5 lines · Bob Liu
Quoted 1 line
I can be related. Try this:
Yeah, it works. Thanks, sorry for the noise
.
BTW: Is the below patch which aboutmusb_core.cwill be merged into mainline ?
I thinking on doing that, yes.
Signature · 1 line
balbi