usb: phy: Add and use missed helper functions
This patch implements missed helper functions for start_gadget() and start_host() OTG FSM callbacks. Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
737cc66eac
commit
425d710172
2 changed files with 18 additions and 4 deletions
|
@ -41,17 +41,17 @@ static int otg_set_protocol(struct otg_fsm *fsm, int protocol)
|
||||||
fsm->protocol, protocol);
|
fsm->protocol, protocol);
|
||||||
/* stop old protocol */
|
/* stop old protocol */
|
||||||
if (fsm->protocol == PROTO_HOST)
|
if (fsm->protocol == PROTO_HOST)
|
||||||
ret = fsm->ops->start_host(fsm, 0);
|
ret = otg_start_host(fsm, 0);
|
||||||
else if (fsm->protocol == PROTO_GADGET)
|
else if (fsm->protocol == PROTO_GADGET)
|
||||||
ret = fsm->ops->start_gadget(fsm, 0);
|
ret = otg_start_gadget(fsm, 0);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* start new protocol */
|
/* start new protocol */
|
||||||
if (protocol == PROTO_HOST)
|
if (protocol == PROTO_HOST)
|
||||||
ret = fsm->ops->start_host(fsm, 1);
|
ret = otg_start_host(fsm, 1);
|
||||||
else if (protocol == PROTO_GADGET)
|
else if (protocol == PROTO_GADGET)
|
||||||
ret = fsm->ops->start_gadget(fsm, 1);
|
ret = otg_start_gadget(fsm, 1);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
|
@ -160,6 +160,20 @@ static inline int otg_del_timer(struct otg_fsm *fsm, void *timer)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int otg_start_host(struct otg_fsm *fsm, int on)
|
||||||
|
{
|
||||||
|
if (!fsm->ops->start_host)
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
return fsm->ops->start_host(fsm, on);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int otg_start_gadget(struct otg_fsm *fsm, int on)
|
||||||
|
{
|
||||||
|
if (!fsm->ops->start_gadget)
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
return fsm->ops->start_gadget(fsm, on);
|
||||||
|
}
|
||||||
|
|
||||||
int otg_statemachine(struct otg_fsm *fsm);
|
int otg_statemachine(struct otg_fsm *fsm);
|
||||||
|
|
||||||
/* Defined by device specific driver, for different timer implementation */
|
/* Defined by device specific driver, for different timer implementation */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue