]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/usb/chipidea/core.c
Merge tag 'usb-for-v4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb...
[karo-tx-linux.git] / drivers / usb / chipidea / core.c
index 3ad48e1c0c57e1722311c8393ad3bd21712fa1e7..ab6212e888e1e55d7bc4655e2be474aeb308371f 100644 (file)
@@ -560,6 +560,8 @@ static irqreturn_t ci_irq(int irq, void *data)
 static int ci_get_platdata(struct device *dev,
                struct ci_hdrc_platform_data *platdata)
 {
+       int ret;
+
        if (!platdata->phy_mode)
                platdata->phy_mode = of_usb_get_phy_mode(dev->of_node);
 
@@ -588,6 +590,19 @@ static int ci_get_platdata(struct device *dev,
                                of_usb_host_tpl_support(dev->of_node);
        }
 
+       if (platdata->dr_mode == USB_DR_MODE_OTG) {
+               /* We can support HNP and SRP of OTG 2.0 */
+               platdata->ci_otg_caps.otg_rev = 0x0200;
+               platdata->ci_otg_caps.hnp_support = true;
+               platdata->ci_otg_caps.srp_support = true;
+
+               /* Update otg capabilities by DT properties */
+               ret = of_usb_update_otg_caps(dev->of_node,
+                                       &platdata->ci_otg_caps);
+               if (ret)
+                       return ret;
+       }
+
        if (of_usb_get_maximum_speed(dev->of_node) == USB_SPEED_FULL)
                platdata->flags |= CI_HDRC_FORCE_FULLSPEED;