summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_dsps.c
diff options
context:
space:
mode:
authorBin Liu <b-liu@ti.com>2015-09-09 11:56:18 -0500
committerFelipe Balbi <balbi@ti.com>2015-09-27 10:54:31 -0500
commit41932b9b8adc14b5650e8909f66d5bd08619b81c (patch)
treec264c47376124f961236b91cedc6e2c9c15538db /drivers/usb/musb/musb_dsps.c
parent9b7537642cb6ad400ee4a95114582ba758b3009c (diff)
downloadblackbird-obmc-linux-41932b9b8adc14b5650e8909f66d5bd08619b81c.tar.gz
blackbird-obmc-linux-41932b9b8adc14b5650e8909f66d5bd08619b81c.zip
usb: musb: dsps: control musb speed based on dts setting
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 <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_dsps.c')
-rw-r--r--drivers/usb/musb/musb_dsps.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 84512d1d5eee..c8b2ec9a79d6 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -747,6 +747,19 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue,
if (!ret && val)
config->multipoint = true;
+ config->maximum_speed = of_usb_get_maximum_speed(dn);
+ switch (config->maximum_speed) {
+ case USB_SPEED_LOW:
+ case USB_SPEED_FULL:
+ break;
+ case USB_SPEED_SUPER:
+ dev_warn(dev, "ignore incorrect maximum_speed "
+ "(super-speed) setting in dts");
+ /* fall through */
+ default:
+ 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");
OpenPOWER on IntegriCloud