diff options
author | Li Jun <jun.li@freescale.com> | 2015-05-27 14:09:24 +0800 |
---|---|---|
committer | Li Jun <jun.li@freescale.com> | 2015-07-07 11:18:31 +0800 |
commit | 502ffedb66e4d1cb0a4676b209e9b19b746de7c3 (patch) | |
tree | 85ec8766cf8e5bd7b6ee67aa2a3aa38cb1b02469 /drivers | |
parent | ec53d399f649b9d3eeefd0e4f1b7770241f9db63 (diff) |
MLK-11123-9 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.
Signed-off-by: Li Jun <jun.li@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/chipidea/ci.h | 5 | ||||
-rw-r--r-- | drivers/usb/chipidea/debug.c | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h index 4347e729d5b8..b1a33919840e 100644 --- a/drivers/usb/chipidea/ci.h +++ b/drivers/usb/chipidea/ci.h @@ -434,8 +434,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->hnp_support || + otg_caps->srp_support || otg_caps->adp_support); #else return false; #endif diff --git a/drivers/usb/chipidea/debug.c b/drivers/usb/chipidea/debug.c index dfb05edcdb96..d95f842029da 100644 --- a/drivers/usb/chipidea/debug.c +++ b/drivers/usb/chipidea/debug.c @@ -10,6 +10,7 @@ #include <linux/usb/phy.h> #include <linux/usb/otg.h> #include <linux/usb/otg-fsm.h> +#include <linux/usb/chipidea.h> #include "ci.h" #include "udc.h" |