Merge tag 'usb-ci-v4.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter...
[firefly-linux-kernel-4.4.55.git] / drivers / usb / chipidea / ci.h
index 1320a4dbbcd5a7ec9d160032b84e2613d36c6b33..41d7cf6d63ba32a240add0eaa7c01f63fa8b1f28 100644 (file)
@@ -51,6 +51,7 @@ enum ci_hw_regs {
        OP_DEVICEADDR,
        OP_ENDPTLISTADDR,
        OP_TTCTRL,
+       OP_BURSTSIZE,
        OP_PORTSC,
        OP_DEVLC,
        OP_OTGSC,
@@ -407,8 +408,11 @@ static inline u32 hw_test_and_write(struct ci_hdrc *ci, enum ci_hw_regs reg,
 static inline bool ci_otg_is_fsm_mode(struct ci_hdrc *ci)
 {
 #ifdef CONFIG_USB_OTG_FSM
+       struct usb_otg_caps *otg_caps = &ci->platdata->ci_otg_caps;
+
        return ci->is_otg && ci->roles[CI_ROLE_HOST] &&
-                                       ci->roles[CI_ROLE_GADGET];
+               ci->roles[CI_ROLE_GADGET] && (otg_caps->srp_support ||
+               otg_caps->hnp_support || otg_caps->adp_support);
 #else
        return false;
 #endif