From: Ming Lei <tom.leiming@xxxxxxxxx> The plat->mode passed from platform_data always is MUSB_OTG, so the init failures below will happen if we configure musb as HOST or PERIPHERAL mode in Kconfig: "incompatible Kconfig role setting" The patch fixes the issue by degrading otg mode to host or peripheral mode in such case. Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx> --- The version is against the latest gregkh usb tree. --- drivers/usb/musb/musb_core.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index fad70bc..762600a 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1977,8 +1977,18 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) #ifdef CONFIG_USB_MUSB_OTG break; #else -bad_config: +#ifdef CONFIG_USB_MUSB_HDRC_HCD + plat->mode = MUSB_HOST; #endif + +#ifdef CONFIG_USB_GADGET_MUSB_HDRC + plat->mode = MUSB_PERIPHERAL; +#endif + dev_info(dev, "degrade from otg to %s-only mode\n", + (plat->mode == MUSB_HOST) ? "host" : "peripheral"); + break; +#endif +bad_config: default: dev_err(dev, "incompatible Kconfig role setting\n"); status = -EINVAL; -- 1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html