[RFC] musb: removing otg protocol support

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

 



Hi,

The kernel usb stack and musb drivers have gone through some changes in
the past several kernel versions, such as adding otg fsm, musb runtime
PM, and musb otg state moving from musb to musb->xceiv... I am wondering
if the otg protocol (hnp, srp) functions are already broken in the musb
drivers, but I don't have a platform to confirm it.

Do we know by any chance there is still someone using the musb otg
functions in any relatively newer kernel and we still need to support
otg in musb?  If not, I am thinking to clean up the otg functions in
musb drivers to make the code easy to read and maintain.

If we can make the conclusion to remove it, I propose the patch below
to disable musb otg first, then clean up the driver later if nobody
complains about the otg function removal.

Regards,
-Bin.

8<---

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 86066328e480..4403b4cdd0b8 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1865,11 +1865,8 @@ int musb_gadget_setup(struct musb *musb)
 
 	/* this "gadget" abstracts/virtualizes the controller */
 	musb->g.name = musb_driver_name;
-#if IS_ENABLED(CONFIG_USB_MUSB_DUAL_ROLE)
-	musb->g.is_otg = 1;
-#elif IS_ENABLED(CONFIG_USB_MUSB_GADGET)
+	/* don't support otg protocols */
 	musb->g.is_otg = 0;
-#endif
 	INIT_DELAYED_WORK(&musb->gadget_work, musb_gadget_work);
 	musb_g_init_endpoints(musb);
 
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 069a1f775048..a3a5bd36ee98 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -2795,7 +2795,8 @@ int musb_host_setup(struct musb *musb, int power_budget)
 		musb->xceiv->otg->state = OTG_STATE_A_IDLE;
 	}
 	otg_set_host(musb->xceiv->otg, &hcd->self);
-	hcd->self.otg_port = 1;
+	/* don't support otg protocols */
+	hcd->self.otg_port = 0;
 	musb->xceiv->otg->host = &hcd->self;
 	hcd->power_budget = 2 * (power_budget ? : 250);
 
-- 
1.9.1

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