[PATCH 6/7] musb: sunxi: Always register both host and udc when build with dual-role support

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

 



On sunxi the handling of host- / peripheral-only mode is fully taken care
of in the phy driver. So we can always safely let the musb-core register
both the host and udc.

Besides a nice cleanup, this is also a preparation patch for adding
run-time dr_mode switching support via the "mode" musb sysfs attribute
and the platform_set_mode() callback.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 drivers/usb/musb/sunxi.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
index c6ee166..868db03 100644
--- a/drivers/usb/musb/sunxi.c
+++ b/drivers/usb/musb/sunxi.c
@@ -615,26 +615,8 @@ static int sunxi_musb_probe(struct platform_device *pdev)
 	}
 
 	memset(&pdata, 0, sizeof(pdata));
-	switch (usb_get_dr_mode(&pdev->dev)) {
-#if defined CONFIG_USB_MUSB_DUAL_ROLE || defined CONFIG_USB_MUSB_HOST
-	case USB_DR_MODE_HOST:
-		pdata.mode = MUSB_PORT_MODE_HOST;
-		break;
-#endif
-#if defined CONFIG_USB_MUSB_DUAL_ROLE || defined CONFIG_USB_MUSB_GADGET
-	case USB_DR_MODE_PERIPHERAL:
-		pdata.mode = MUSB_PORT_MODE_GADGET;
-		break;
-#endif
-#ifdef CONFIG_USB_MUSB_DUAL_ROLE
-	case USB_DR_MODE_OTG:
-		pdata.mode = MUSB_PORT_MODE_DUAL_ROLE;
-		break;
-#endif
-	default:
-		dev_err(&pdev->dev, "Invalid or missing 'dr_mode' property\n");
-		return -EINVAL;
-	}
+	/* devicetree dr_mode setting is handled by the phy driver */
+	pdata.mode		= MUSB_PORT_MODE_DUAL_ROLE;
 	pdata.platform_ops	= &sunxi_musb_ops;
 	pdata.config		= &sunxi_musb_hdrc_config;
 
-- 
2.7.4

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