Commit b0930d4c authored by Li Jun's avatar Li Jun Committed by Felipe Balbi

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: default avatarPeter Chen <peter.chen@freescale.com>
Signed-off-by: default avatarLi Jun <jun.li@freescale.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 79742351
...@@ -406,8 +406,11 @@ static inline u32 hw_test_and_write(struct ci_hdrc *ci, enum ci_hw_regs reg, ...@@ -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) static inline bool ci_otg_is_fsm_mode(struct ci_hdrc *ci)
{ {
#ifdef CONFIG_USB_OTG_FSM #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] && 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 #else
return false; return false;
#endif #endif
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <linux/usb/phy.h> #include <linux/usb/phy.h>
#include <linux/usb/otg.h> #include <linux/usb/otg.h>
#include <linux/usb/otg-fsm.h> #include <linux/usb/otg-fsm.h>
#include <linux/usb/chipidea.h>
#include "ci.h" #include "ci.h"
#include "udc.h" #include "udc.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment