summaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/ci.h
diff options
context:
space:
mode:
authorLi Jun <jun.li@freescale.com>2015-07-09 15:18:46 +0800
committerFelipe Balbi <balbi@ti.com>2015-07-29 09:59:21 -0500
commitb0930d4cafb487a663ac6780a0369d1a0f461bc2 (patch)
tree155c859d0e0b28c190b1345ab7ef8777de95903f /drivers/usb/chipidea/ci.h
parent79742351c89b76ebcf82b73103aed50f98ac2ee4 (diff)
downloadlinux-b0930d4cafb487a663ac6780a0369d1a0f461bc2.tar.bz2
usb: chipidea: update ci_otg_is_fsm_mode conditions
After introduce usb otg properties, update ci_otg_is_fsm_mode conditions to be depending on both usb hardware properties and usb driver config, also resolve a compile issue in debug.c after the API change. Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Li Jun <jun.li@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/chipidea/ci.h')
-rw-r--r--drivers/usb/chipidea/ci.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
index 6d6200e37b71..f243f0b431c3 100644
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@ -406,8 +406,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