diff options
author | Brian Norris <computersforpeace@gmail.com> | 2015-11-15 20:30:53 -0800 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-11-15 20:31:29 -0800 |
commit | 617f41836c17688141e1c66f4156c2084f8ca86d (patch) | |
tree | e57d631bb3bb061a0ff2e99bc85f94bd1c30598f /drivers/usb/musb/musb_dsps.c | |
parent | 26add94cd535d1e000e7871fe69c7bb89e942d67 (diff) | |
parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) |
Merge v4.4-rc1 into MTD development
Sync up with the upstream development.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/usb/musb/musb_dsps.c')
-rw-r--r-- | drivers/usb/musb/musb_dsps.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index a0cfead6150f..eeb7d9ecf7df 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -225,8 +225,11 @@ static void dsps_musb_enable(struct musb *musb) dsps_writel(reg_base, wrp->epintr_set, epmask); dsps_writel(reg_base, wrp->coreintr_set, coremask); - /* start polling for ID change. */ - mod_timer(&glue->timer, jiffies + msecs_to_jiffies(wrp->poll_timeout)); + /* start polling for ID change in dual-role idle mode */ + if (musb->xceiv->otg->state == OTG_STATE_B_IDLE && + musb->port_mode == MUSB_PORT_MODE_DUAL_ROLE) + mod_timer(&glue->timer, jiffies + + msecs_to_jiffies(wrp->poll_timeout)); dsps_musb_try_idle(musb, 0); } @@ -663,7 +666,7 @@ static int get_musb_port_mode(struct device *dev) { enum usb_dr_mode mode; - mode = of_usb_get_dr_mode(dev->of_node); + mode = usb_get_dr_mode(dev); switch (mode) { case USB_DR_MODE_HOST: return MUSB_PORT_MODE_HOST; @@ -744,6 +747,19 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue, if (!ret && val) config->multipoint = true; + config->maximum_speed = usb_get_maximum_speed(&parent->dev); + 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"); |