Re: [PATCH 4/4] USB: musb: fix HOST or PERIPHERAL only mode(v3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

tom.leiming@xxxxxxxxx wrote:

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.
---

  The 2nd --- not needed.

 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",

 Why you suddenly changed the indentation level here?

+		(plat->mode == MUSB_HOST) ? "host" : "peripheral");
+	break;
+#endif
+bad_config:
 	default:
 		dev_err(dev, "incompatible Kconfig role setting\n");
 		status = -EINVAL;

WBR, Sergei

--
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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux