Set musb config->maximum_speed based on the dts setting to control musb
speed.
By default musb works in high-speed mode. Adding
maximum-speed = "full-speed";
to dts usb node will force musb to full-speed mode.
Signed-off-by: Bin Liu <[email protected]>
---
drivers/usb/musb/musb_dsps.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 0ca6011..268e2b5 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -736,6 +736,11 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
pdata.power = get_int_prop(dn, "mentor,power") / 2;
config->multipoint = of_property_read_bool(dn, "mentor,multipoint");
+ config->maximum_speed = of_usb_get_maximum_speed(musb->dev.of_node);
+ if (config->maximum_speed == USB_SPEED_UNKNOWN ||
+ config->maximum_speed > USB_SPEED_HIGH)
+ config->maximum_speed = USB_SPEED_HIGH;
+
ret = platform_device_add_data(musb, &pdata, sizeof(pdata));
if (ret) {
dev_err(dev, "failed to add platform_data\n");
--
1.8.4
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html